Receiving VISA Error -1073807302 When Reading Status Byte

Updated May 13, 2024

Reported In

Driver

  • NI-VISA

Issue Details

I am currently communicating with an Ethernet serial instrument. When I request the instrument’s status byte, the VISA Read STB function throws Error -1073807302:

VISA: (Hex 0xBFFF003A) Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state).



How can I resolve this error?

Solution

First, confirm whether your Ethernet instrument can recognize 488.2 commands. Refer to the instrument’s user manual to check if it supports these commands.

If your instrument does support 488.2 commands, you’ll need to modify the VI_ATTR_IO_PROT attribute. Specifically, change it to VI_PROT_4882_STRS to enable recognition of the status byte command. You can achieve this programmatically in LabVIEW by configuring a VISA property node as explained below or using the following snippet:

 
VISA TCP IP Socket IO Prot Snippet.png
 
  1. Add a VISA property node to your block diagram.
  2. Right-click on the property node and navigate to Select Class >> VISA >> I/O Session >> TCP/IP Socket. This will give you access to attributes specific to the TCP/IP Socket.
  3. Click on the default property and go to Message Based Settings >> I/O Protocol.
  4. Change the property to “write” and configure it for “Serial-TCPIP-USB/488 Strings.”
 

Ethernet serial instruments fall under the VISA Ethernet Socket (SOCKET) resource class. Note that the SOCKET resource class does not support the LAN instrument protocol. As a result, only read and write operations are valid. If your device recognizes 488.2 commands (such as *STB?\n to request the status byte), you must adjust the VI_ATTR_IO_PROT attribute to allow for 488.2-defined strings. By default, this attribute is set to VI_PROT_NORMAL. For more detailed information about VISA functions, consult the NI-VISA User Manual.