ReadStatusByte Method

NI-VisaNS .NET Class Library Help for Visual Studio 2010

Edition Date: August 2012

Part Number: 370627F-01

»View Product Info
Download Help (Windows Only)

VxiSession Class See Also

Reads the status byte of a service request.

Namespace: NationalInstruments.VisaNS

Assembly: NationalInstruments.VisaNS (in NationalInstruments.VisaNS.dll) Version:


Visual Basic (Declaration)
Public Function ReadStatusByte As StatusByteFlags

public StatusByteFlags ReadStatusByte()

Return Value

The service request status byte. This value is a bitfield composed of several flags. The bitfield includes, but is not limited to, the values in StatusByteFlags.




VisaException The NI-VISA driver returned an error as a result of calling this method.
DllNotFoundException The NI-VISA driver library cannot be found.
EntryPointNotFoundException A required operation in the NI-VISA driver library cannot be found.
InvalidOperationException Unable to start operation because setup is invalid (due to properties being set to an inconsistent state).
ObjectDisposedException This member is called after the Dispose method is called directly from code or indirectly through a finalizer.


The ReadStatusByte method reads the ServiceRequest status from a service requester (the message-based device).

For example, on the IEEE 488.2 interface, polling devices read the message. For other types of interfaces, a message is sent in response to a ServiceRequest to retrieve status information.

For a session to a Serial device or Ethernet socket, if IOProtocol is set to Protocol4882, the string, "*STB?\n", is sent to the device, and the device status byte is read; otherwise, this method is not valid. If the status information is only one byte long, the most significant byte is returned with the zero value. If the service requester does not respond in the actual timeout period, a VisaException is thrown with an error code of ErrorTimeout. For a session to a USB instrument, this function sends the READ_STATUS_BYTE command on the control pipe.

See Also


VxiSession Class

NationalInstruments.VisaNS Namespace


Not Helpful