6
Wave form Structure
|
|
Interpreting the
waveform vertical data
184
STRUMENT_NAME at 76 bytes from the descriptor start (or byte
97 above).
In a similar way we learn that a 4 byte long integer giving the length
of the descriptor starts at byte 36 (or byte 57 above):
WAVE_DESCRIPTOR = 15a (hex) = 346
At byte 60 (or byte 81 above) we find another 4 byte integer giving
the length of the data array:
WAVE_ARRAY_I = 54 (hex) =
and at byte 116 (or byte 137 above) the number of data points:
WAVE_ARRAY_COUNT = 2a (hex) =
Now we know that the data will start at byte 346 from the begin-
ning of the descriptor (or byte 367 above) and that each of the
data points will be represented by two bytes. The waveform has a
total length of 346 + 84 which is the same as the ASCII string told
us at the beginning of the block. The final 0a at byte 451 is the NL
character associated with the GPIB message terminator
<NL><EOI>.
The data can be easily seen starting at byte 367 above. Since the
example was taken using an oscilloscope with an 8-bit ADC we see
those 8 bits followed by a 0 byte for each data point. It should be
noted that for oscilloscopes with 10-bit ADCs or for many other
kinds of waveform this second byte will not be zero and contains
interesting information. The data is coded in signed form (two’s
complement) with values ranging from -32768 = 8000 (hex)
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).
Now that we know how to decipher the data it would be useful to
convert it to the appropriate measured values. The vertical reading
for each data point depends on the vertical gain and the vertical
offset given in the descriptor. For acquisition waveforms this corre-
sponds to the volts/div and voltage offset selected after conversion
for the data representation being used. The template tells us that
the vertical gain and offset can be found at bytes 156 and 160
respectively of the descriptor and that they are stored as floating
point numbers in the IEEE 32 bit format. An ASCII string giving
the vertical unit is to be found in VERTUNIT, byte 196. The verti-
cal value is given by the relationship:
value = VERTICAL_GAIN
°
data - VERTICAL_OFFSET
A data value of 0 is normally displayed as a point in the middle of
the grid.