beautypg.com

1 using the *opc command, 2 using the *opc? query, 6 remote units – American Magnetics 187 Self-Compensating Liquid Level Controller User Manual

Page 48: 1 using the, 2 using the, Remote units, Remote interface reference

background image

37

Remote Interface Reference

Command Handshaking

4.2.5.1 Using the

*OPC

Command

The

*OPC

command is executed within the normal command queue. Upon

completed execution of the

*OPC

command, the “Operation Complete” bit

(bit 0) of the Standard Event register will be set.

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:

PERCENT; CONF:ALARM:A 50.0; CONF:ALARM:B 20.0; *OPC;

The above example sets the remote units to percent, the “A” alarm to
50.0%, the “B” alarm to 20.0%, and sends

*OPC

as the 4th command for

determining when execution all of the commands (including

*OPC

) has

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.5.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 requesting remote
interface when executed. Using

*OPC?

is often the most straightforward

solution for determining completed command execution. It is also
unambiguous since the result is returned directly to the requesting remote
communication interface.

4.2.6

Remote Units

The Model 187 supports a remote units setting that is maintained
separately from the units selected via the front panel keypad. The remote
units setting is retained between power-ups. If the

PERCENT

command is

sent to the remote interface, the remote units for both remote interfaces is
set to percent. All alarm values should then be sent as a percent value, and
all return level data and alarm queries are returned in units of percent.

The

UNITs?

query returns the currently selected remote units, e.g. the

percent setting would return

0,”PERCENT”

.