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:
- Add a VISA property node to your block diagram.
- 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.
- Click on the default property and go to Message Based Settings >> I/O Protocol.
- 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.