Instruction manual

Chapter 3 Programming Your Counter for Remote Operation
Programming the Counter to Synchronize Measurements
Programming Guide 3-49
3
Using the *WAI Command
This command is most useful when only the Counter is on the bus, and
you want the Counter to send the data when it is ready. In this example,
the Counter is instructed to take 50 measurements and return the
average for these 50 measurements. The *WAI command that follows the
:INIT command instructs the Counter to hold off execution of any further
commands until the 50 measurements are complete. When the Counter
has completed the 50 measurements and averages, it executes the DATA?
command, which requests the results.
NOTE Do not put more than one command on a single line. If you put multiple
commands on a single line, extra characters (T and/or A) may be
generated.
Using the *OPC? Command
This method is useful if you want to hold off execution of the program
while you wait for the Counter to complete any pending activity. In the
*WAI example above, the line following the *WAI command is accepted by
the Counter. However, the Counter does not execute the command
because of the preceding *WAI command. If this line had been a command
to address another instrument, it would be immediately executed.
:AVERAGE:COUNT 50
:AVERAGE:STATE ON
:INIT
*WAI
DATA?
Base the result on 50 measurements.
Enable averaging.
Start 50 measurements
Wait until 50 measurements are complete
before parsing another command. At this
point, commands can be issued to other
instruments. The Counter stores
subsequent commands but ignores them
until the measurement is complete.
Asks for the results of the 50
measurements. This command is not
executed until all 50 measurements are
complete and the average is computed.