Remote Operations
Remote Program Examples
5
5-43
be placed in standby and the output may be changed to accommodate the new
external connection. The setting may be set even if the present output does not use
the setting (for example, setting the current post while sourcing voltage).
•
The output and output mode should be programmed next with the OUT command.
•
All other output parameters such as impedance compensation, offset, and waveforms
should be programmed next. The DUTY command must follow the WAVE
command.
•
The error status should be checked with the ERR? command. The calibrator will not
process the OPER command if an unacknowledged error exists.
•
Finally, the Calibrator should be placed in operate with the OPER command.
A controller program first needs to initialize the interface and the Calibrator. Refer to
following sample program:
10 INIT PORT 0 \ REMOTE @6 ! PUT THE 5522A INTO THE REMOTE STATE
20 PRINT @6, “*RST;OUT 10V;OPER” ! RESET THE 5522A, PROGRAM IT TO
If you wish to use SRQs, first use the
*SRE
,
*ESE
, and
ISCE
commands to enable the
desired event. Refer to “Checking 5522A Status.”
You retrieve instrument parameters with a query (a programming command that ends
with a question mark):
200 PRINT @6, “FUNC?”
! RETRIEVE OUTPUT FUNCTION
210 INPUT LINE @6, A$
220 PRINT “Function is: “; A$
230 PRINT @6, “ONTIME?” ! RETRIEVE ON TIME
240 INPUT LINE @6, A$
250 PRINT “The instrument has been on for “; A$;” minutes”
This program generates the following sample output:
Function is: DCV
The instrument has been on for 134 minutes
Check for programming errors as in the following sample programs. Check the Error
Available (EAV) bit in the serial poll register using a serial poll.
300 A = SPL(6) ! CHECK FOR ERRORS
310 IF (A AND 8) THEN PRINT “There was an error”
320 PRINT @6, “*CLS” ! CLEAR ERRORS
Retrieve errors and explanations as follows. Since errors are accumulated in a queue, you
must read the entire queue to retrieve and clear all the errors.
400 PRINT @6, “ERR?” ! CHECK FOR ERRORS
410 INPUT @6, A, A$ ! READ IN THE ERROR
420 IF (A = 0) THEN GOTO 500 ! NO MORE ERRORS
430 PRINT “Error# :”;A, A$ ! PRINT ERROR# AND EXPLANATION
440 GOTO 400
500 END
Writing an SRQ and Error Handler
It is good practice to include fault (error) handling routines in your applications. The
following sample program lines show a method for halting program execution on
occurrence of an SRQ (Service Request) on the bus, checking to see if the Calibrator is
the source of the SRQ, retrieving its fault messages, and acting on the faults. You should
modify and extend this code as necessary for your application.
If you want to use SRQs, first use the
*SRE
,
*ESE
, and
ISCE
commands to enable the
desired event. Refer to "Checking 5522A Status" for more information.
10 INIT PORT0 ! IFC the bus
20 CLEAR PORT0 ! DCL the bus
30 ! INITIALIZE THE 5522A SRQ HANDLER
40 PRINT @6,
“
*SRE 8
”
! Enable STB.EAV (error available)
50 ON SRQ GOTO 1100 ! Install SRQ handler
60 ! Body of the application goes here
Содержание 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 ...