Chapter 5
S Mode Functions
© National Instruments Corp.
5-47
GPIB-232CT User Manual
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:
You should use
stat
frequently in the early stages of your
program development when your device's responses are likely
to be unpredictable. The GPIB-232CT responds with status
information 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
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.
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 that the corresponding condition is
in effect; a bit value of zero indicates that 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