Remote Operation
Remote Program Examples
5
5-47
5-61. Verifying a Meter on the IEEE-488 Bus
This program selects 10 V dc output, verifies that the Calibrator is set to 10 V, then
triggers a Fluke 45 to take a reading. It displays calibrator output, Fluke 45 reading, and
the meter error in ppm. The program assumes that the Calibrator bus address is 4 and the
Fluke 45 bus address is 1.
10 REM THIS PROGRAM VERIFIES THE ACCURACY OF A FLUKE 45 AT 10V DC
20 INIT PORT 0 ! INITIALIZE THE INTERFACE
30 CLEAR PORT 0 ! “
40 PRINT @1, “VDC;RATE 5;AUTO;TRIGGER 2” ! SETS FLUKE 45 TO 10V DC
50 PRINT @1, “OUT 10 V ; OPER; ! SET THE 5520A TO 10V DC
60 PRINT @4, “*WAI; OUT?” ! WAIT FOR SETTLE, REQUEST THE OUTPUT VALUE
70 PRINT @4, V,U$,F,V2,U2$ ! GET THE DATA FROM THE 5520A
80 PRINT @1, “*TRG;VAL?” ! TRIGGER 45 TO TAKE READING
90 INPUT @1, VM ! GET THE DATA FROM THE 45
100 ER = ABS(V - VM)/V * 1E6 ! COMPUTE ERROR
110 PRINT “5520 OUTPUT: “;V;U$ ! PRINT THE RESULTS
120 PRINT “45 MEASURED: “;VM;”V”
130 PRINT “ERROR: “;ER;”PPM”
140 END
5-62. Verifying a Meter on the RS-232 UUT Serial Port
This program selects 10 V dc output, verifies that the Calibrator is set to 10 V, then
triggers a Fluke 45 to take a reading. It displays Calibrator output, the Fluke 45 reading,
and the meter error in ppm. The program assumes that the Calibrator uses the IEEE-488
interface with bus address is 4 and the Fluke 45 is on the Calibrator SERIAL 2 TO UUT
port.
10 REM THIS PROGRAM VERIFIES THE ACCURACY OF A FLUKE 45 AT 10V DC
20 INIT PORT 0 ! INITIALIZE THE INTERFACE
30 CLEAR PORT 0 ! “
40 PRINT @4, “UUT_SEND `VDC;RATE S;AUTO;TRIGGER 2\n’” ! SET FLUKE 45
50 PRINT @4, “UUT_RECV” ! SEND THE FLUKE 45 PROMPT
60 PRINT @4, P$ ! GET THE FLUKE 45 PROMPT
70 PRINT @4, “OUT 10 V ; OPER” ! SET THE 5520A TO 10 V DC
80 PRINT @4, “*WAI; OUT?” ! WAIT FOR SETTLE; GET VALUE
90 PRINT @4, “V,U$,F,V2,U2$” ! GET THE DATA FROM 5520A
100 PRINT @4, “UUT_SEND `*TRG; VAL?\n’” ! TRIGGER FLUKE 45 READING
110 PRINT @4, “UUT_RECV?” ! SEND 45 READING TO 5520A
120 INPUT @4, VM, P$ ! GET 45 READING AND PROMPT
130 ER = ABS (V - VM)/V * 1E6 ! COMPUTE ERROR
140 PRINT “5520 OUTPUT: “;V;U$ ! PRINT THE RESULTS
150 PRINT “FLUKE 45 MEASURED: “;ER;”PPM” ! PRINT THE RESULTS
160 END
5-63. Using *OPC?, *OPC, and *WAI
The *OPC?, *OPC, and *WAI commands let you maintain control of the order of
execution of commands that could otherwise be passed up by subsequent commands.
If you had sent an OUT command, you can check if the output has settled be sending the
query *OPC?. As soon as the OUT command has completed (output settled), a “1”
appears in the output buffer. You should always follow an *OPC? command with a read
command. The read command causes program execution to pause until the addressed
instrument responds. The following sample program shows how you can use *OPC?.
10 PRINT @4, “OUT 100V,1KHZ;OPER; *OPC?” ! 5520A ADDRESS IS 4
20 INPUT @4, A ! READ THE “1” FROM THE 5520A
30 !PROGRAM HALTS HERE UNTIL A “1” IS PUT INTO THE OUTPUT BUFFER
40 PRINT “OUTPUT SETTLED”