6
87
Working with Automatic Test Systems
Detecting Occurrence of an Error
6. W
o
rking
with Automatic
T
e
st S
ystems
The error queue can be used in the following ways:
1. It is used as a branch for error handling. When an error queue is retrieved, it returns 0 as
the error number and &dlq;No error&drq; as the error message if no error is detected.
This can be used for detecting an error and for branching the flow of a program. This is
also useful for handling a specific error(s). Note that using this method prevents the
user from performing any processing during the occurrence of an error.
2. When an error is detected using SRQ, the error queue is used to examine the error.
Example 6-1 is a sample program that demonstrates how to use an SRQ to detect the
occurrence of an error.
This program sets the SRQs and then intentionally sets a wrong trigger to generate an error,
which is handled by the program. In the error handling part, this program examines the
error and then displays the error number and error message.
Example 6-1
Example of error detection using an SRQ
110 DIM Buff$[9],Err_msg$[100]
120 INTEGER Err_no
130 !
140 ASSIGN @Agte5052 TO 717
150 !
160 OUTPUT @Agte5052;"*ESE 60"
170 OUTPUT @Agte5052;"*SRE 32"
180 OUTPUT @Agte5052;"*CLS"
190 OUTPUT @Agte5052;"*OPC?"
200 ENTER @Agte5052;Buff$
210 !
220 ON INTR 7 GOTO Err_proc
230 ENABLE INTR 7;2
240 OUTPUT @Agte5052;":TRIG:MODE PN1"
250 OUTPUT @Agte5052;":TRIG:SP:SOUR BUS"
260 OUTPUT @Agte5052;":INIT:SP:CONT ON"
280 OUTPUT @Agte5052;"*TRG"
290 PRINT "Waiting..."
300 GOTO Skip_err
310 Err_proc: OFF INTR 7
320 OUTPUT @Agte5052;":SYST:ERR?"
330 ENTER @Agte5052;Err_no,Err_msg$
340 PRINT "Error occured."
350 PRINT "No:";Err_no,"Description: "&Err_msg$
360 PRINT "Program Interrupt."
370 GOTO Prog_end
380 Skip_err: PRINT "Program Done"
390 Prog_end: END
Summary of Contents for E5052A
Page 4: ...4 ...
Page 28: ...28 1 Making Effective Use of This Manual How to Use This Manual ...
Page 51: ...3 51 Making a Measurement Trigger System 3 Making a Measurement Figure 3 1 Trigger system ...
Page 58: ...58 3 Making a Measurement Waiting for End of measurement ...
Page 76: ...76 4 Reading Writing Measurement Data Entering Data in a Trace ...
Page 82: ...82 Chapter5 Saving and Recalling File Management Managing Files ...