Sample Program For Error Handling - Agilent Technologies 4294A Programming Manual

Precision impedance analyzer
Hide thumbs Also See for 4294A:
Table of Contents

Advertisement

Handling Errors

Sample program for error handling

Sample program for error handling
Example 10-1 is a sample program for detecting an error via SRQ. This program is saved
in the file "error.bas" on the sample program disk.
This program performs necessary settings for SRQ, intentionally sends a command that the
4294A does not support to cause an error, then handles the error occurred. In the error
handling, the error is identified, its error number and message are displayed followed by a
message showing that the program is aborted.
Lines 30 to 90
Identifies the external controller and Instrument BASIC and sets the
GPIB address and the select code.
Lines 110 to 120
Sets bit 2, 3, 4 and 5 of the standard event status register to be enabled
and sets bit 5 of the service request enable register to 1.
Lines 130 to 150
Clears the status byte register, standard event status register, and error
queue.
Lines 170 to 180
Defines the destination for branching by SRQ interruption and enables
the SRQ interruption.
Lines 190 to 260
Sets a measurement parameter, a sweep start value, and a sweep stop
value. An error occurs here because an unsupported command is used
to set the start value.
Lines 290 to 300
Performs error handling. The number and message accompanied with
the error is read out.
Lines 310 to 330
Displays a message showing an error has occurred, the error number,
error message, and an another message telling that the program is
aborted.
Line 350
Displays a message for normal termination of the program. Note that
this will not be displayed unless the program is modified to employ an
appropriate command for setting the start value.
134
Chapter 10

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents