Fluke 2635A user manual Binary Upload of Logged Data, Decoding the Ascii String

Models: 2635A

1 268
Download 268 pages 28.28 Kb
Page 235
Image 235

Appendix C

Binary Upload of Logged Data

Introduction

The LOG_BIN? <index> query can be used to quickly upload logged data from a 2635A. The response is a single ASCII string, which encodes the raw binary data stored at the specified <index> position. The logged data is also retained in the 2635A.

The measurement data returned from the 2635A is in the (binary) IEEE single-precision floating point format. Making use of this data can be difficult and is very machine dependent. A working example, using the C programming language on an IBM PC, is provided in this appendix. This example uses a pre-computed LOG_BIN?response string, and checks that the conversion process works as expected.

Two steps are required in adapting the LOG_BIN? response string for use with your computer.

First, you must decode the ASCII string into binary data.

For example, one possible LOG_BIN? response string is:

LOG_BIN? 1

42@Y40BA00oo000007o0001oP000?h000

=>

This ASCII string represents the following binary (hex) data:

10 24 29 10 04 91 00 0f ff

00 00 00 00 7f c0 00 00 7f

80 00 00 3f 80 00 00 00 00

Second, you must convert this binary data into valid floating point numbers for your underlying computer architecture.

Decoding the ASCII String

The ASCII response string contains six bits of raw data for each ASCII character, offset from ASCII ’0’ (0x30 hex, 48 decimal). Therefore, the conversion process subtracts 48 from the integer value of each character, then shifts it into place. Each set of four ASCII characters form three bytes of raw data. The number of bytes of raw data depends on the

C-1

Page 235
Image 235
Fluke 2635A user manual Binary Upload of Logged Data, Decoding the Ascii String