Remote Operation
Introduction to Controlling an WDCA
ment when to execute as fast as possible and when to stop and wait for a com-
mand to complete. In particular, it is important to wait for a sweep to complete
before reading markers or trace data.
*OPC Command
The more frequently used command, operation complete, or *OPC, has two
command forms:
• *OPC tells the instrument to set the OPC bit (bit zero of extended status reg-
ister) when all the commands received prior to OPC have completed.
• *OPC? tells the instrument to respond with a "1" when all the commands re-
ceiver prior to OPC have completed. The status bit is not set in this case.
*OPC works for any command, as in taking sweeps, doing calibrations, normal-
ization, and so on. Of the two command forms, Agilent recommends that you
use *OPC? in most cases. Using Visual Basic, a typical transaction may be:
sendCommand inst, ":SENSe:STARt 1520 nm;:SENSe:STOP 1525 nm;:INITiate:IMMediate;
*OPC?"
value = readIntReply(inst)
sendCommand inst, ":CALCulate:MARKer1:MAXimum;:CALCulate:MARKer1:X?"
value = readDoubleReply(inst)
where:
• sendCommand is a routine in your favorite language using your favorite inter-
face to send a command to the WDCA.
• inst is a handle to the WDCA appropriate to the interface you are using.
• readIntReply is a routine in your favorite language using your favorite interface
to read a reply from the WDCA and convert it to an integer.
• readDoubleReply is a routine in your favorite language using your favorite in-
terface to read a reply from the WDCA and convert it to a double precision
real number.
In the above example, the WDCA is set up for a measurement, a sweep is initi-
ated, then the WDCA pauses until the sweep is completed. Once the sweep is
complete, a marker is set to the maximum peak and then the marker wave-
length is read. If *OPC? was not used to force the instrument to wait, the
WDCA would have started the sweep, and then moved the marker to the max-
imum peak on the partially completed sweep. In general, it is necessary to use
OPC synchronization before any command that moves markers or reads data
back into the controller.
5-12
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com