How Do I Connect to Ethernet Instruments with NI-VISA?

Updated Dec 17, 2018

Reported In


  • Ethernet Cable



Issue Details

How do I communicate to Ethernet instruments with NI-VISA?


NI-VISA 2.5 and higher (for Windows32 platforms), and NI-VISA 2.6 and higher (for other platforms), allows you to connect to Ethernet instruments via TCP/IP. This is done by specifying a TCP/IP Instrument (INSTR) Resource or TCP/IP Socket (SOCKET) Resource. The syntax for each is as follows: 
  • TCPIP[board]::host address[::hostname][::INSTR]

    To use the INSTR resource type, the device must support the TCP/IP Instrument Protocol, also known as VXI-11. This protocol is, at present, used mostly by Agilent instruments.
  • TCPIP[board]::host address[::host name]::port::SOCKET 

    The SOCKET Resource exposes the capability of a raw network socket connection over TCP/IP (usually, but not restricted to, an Ethernet interface). Without TCP/IP Instrument Protocol support, you must use the SOCKET resource type.

Refer to IVI Specifications for more information.

The words inside the brackets above are optional.

    Additional Information

    To elaborate, if there is only one interface type present on the host machine, then the board type is optional. For example, "TCPIP0::..." is the same as "TCPIP::...", because 0 after TCPIP would be optional. Additionally, host name is only required when there is more than one hostname (instrument) in the host address.

    In the example below, inst0 is optional because it is the only instrument in this address and shows different TCP/IP resource names. All four resource names below point to the same resource.