2 using the *opc? query, Remote interface reference – American Magnetics 420 Power Supply Programmer User Manual
Page 93

75
Remote Interface Reference
Command Handshaking
If the operator has so configured the Standard Event and Status Byte
enable registers, the
*OPC
command can generate an IEEE-488 service
request when execution completes (see Figure 4-1). If using the serial port,
the
*OPC?
query is a better alternative since a response is returned
directly to the requesting communications interface.
An example of a sequence of commands using the
*OPC
command to
handshake is the following:
CONF:RAMP:CURR 50.0, 0.1; CONF:VOLT:LIM 5.0; *OPC;
The above example sets the programmed current to 50.0 A, the ramp rate
to 0.1 A/s, the voltage limit to 5.0 V, and sends as the third command the
*OPC
command for determining when execution all of the commands
(including
*OPC
) is completed. If the Standard Event and Status Byte
enable registers are correctly configured, the
*OPC
command will then
result in an IEEE-488 service request when execution completes.
Alternately, the Serial Poll function of the IEEE-488 bus may be used to
determine completion of the command.
4.2.4.2 Using the
*OPC?
Query
The
*OPC?
query is similar to the
*OPC
command, but instead of setting
the “Operation Complete” bit of the Standard Event register, the
*OPC?
query returns a “1” (plus termination characters) to the appropriate output
buffer when executed. Using
*OPC?
is often the simpler solution for
determining completed command execution. It is also unambiguous during
simultaneous serial and IEEE-488 operation since the result is returned
directly to the requesting communication interface.