Writing An Srq And Error Handler - Fluke 5522A Operator's Manual

Multi-product calibrator
Hide thumbs Also See for 5522A:
Table of Contents

Advertisement

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
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?"
210 INPUT LINE @6, A$
220 PRINT "Function is: "; A$
230 PRINT @6, "ONTIME?"
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)
310 IF (A AND 8) THEN PRINT "There was an error"
320 PRINT @6, "*CLS"
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?"
410 INPUT @6, A, A$
420 IF (A = 0) THEN GOTO 500
430 PRINT "Error# :";A, A$
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
20
CLEAR PORT0
30
! INITIALIZE THE 5522A SRQ HANDLER
PRINT @6, "*SRE 8"
40
50
ON SRQ GOTO 1100
60
! Body of the application goes here
! PUT THE 5522A INTO THE REMOTE STATE
! RETRIEVE OUTPUT FUNCTION
! RETRIEVE ON TIME
! CHECK FOR ERRORS
! CLEAR ERRORS
! CHECK FOR ERRORS
! READ IN THE ERROR
! NO MORE ERRORS
! PRINT ERROR# AND EXPLANATION
! IFC the bus
! DCL the bus
! Enable STB.EAV (error available)
! Install SRQ handler
Remote Operations
Remote Program Examples
5
5-43

Advertisement

Table of Contents
loading

Table of Contents