Ethernet Instrument Control Tutorial

Publish Date: Feb 27, 2019 | 32 Ratings | 2.62 out of 5 | Print | 5 Customer Reviews | Submit your review


This tutorial is meant to serve as a starting point for using NI-VISA to communicate with an Ethernet device. It will provide a brief overview of both NI-VISA and the Ethernet bus followed by a tutorial on setting up an Instrument Control System based on the Ethernet bus architecture. After reading this tutorial, you should be able to install an Ethernet device and use NI-VISA to communicate with that device, as long as you understand the device communication protocol.

Table of Contents

  1. Overview of Ethernet and NI-VISA
  2. Configuring NI-VISA to Control Your Ethernet Instrument
  3. Related Links

1. Overview of Ethernet and NI-VISA

Ethernet is a mature technology widely used for measurement systems in many capacities including general networking and remote data storage. Ethernet offers an attractive option for instrument control because of its flexibility. With connectivity via Ethernet, you can control your instrument from anywhere on the network to which it is connected. Ethernet, defined by IEEE Standard 802.3, offers network configurations that provide theoretical data transfer rates of 10 Mb/s (10BaseT), 100 Mb/s (100BaseTX), and 1 Gb/s (1000BaseT). One main reason Ethernet has become so popular in instrument control is the fact that most companies and laboratories have existing Ethernet networks available for instrument control. LXI is a new standard built on the Ethernet protocol. It was developed to implement synchronization of distributed instruments.

NI-VISA is a high-level application programming interface (API) used to communicate with instrumentation buses. It is platform independent, bus independent, and environment independent. In other words, the same API is used regardless of whether a program is created to communicate with an Ethernet device with LabVIEW on a machine running Windows 2000 or with a GPIB device with C on a machine running Mac OS X. Starting with version 2.5, NI-VISA offers support for Ethernet communication. For specific information about the NI-VISA API, refer to the NI-VISA Help.

Back to Top

2. Configuring NI-VISA to Control Your Ethernet Instrument

This section walks through the steps for configuring your Ethernet-based instrument with NI-VISA on a Windows-based computer. At this point, NI-VISA should already be installed on your computer.

  1. Testing the Connection to Your Ethernet Device
    Your instrument should be connected to your network. You should also be able to “ping” your device. Do this by following these steps.

    Open a command prompt by navigating to Start»Run, and then typing cmd in the Open field. Select OK.

In the Command Prompt window type ping, where is the IP Address of your instrument and yyyy is the port. (You may not need to include a port number.) Then press Enter.

If you get a response like that shown above (with replies coming back), then you are able to communicate to that Ethernet device from your PC, and you are ready to start configuring the device in Measurement & Automation Explorer (MAX).


   b.  Configuring Your Ethernet Device in MAX

Open NI MAX and expand the My System tree. There are two methods for adding your instrument as a VISA resource. One is to select Devices and Interfaces and then click the Create New button that appears at the top of MAX. The other option is to right-click on Devices and Interfaces and select Create New from the context menu that appears.

In the Create New window that appears, select VISA TCP/IP Resource and click Next.

Next you will choose the type of TCP/IP resource you would like to add. If your instrument conforms to the VXI-11 LAN or LXI instrument specifications, you can select to either auto-detect it or add the IP address for your instrument manually. Otherwise, you will need to add your Ethernet device as a Raw Socket. With this option, you will have to enter an IP address and port number for your instrument.


If your instrument does not comply to the VXI-11 LAN or LXI instrument specifications you will need to select the third option, Manual Entry of Raw Socket. After selecting this option you will need to enter the IP address and Port Number for you device. The Port Number used by your device should be indicated in its Ethernet Interface Specification. This can usually be found in the device user manual. 


Once you complete the wizard, you will have a new VISA TCP/IP Resource added in MAX. You can then select Open VISA Test Panel to test the communication with your device. From the Input/Output pane of the test panel, you can query your instrument with any command your instrument will recognize. 

You can also use the newly created VISA TCP/IP Resource Name in LabVIEW to communicate with your Ethernet device. 

Back to Top

3. Related Links

Back to Top

Customer Reviews
5 Reviews | Submit your review

VISA/ethernet control in OSX?  - Nov 2, 2010

Is it possible to control an ethernet device with NI-VISA in Apple OSX? I see LOADS of Windows examples; no OSX examples.

VISA libraries required for comms with a serial device via RS232-ENET box?  - Feb 11, 2009

Should software that controlled the device with a direct serial connection have to be modified to use VISA in order for the software control to work?

UDP format question  - Apr 21, 2008

Can I use UDP for ethernet communication or must I add TCP/IP protocols to the UDP protocol? Can you specify the UDP protocol required by the cRIO to communicate via ethernet to a "network" consisting of a cRIO and a single additional computer? Thanks.

  - Oct 17, 2007

If your instrument is assigned an address via DHCP, you should be able to ping the instrument by name. The response will show the IP address of the device.

  - May 14, 2007

Please add information on how to discover an instrument that is assigned an IP address via DHCP.

View more reviews

Bookmark & Share


Rate this document

Answered Your Question?
Yes No