C# Remote control protcol 4 LXI

November 27, 2021

This website summarizes how to write communication programs necessary for measuring instrument control for those who have a general understanding of C # introduction.

In addition to this article, there are the following articles.

This article describes LXI (LAN eXtentions for Instrumentation), a LAN communication method.

About LXI

LXI is a communication standard for measuring instruments established in 2005 by Agilent Technologies (currently Keysight Technologies). GPIB has long been used for communication of measuring instruments, but GPIB connectors occupy a large area on the back panel, making it difficult to mount them on recently miniaturized measuring instruments.

GPIB’s other communication methods include serial and USB, but since they only support one-to-one communication, they were not a substitute for GPIB.

That’s where LXI came in. LXI uses LAN, so it can be distributed at the hub. Also, since the RJ-45 terminal is used, the occupied area is small. Another advantage is that there are no new costs due to the use of popular devices.

Keysight, at the heart of the alliance, has also released a document describing the 10 benefits of LXI.

10 Good Reasons to Switch to LXI

It was created in 2005 and has been stable for 15 years.

Think about networks before LXI programs

LXI is a communication protocol, but requires the use of TCP / IP. Before communicating between devices with LXI, you need to build a TCP / IP network. At least the following items must be set on the instrument.

  • Fixed IP or DHCP?
  • IP address
  • sub-net mask
  • default gateway

For example, connect a PC and a measuring instrument one-to-one. The procedure for a one-to-one connection is the same as creating a small network. If the network address is, the PC is, and the instrument is, make the following settings.

画像に alt 属性が指定されていません。ファイル名: 計測器ネット.jpg

In case of one-to-one connection, communication is possible in principle if the IP address, netmask and gateway are set. Others are blank. However, some devices may not work unless DNS is set in the device specifications.

If you add one measuring instrument and control two measuring instruments with one PC, it will be as follows. The biggest difference is using a hub. In the case of one-to-one, a cross cable was necessary, but in the case of a hub, all straight cables are used.

画像に alt 属性が指定されていません。ファイル名: クリップボード02-1.jpg

In this example, IP addresses between and were used, but this value can be anything. is often used for such a subnet.

LXI communication program in C #

Actually, the communication program of LXI is almost the same as the way of writing GPIB. Recently, the way of writing C # for GPIB has changed, so the way of writing C # for LXI has changed as well. Please refer to the link below for GPIB changes.

In LXI, the address notation at the time of session open is different from that of GPIB. Specifically: The session Open for GPIB communication is described as follows.

When this is LXI:

The only difference is the .Open (). Changing the program from GPIB to LXI is easier than expected. Sample code for controlling a digital multimeter with LXI is introduced for reference.

LXI sample code

In the sample, we will make a program that performs measurement only once using Keysight’s 34461A (digital multimeter). First, set the PC address to

画像に alt 属性が指定されていません。ファイル名: winnet.png

Next, set the IP address to in the IO setting of the 34461A.

画像に alt 属性が指定されていません。ファイル名: クリップボード01.jpg

The PC and 34461A are connected with a cross LAN cable or a network hub with a straight cable.

Next, the program creates a C # form application in Visual Studio, creates a button (named “buttonStart”) on the form, and writes the code as follows.

Add the following libraries to Visual Studio Add References: This procedure is the same as GPIB.

  • C:Program Files (x86)IVI FoundationVISAMicrosoft.NETFramework32v2.0.50727VISA.NET Shared Components 5.11.0Ivi.Visa.dll
  • C:Program Files (x86)IVI FoundationVISAMicrosoft.NETFramework32v4.0.30319NI VISA.NET 19.0NationalInstruments.Visa.dll

Execute the program and press the button. The measured value of the 34461A is displayed on the button.

This sample uses National Instruments (hereafter NI) driver. This is because I always use NI USB-GPIB-HS, a USB GPIB adapter. However, in the case of LXI, this adapter is not used, so you may not need the NI driver.


This article introduced LXI, a method of instrument communication. The features of LXI are as follows.

  • Because the LAN cable is used, it does not occupy the back panel of the measuring instrument.
  • Easy cable management.
  • One-to-many communication is possible as with GPIB Uses LAN devices so you don’t have to buy expensive equipment.
  • You need to set up the network for the measuring instrument before the program.
  • LXI C # programs are not much different from GPIB programs.

LXI is now included in most instruments, but may replace GPIB. I will try to use it a little more and check the good points and bad points.


Posted by naozane