beautypg.com

Teledyne LeCroy X-STREAM OSCILLOSCOPES Remote Control User Manual

Page 62

background image

P

A R T

O

N E

:

A B O U T

R E M O T E

C O N T R O L

56

ISSUED: February 2005

WM-RCM-E Rev D

On the previous page...
The first 10 bytes translate into ASCII and resemble the simple beginning of a query response. These are

followed by the string #9000000450, the beginning of a binary block in which nine ASCII integers are used to
give the length of the block (450 bytes). The waveform itself starts immediately after this, at Byte 21. The very

first byte is at zero byte count, as it is for the first byte in each block.

The first object is a DESCRIPTOR_NAME, a string of 16 characters with the value WAVEDESC.

Then, 16 bytes after the beginning of the descriptor, at Byte 37, we find the beginning of the next string: the
TEMPLATE_NAME with the value LECROY_2_2.

Several other parameters follow. The INSTRUMENT_NAME, LECROYLT344, 76 bytes from the descriptor
start (Byte 97), is easily recognizable.

A very important byte is found at position 34 after the descriptor start. This is the value COMM_ORDER,
which gives the order of subsequent bytes in the file. This byte is of enum type, taking the possible values 0 for

high byte first, and 1 for low byte first. All subsequent readings of the file must use the information given by
this byte.

On the preceding line, 36 bytes after the descriptor start (Byte 57), a four

-

byte

integer gives the length of the

descriptor: WAVE_DESCRIPTOR = 00 00 01 5A (hex) = 346.

At 60 bytes from the descriptor start (Byte 81) we find another four

-

byte integer giving the length of the data

array: WAVE_ARRAY_1 = 00 00 00 68 (hex) = 104.

And at 116 bytes after the descriptor (Byte 137), yet another four-byte integer gives the number of data points:
WAVE_ARRAY_COUNT = 00 0000 34 (hex) = 52.

Now we know that the data will start at 346 bytes from the descriptor’s beginning (Byte 367), and that each of
the 52 data points will be represented by two bytes. The waveform has a total length of 346 + 104, which is the

same as the ASCII string indicated at the beginning of the block. The final 0A at Byte 471 is the NL character
associated with the GPIB message terminator .

Because the example was taken using an oscilloscope with an eight-bit ADC, we see the eight bits followed by a
0 byte for each data point. However, for many other kinds of waveform this second byte will not be zero and

will contain significant information. The data is coded in signed form (two’s complement) with values ranging
from -32768 = 8000 (hex) to 32767 = 7FFF (hex). If we had chosen to use the BYTE option for the data

format, the values would have been signed integers in the range -128 = 80 (hex) to 127 = 7F (hex). The ADC
values are mapped to the display grid in the following way:

• 0 is located on the grid’s center axis
• 127 (BYTE format) or 32767 (WORD format) is located at the top of the grid
• -128 (BYTE format) or -32768 (WORD format) is located at the bottom of the grid.
From bottom to top of the screen we have 80 , 81, 82 . . . . FD, FE, FF, 0, 1, 2 . . . . 7D, 7E, 7F.

To convert from these byte values to actual numerical values, or vice versa, we can use the following formula,

for eight bit values: - New value = [Old value + 80 (hex) ] AND 255.