Remote Operations
Checking 5522A Status 5
5-39
Power on. This bit is set to 1 if line power has been turned off and on since the last
time the ESR was read.
Command error. The 5522A’s IEEE-488 interface encountered an incorrectly formed
command. (The command ERR? fetches the earliest error code in the error queue,
which contains error codes for the first 15 errors that have occurred.)
Execution error. An error occurred while the 5522A tried to execute the last command.
This could be caused, for example, by a parameter being out of range. (The command
ERR? fetches the earliest error in the error queue, which contains error codes for the
first 15 errors that have occurred.)
Device-dependent error. An error related to a device-dependent command has
occurred.
Query error. The 5522A was addressed to talk when no response data was available
or appropriate, or when the controller failed to retrieve data on the output queue.
Operation complete. All commands previo
us to reception of a *OPC c ommand have
been executed, and the interface is ready to accept another message.
PON
CME
EXE
DDE
QYE
OPC
15 14 13 12 11 10 9 8
00000000
76543210
PON 0 CME EXE DDE QYE 0 OPC
gjh048.eps
Figure 5-10. Event Status Register (ESR) and Event Status Enable (ESE)
Programming the ESR and ESE
To read the contents of the ESR, send the remote command, *ESR?. The ESR is cleared
(set to 0) every time it is read. To read the contents of the ESE, send the remote
command, *ESE?. The ESE is not cleared when it is read. When you read either register,
the Calibrator responds by sending a decimal number that when converted to binary
represents bits 0 through 15. The following sample BASIC program retrieves the contents
of both registers:
10 ! THIS PROGRAM READS THE ESR AND THE ESE REGISTERS
20 PRINT @6, “*ESR?” ! ASK FOR THE ESR CONTENTS
30 INPUT @6, A% ! RETRIEVE THE REGISTER CONTENTS
40 PRINT @6, “*ESE?” ! ASK FOR THE ESE CONTENTS
50 INPUT @6, B% ! RETRIEVE THE REGISTER CONTENTS
60 PRINT “ESR = “;A% ! DISPLAY THE ESR REGISTER CONTENTS VALUE
70 PRINT “ESE = “;B% ! DISPLAY THE ESE REGISTER CONTENTS VALUE
80 END
Convert the contents of variables A and B into binary, and you can read the status of the
registers. For example if A is 32, its binary equivalent is: 00000000 00100000. Therefore,
bit 5 (CME) in the ESR is set (1) and the rest of the bits are reset (0). This means that the
Calibrator tried to execute an incorrectly formed command.