G Mode Functions
Chapter 8
GPIB-232CT User Manual
8-14
© National Instruments Corp.
stat - Return GPIB-232CT Status
Type:
General Use function
Syntax:
st
at [[c] n]
<CR>
or
st
at [c] s
<CR>
or
st
at [c] n s
<CR>
Purpose:
You
use
stat
to obtain the status of the GPIB-232CT to see
if certain conditions are currently present. You use
stat
most often to see if the previous operation resulted in an error.
Remarks:
The GPIB-232CT returns status information to you in a form
depending on the mode or combination of modes you chose.
n
indicates that the status information will be returned as
numeric strings.
s
indicates that the status information will be
returned in symbolic format, that is, as mnemonic strings.
c
specifies that the status will be returned after each
programming message, eliminating the need to call
stat
after each programming message.
Normally, you use
s
or symbolic format only when you are
debugging your code and you want to print the mnemonic for
each piece of status information.
The status information returned by the GPIB-232CT contains
four pieces of information: the GPIB-232CT status, a GPIB-
error code, a serial-error code, and a count. The GPIB-232CT
returns a <CR><LF> following each piece of the response. It
asserts EOI with the final <LF> that comes after
count
.
Status represents a combination of GPIB-232CT conditions.
Internally in the GPIB-232CT, status is stored as a 16-bit
integer. Each bit in the integer represents a single condition.
A bit value of 1 indicates the corresponding condition is in
effect; a bit value of 0 indicates the condition is not in effect.
Since more than one GPIB-232CT condition can exist at one
time, more than one bit can be set in status. The highest order
bit of status, also called the sign bit, is set when the
GPIB-232CT detects either a GPIB error or a serial port error.