STB and SRE

The status byte (STB) provides a rough overview of the instrument status by collecting the pieces of information of the lower registers. The STB represents the highest level within the SCPI hierarchy. The status byte can be read with a dedicated VISA function viReadSTB().

The status byte (STB) is linked to the service request enable (SRE) register on a bit-by-bit basis.

  • The STB corresponds to the EVENt part of a SCPI register, it indicates general instrument events. This register is cleared when it is read.

    A special feature is that bit 6 acts as the summary bit of the remaining bits of the status byte.

  • The SRE corresponds to the ENABle part of a SCPI register. If a bit is set in the SRE and the associated bit in the STB changes from 0 to 1, a service request (SRQ) is generated. Also VISA can call Service Request Handler using a function viInstallHandler().

    Bit 6 of the SRE is ignored, because it corresponds to the summary bit of the STB.

Bits in STB register

Bit

Weight

Meaning

2

4

Error queue summary

This bit is set when an entry is made in the error or event queue.

3

8

Questionable register summary

The questionable status summary bit indicates a questionable instrument status, which can be further pinned down by polling the QUEStionable register.

4

16

MAV bit

The message available bit is set if a message is available and can be read from the output buffer. The output buffer can be read with a VISA function viRead().

This bit can be used to transfer data automatically from the instrument to the controller.

5

32

ESB bit

This summary bit of standard event status register; set if one of the bits in the standard event status (ESR) register is set and enabled in the standard event enable (ESE) register.

Setting of this bit implies an error or an event which can be further pinned down by polling the event status register.

6

64

MSS bit

The master summary status bit is set if one of the other bits of the STB is set together with its mask bit in the SRE register.

7

128

Operation status summary

This bit is set if an EVENt bit is set in the OPERation status register and the associated ENABle bit is set to 1. A set bit indicates that the instrument is just performing an action. The type of action can be determined by querying the STATus:OPERation status register.

Related common commands

The STB is read out using the *STB? command or a serial poll.

The SRE can be set using the *SRE command and read using the *SRE? command.