Martel Electronics M2000 User Manual

Page 17

Advertising
background image

Bit Assignments for the ESR and ESE

The bits in the Event Status Register (ESR) and Event Status Enable register (ESE) are
assigned as shown in Figure 9.

15 14

13

12

11

10

9

8

0

0

0 0 0 0 0 0

7 6

5 4 3 2 1 0

PON 0

CME EXE DDE QYE 0 OPC

PON

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.

CME

Command error. The M2000's IEEE-488 interface encountered an incorrectly
formed command. (The command FAULT? fetches the latest error code in the error
queue, which contains error codes for the first 15 errors that have occurred.)

EXE

Execution error. An error occurred while the M2000 tried to execute the last com-
mand. This could be caused, for example, by a parameter being out of range. (The
command FAULT? fetches the latest error in the error queue, which contains error
codes for the first 15 errors that have occurred.)

DDE

Device-dependent error. An error related to a device-dependent command has
occurred.

QYE

Query error. The M2000 was addressed to talk when no response data was avail-
able or appropriate, or when the controller failed to retrieve data on the output
queue.

OPC

Operation complete. All commands previous to reception of a *OPC command
have been executed, and the interface is ready to accept another message.

Figure 9. 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 M2000
responds by sending a decimal number that when converted to binary represents bits 0
through 15.

Output Queue

The output queue is loaded whenever a query is processed, and holds up to 250 characters.
The controller reads it with a statement such as a BASIC INPUT statement, removing what it
reads from the queue. If the queue is empty, the M2000 does not respond to the INPUT state-
ment from the controller. The Message Available (MAV) bit in the Serial Poll Status Byte is 1 if
there is something in the output queue and 0 if the output queue is empty.

Error Queue

When a command error, execution error, or device-dependent error occurs, its error code is
placed in the error queue where it can be read by the FAULT? command. (See Chapter 5 for
a list of error messages.) Reading the first error with the FAULT? command removes that error
from the queue. A response of 0 means the error queue is empty. The error queue is cleared
when you turn off the power, and when you use the *CLS (Clear Status) common command.
The error queue contains up to 15 entries. If more than 15 errors occur, only the first 15 errors
are kept in the queue. A 16th entry in the queue is always an "error queue overflow" error, and
all later errors are discarded until the queue is at least partially read. The first errors are kept,

17

Advertising