The following example shows logic analyzer data being returned to a
string variable with headers off:
10 OUTPUT XXX;":SYSTEM:HEAOER OFF"
20 DIM Rang$[30]
30 OUTPUT XXX;" :MACHINEl:TWAVEFORM:RANGE?"
40 ENTER XXX;Rang$
50 PRINT Rangf
60 END
After running this program, the controller displays:
+
l.OOOOOE-05
Numeric Base
Most numeric data will be returned in the same base as shown on screen.
When the
prefix
#B precedes the returned data, the value is in the binary
base. Likewise,
#Q
is the octal base and
#H
is the hexadecimal base. If
no prefer precedes the returned numeric data, then the value is in the
decimal base.
Numeric Variables
If your host language can convert from ASCII to a numeric format, then
you can use numeric variables. Turning off the response headers will help
you avoid accidently trying to convert the header into a number.
The following example shows logic analyzer data being returned to a
numeric variable.
10 OUTPUT XXX;":SYSTEM:HEAOER OFF"
20 OUTPUT XXX;" :MACHINEl:TWAVEFORM:RANGE?"
30 ENTER XXX;Rang
40 PRINT Rang
50 END
This time the format of the number (such as whether or not exponential
notation is used) is dependant upon your host language. In BASIC, the
output would look like:
l.E-5
Introduction to Programming an Instrument
1-16
HP 1650B/HP 16518
Programming Reference