This repo hosts C++ and Python scripts for communication with lab instrumentation and data acquisitation systems using LXI over Ethernet. Tested on Ubuntu 18.04. You can use them as a template and add further communication commands.
LAN eXtensions for Instrumentation (LXI) defines a standard for a communication protocol used by several lab instrumentation and data acquisition manufacturers. The communication is established over Ethernet by using several communication protocols, which follow the LXI standard. For TCP/IP these are the VXI-11 and HiSLIP protocol or raw TCP/IP over the socket. These protocols provide mechanisms to send ASCII commands to the device (SCPI). I.e., they provide an interface to the device, while the particular commands which need to be send to the device are still defined by the manufacturer (usually the same for all interfaces like USB, ethernet, RS232 etc.) and need to be looked up in the corresponding documentation. Therefore, in this repo, templates are created for each device. By using the corresponding commands, these can easily be adapted to other LXI devices.
Different LXI libraries exist. This repo uses lxi-tools for C++, Python VXI-11 and Python's TCP/IP socket. It should be mentioned that in the future VXI-11 will be replaced by the newer HiSLIP. But this will be implemented in the underlying libraries. Another library worth mentioning is the VISA API, which offers much more functionality and is supported by several vendors.
lxi discover -m
lxi scpi --address 192.168.1.131 -p 9221 -r "*IDN?"
lxi scpi --address 192.168.1.131 -p 9221 -r "V1 20"
-
Aim TTi CPX400SP (Sidenote: USB firmware error in descriptors (libusb/libusb#767))
- Commands: http://"IP"/cmd_set.htm
- Instructions: http://resources.aimtti.com/manuals/CPX400S+SA+SP_Instruction_Manual-Iss9.pdf
- limited VXI-11 interface only for device discovery
- Raw TCP/IP communication to send commands
- C++ script currently not working, use Python
TCP Sockets: The instrument uses 2 sockets on TCP port 9221 for instrument control and monitoring. Text commands are sent to this port as defined in ‘Remote Commands’ and any replies are returned via the same port. Any string must be one or more complete commands. Commands may be separated with either semicolons “;” or line feeds. No terminator is required since the TCP frame contains complete commands though commands may be sent with a terminator if desired (it will be ignored). Each command over TCP behaves as if it is terminated with a command terminator (ASCII character 0AH, line feed).
sudo apt-get install liblxi-dev
pip install python-vxi11
python3 cpx400sp_example.py
gcc -o test testcpx400sp.cc -llxi
./test
mkdir build
cd build
cmake ../
cmake --build .
http://literature.cdn.keysight.com/litweb/pdf/5989-6717EN.pdf