Remote Operations
Remote Program Examples
5
5-45
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?
”
! 5522A ADDRESS IS 4
20 INPUT @4, A ! READ THE
“
1
”
FROM THE 5522A
30 !PROGRAM HALTS HERE UNTIL A
“
1
”
IS PUT INTO THE OUTPUT BUFFER
40 PRINT
“
OUTPUT SETTLED
”
The
*OPC
command is similar in operation to the
*OPC?
query, except that it sets bit 0
(OPC for “Operation Complete”) in the Event Status Register to 1 rather than sending a 1
to the output buffer. One simple use for
*OPC
is to include it in the program in order for
it to generate an SRQ (Service Request). Then an SRQ handler written into the program
can detect the operation complete condition and respond appropriately. You can use
*OPC
similarly to
*OPC?
, except your program must read the ESR to detect the
completion of all operations. The following sample program shows how you can use
*OPC
.
10 REMOTE
20 PRINT @4, “OUT 100V,1KHZ;OPER;*OPC” ! 5522A ADDRESS IS 4
30 PRINT @4, “*ESR?” ! PUT THE ESR BYTE IN BUFFER
40 INPUT @4, A% ! READ THE ESR BYTE
50 IF (A% AND 1%) = 0% GOTO 30 ! TRY AGAIN IF NO OPC
60 PRINT “OUTPUT SETTLED”
70 END
The
*WAI
command causes the Calibrator to wait until any prior commands have been
completed before continuing on to the next command, and takes no other action. Using
*WAI
is a convenient way to halt operation until the command or commands preceding it
have completed. The following sample program shows how you can use
*WAI
.
10 REMOTE
20 PRINT @4, “OUT 100V,1KHZ;OPER;*WAI” ! 5522A ADDRESS IS 4
30 PRINT @4, “OUT?” ! READ THE OUTPUT VALUE
40 PRINT @4, A$,B$,C$ ! A$ CONTAINS THE OUTPUT VALUE
50 PRINT “OUTPUT SETTLED”
60 PRINT “OUTPUT IS: “;A$;B$;” at “;C$
70 END
Taking a Thermocouple Measurement
The following program takes one temperature measurement at a time.
10 REM Set Bus Timeout to 20 seconds, Init IEEE Bus
20 TIMEOUT 20 * 1000
30 INIT PORT 0
40 CLEAR @6
100 REM Reset 5522A, TC measurement mode
110 PRINT @6,”*RST; TC_TYPE J; TC_MEAS FAR”
200 PRINT “Hit Carriage Return to take a Reading”
210 INPUTLINE A$
220 REM Request the measurement value
230 PRINT @6, “VAL?”
240 REM Read measurement, unit
250 INPUT @6, M,U$
260 GOTO 200
Taking a Pressure Measurement
The following program takes one pressure measurement at a time.
10 REM Set Bus Timeout to 20 seconds, Init IEEE Bus
20 TIMEOUT 20 * 1000
30 INIT PORT 0
40 CLEAR @6
100 REM Reset 5522A, pressure measurement mode
110 PRINT @6,”*RST; PRES_MEAS “
200 PRINT “Hit Carriage Return to take a Reading”
210 INPUTLINE A$
220 REM Request the measurement value
230 PRINT @6, “VAL?”
240 REM Read measurement, unit
Содержание 5522A Operators
Страница 4: ......
Страница 14: ...5522A Operators Manual x ...
Страница 18: ...5522A Operators Manual xiv ...
Страница 22: ...5522A Operators Manual 1 2 ...
Страница 46: ...5522A Operators Manual 1 26 ...
Страница 48: ...5522A Operators Manual 2 2 ...
Страница 54: ...5522A Operators Manual 2 8 ...
Страница 56: ...5522A Operators Manual 3 2 ...
Страница 189: ...6 1 Chapter 6 Remote Commands Title Page Introduction 6 3 Command Summary by Function 6 3 Commands 6 10 ...
Страница 190: ...5522A Operators Manual 6 2 ...
Страница 240: ...5522A Operators Manual 7 2 ...
Страница 260: ...5522A Operators Manual 8 2 ...
Страница 314: ...5522A Operators Manual 9 52 ...
Страница 370: ...5522A Operators Manual 10 56 ...
Страница 413: ...B 1 Appendix B ASCII and IEEE 488 Bus Codes ...
Страница 414: ...5522A Operators Manual B 2 ...
Страница 416: ...5522A Operators Manual B 4 ...
Страница 426: ...5522A Operators Manual D 6 ...