
OA 5000 Series User Manual A --- 1 1
Appendix D: Using the *OPCQuery/CommandWhen you are using the OA5000 in an automated test environment, it is
important that yoube aw are ofthe finite times for certain OA 5000 com-
mands to complete. Forexample: suppose you develop an automated test
in which the attenuator is adjusted over the GPIBbus via the ATT:DB n
command. After each adjustment by the attenuator,you might then make an
automated reading from an opticalpower meter (such as the Tektronix
OCP 5502). In such a sequence, it is importantthat you not initiate the
reading from the opticalpower meter before the attenuator has completed
all adjustments and has come to a stableposition (that is, the ATT ADJ
indicator is no longer illuminated).
Below is an example that illustrates th e use of GPIB commands and queries
utilizing the *OPC? query/command. In this example, queries to other inst ru-
ments (such as the power meter in this example) are notmade until all of
the OA 5000’s pending operationshave completed.
Example: A command is sent to the OA 5000 to change attenuation to
45 dB; the command is immediatelyfollowed by an *OPC? query across the
GPIB bus to the same OA 5000.
1. Write to the OA 5000 GPIBaddress: ATT:DB 45.00; *OPC?
2. Read from OA 5000 GPIB address:1
Depending on the previous attenuationsetting of the OA 5000, several
seconds may be required beforethe AT T:DB command is completedand
the *OPC? produces a “1”inthe OA 5000 GPIB output queue. After the
*OPC? query issent to the OA 5000, the programmer should immediately
attempt a GPIB read instructionfrom the controller. The programmer’s
controllershould wait until the OA 5000 finishes all adjustments and the
*OPC query provides a “1”to be read.
NOTE
It is important that you remember to set the time-out of the control-
ler’s GPIB READ instruction to be greater than the longest time
possible for the OA 5000 to make any adjustments (up to five
seconds may be required to make large changes to attenuation
settings).