9 Programming the Instrument
9.3 SCPI Operation and Results Query
More Information
The format and byte order of the sent or received data depend on "Format Data:
Numeric Data (Remote Command Only)" on page 2438 and "Format Data: Byte
Order (Remote Command Only)" on page 2439. ASCII data consists of a string of
comma separated values. REAL or INTeger data is sent as a definite length block,
with a header describing the data to follow.
For example, a four point trace might look like this if in ASCII (FORMat:DATA
ASCii):
–5.87350E+01, –5.89110E+01, –5.87205E+01, –5.12345E+01<NL><END>
and like this if in INTeger with 4 bytes per point (FORMat:DATA INT,32):
#216<16 bytes of data><NL><END>
where the 2 in the #216 means “2 digits of numeric data to follow”, and the 16 is the
2 digits and means “16 binary bytes to follow” (this is the definite length block
format).
Note that the data is terminated with <NL><END>. (For GPIB this is newline, or
linefeed, followed by EOI set true. For LAN, this is newline only.)
The data format set by "Format Data: Numeric Data (Remote Command Only)" on
page 2438 and "Format Data: Byte Order (Remote Command Only)" on page 2439 is
used both for sending data to the instrument and receiving data from the
instrument.
When sending data to the instrument, the data block must contain exactly the
number of points currently specified in Sweep, Points or an error message will be
generated and there will be no change to the target trace.
No units terminator (for example, dB or V) is used when sending data; the data is
taken as being in the current Y Axis Unit of the instrument.
When a trace is sent to the instrument, it immediately overwrites all of the data in
the target trace. Consequently the trace should be inactive in order to achieve
predictable results. If you send trace data while a trace is active, and particularly if a
sweep or an Average or Max/Min Hold sequence is already in progress, you may end
up with a trace that combines the data you sent with measurement data. Similarly,
when querying trace data, it is best if the instrument is not sweeping during the
query.
Therefore, it is generally advisable to be in Single sweep, or have the trace in View,
when sending trace data to the instrument or querying trace data from the
instrument.
2437 Short Range Comms & IoT Mode User's &Programmer's Reference