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

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

Advertisement

5520A
Operators Manual
You retrieve instrument parameters with a query (a programming command that ends
with a question mark):
This program generates the following sample output:
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.
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.

5-60. 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 5520A Status" for more information.
10
20
30
40
50
60
1100
1110
1120
1130
1140
1200
1210
1220
1299
1300
1320
1330
1340
1350
1360
1370
5-46
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"
Function is: DCV
The instrument has been on for 134 minutes
300 A = SPL(6)
310 IF (A AND 8) THEN PRINT "There was an error"
320 PRINT @6, "*CLS"
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
INIT PORT0
CLEAR PORT0
! INITIALIZE THE 5520A SRQ HANDLER
PRINT @6, "*SRE 8"
ON SRQ GOTO 1100
! Body of the application goes here
! Bus SRQ handler
CLEAR PORT0
IF (SPL(6) AND 64) THEN GOSUB 1200
! TEST OTHER DEVICES RQS BITS IF DESIRED
RESUME
! 5520A SRQ handler
IF (SPL(6) AND 8) THEN GOSUB 1300
! Test other STB bits if desired here
RETURN
! 5520A STB.EAV (error) handler
PRINT @6, "ERR?"
INPUT @6, E%, E$
PRINT "Error# :";E, E$
IF (E% <> 0) THEN GOTO 1320 ! Until no more errors
STOP
END
! 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
! Make sure devices are not confused
! If (STB.RQS) call SRQ
! If (STB.EAV) call handler
! Read and clear error
! Read in error # and explanation
! Print error # and explanation
! Other commands for your app

Advertisement

Table of Contents
loading

Table of Contents