13-6 Status Structure
Reading registers
Any register in the status structure can be read by using the appropriate query (?) command.
The following explains how to interpret the returned value (response message). The actual query
commands are covered later in this section (see Tables 13-3 through 13-6).
The response message will be a value that indicates which bits in the register are set. That
value (if not already binary) will have to be converted to its binary equivalent. For example, for
a binary value of 100101, bits B5, B3, and B0 are set.
The returned value can be in the binary, decimal, hexadecimal, or octal format. The
FORMat:SREGister command is used to select the data format for the returned value (see Table
13-2).
For non-decimal formats, one of the following headers will accompany the returned value to
indicate which format is selected:
#B = Header for binary values
#H = Header for hexadecimal values
#Q = Header for octal values
Table 13-2
SCPI command — data formats for reading status registers
Command Description Default
:FORMat FORMat subsystem
:SREGister <name> Select data format for reading status registers:
<name> = ASCii Decimal format
HEXadecimal Hexadecimal format
OCTal Octal format
BINary Binary format
ASCii
B7
B15
B6 B5
B4
B3
B2 B1
B0
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
0/1
128
(2 )
7
32768
(2 )
15
64
(2 )
6
16384
(2 )
14
32
(2 )
5
8192
(2 )
13
16
(2 )
4
4096
(2 )
12
8
(2 )
3
2048
(2 )
11
4
(2 )
2
1024
(2 )
10
2
(2 )
1
512
(2 )
9
1
(2 )
0
256
(2 )
8
Bit Position
Bit Position
Binary Value
Binary Value
Decimal Weights
Decimal Weights
A. Bits 0 through 7
B. Bits 8 through 15
B14 B13 B12 B11 B10 B9 B8
Figure 13-2
16-bit status
register