Introduction, Decoding the ascii string, Appendix e – Fluke 2625A User Manual

Page 181

Advertising
background image

E-1

Appendix E

Binary Upload of Logged Data

(LOG_BIN?) (2625A only)

Introduction

The LOG_BIN? <index> query can be used to quickly upload logged data from a 2625A.
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 2625A.

The measurement data returned from the 2625A 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
number of channels for the scan. The following C code converts a LOG_BIN? response
string into a byte array:

Advertising
This manual is related to the following products: