Products > Test Equipment
Open source lxi-tools and liblxi v1.0 released for GNU/Linux
ralphrmartin:
Excellent - is there some documentation?
but
snap refresh lxi-tools --edge
snap "lxi-tools" has no updates available
:-//
lundmar:
--- Quote from: ralphrmartin on March 12, 2018, 06:30:25 pm ---Excellent - is there some documentation?
but
snap refresh lxi-tools --edge
snap "lxi-tools" has no updates available
:-//
--- End quote ---
The snap system automatically updates your snaps when new updates are available. So your snap is likely up-to-date.
If you want to make sure you can see the list of latest lxi-tools snap versions here: https://dashboard.snapcraft.io/snaps/lxi-tools
And compare it with the information retrieved from the "snap info lxi-tools" command.
Documentation is work in progress. I will try to soon expand with more documentation in the man page.
To run the script named myscript.lua, simply do e.g.:
--- Code: ---$ lxi run myscript.lua
--- End code ---
In the script file you add regular Lua script code which can use any of the available Lua script libraries for math, file I/O, etc.. See more here: https://www.tutorialspoint.com/lua/index.htm
There is also a Lua quick guide here: https://www.tutorialspoint.com/lua/lua_quick_guide.htm
In addition, lxi-tools provides the following Lua functions for managing instruments:
--- Code: ----- Connect to instrument ip and return device handle
device = connect(ip)
-- Send SCPI command to device and return response if ? command
response = scpi(device, command)
-- Send SCPI command to device and return raw response if ? command
response = scpi_raw(device, command)
-- Sleep ms
msleep(milliseconds)
-- Sleep seconds
sleep(seconds)
-- Disconnect device
disconnect(device)
--- End code ---
Most of the interfaces are demonstrated in https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua
As you can see you simply connect to your instrument using the connect function which give you a device handle upon which the scpi function can operate. This allows to connect to multiple instruments in the same session.
In case of a question command, the scpi command returns a sanitized response string (removes newlines and carriage returns from the received response string).
Likewise, the scpi_raw command returns the original non sanitized response from the instrument, useful if receiving e.g. image or trace binary data.
Notice that the example script uses the Lua function tonumber() Lua to convert the received scientific notation number string (e.g. "+5.000E-2", notation returned by most instruments) to a float number.
Thats pretty much all there is to it. You simply connect to instruments, send scpi commands, and use Lua to do comparison, loops, data manipulation, wait delays, conditional delays, write stuff to disk, etc.. The possibilities are almost endless.
If you have any questions regarding how to do specific things in Lua feel free to ask here, I will try help best I can.
lundmar:
Take a look here, Siglent wrote a post about LXI Tools :-+
https://www.siglentamerica.com/application-note/lxi-tools
There is also a short video demonstrating how to use LXI Tools with Siglent instruments:
lundmar:
New releases available:
https://github.com/lxi-tools/lxi-tools/releases/tag/v1.19
https://github.com/lxi-tools/liblxi/releases/tag/v1.12
This release includes bug fixes and adds support for Lua scripting which is very useful for instrument automation.
It is ready to install via the snap stable channel:
--- Code: ---$ snap install lxi-tools
--- End code ---
Dwaine:
Nice work... Using it now...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version