Products > Test Equipment
Open source lxi-tools and liblxi v1.0 released for GNU/Linux
lundmar:
--- Quote from: Dwaine on March 15, 2018, 01:08:17 am ---Nice work... Using it now...
--- End quote ---
Thanks :-+
For those who might start to play with the new lxi Lua scripting feature here are a few example scripts:
https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua
https://github.com/lxi-tools/lxi-tools/blob/master/test/basic-tests.lua
And of course, to run a script simply do e.g.:
--- Code: ---$ lxi run basic-tests.lua
--- End code ---
lundmar:
I've found some interesting lxi-tools snap statistics:
More statistics are available here: https://dashboard.snapcraft.io/snaps/lxi-tools/stats
Of course, the statistics only include snap users and not those who use it via other package managers or manual install.
I think it is a solid start for this type of project, especially considering it is currently only available for *nix platforms.
N0NB:
Arghh!
I'm getting tripped up by Lua in updating my SlackBuild script for lxi-tools 1.19. The configure script halts as Lua5.2 is not found and the SlackBuilds.org site has version 5.1.5 available. I presume this version is too old for various and sundry reasons?
I've never used Lua knowingly, but I found when writing a SlackBuild script for Hamlib (someone else contributed Swig Lua bindings). The impression I got is that Lua seems to be rather incompatible between minor versions. I hope I am wrong about that.
I suppose I can try installing Lua 5.1.5 and see if lxi-tools will build and run against it.
N0NB:
Well, I did get lxt-tools to compile with Lua 5.1.5. No telling if it works or not! :-//
I had to patch configure.ac as follows:
--- Code: ---$ diff -u /tmp/SBo/lxi-tools-1.19/configure.ac ./configure.ac
--- /tmp/SBo/lxi-tools-1.19/configure.ac 2018-03-10 18:54:41.000000000 -0600
+++ ./configure.ac 2018-03-18 07:21:43.825850367 -0500
@@ -14,8 +14,8 @@
AC_CHECK_LIB([readline], [readline], [], [AC_MSG_ERROR(libreadline not found)])
AC_CHECK_LIB([lxi], [lxi_connect], [], [AC_MSG_ERROR(liblxi not found)])
-# Check for Lua 5.2
-PKG_CHECK_MODULES([lua], [lua5.2])
+# Check for Lua 5.1 or newer
+PKG_CHECK_MODULES([lua], [lua >= 5.1])
# Handle bash completion
AC_ARG_WITH([bash-completion-dir],
--- End code ---
and run autoreconf --force -v --install to rebuild configure.
It built fine but with the following warnings:
--- Code: --- CC libapp_a-lxilua.o
lxilua.c: In function ‘connect’:
lxilua.c:51:26: warning: passing argument 1 of ‘lxi_connect’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
device = lxi_connect(address, 0, NULL, option.timeout, VXI11);
^
In file included from lxilua.c:36:0:
/usr/include/lxi.h:63:5: note: expected ‘char *’ but argument is of type ‘const char *’
int lxi_connect(char *address, int port, char *name, int timeout, lxi_protocol_t protocol);
^
lxilua.c: In function ‘scpi’:
lxilua.c:83:31: warning: passing argument 2 of ‘lxi_send’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
length = lxi_send(device, command, strlen(command), option.timeout);
^
In file included from lxilua.c:36:0:
/usr/include/lxi.h:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
int lxi_send(int device, char *message, int length, int timeout);
^
lxilua.c:92:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
if (question(command))
^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
extern int question(char *string);
^
lxilua.c: In function ‘scpi_raw’:
lxilua.c:132:31: warning: passing argument 2 of ‘lxi_send’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
length = lxi_send(device, command, strlen(command), option.timeout);
^
In file included from lxilua.c:36:0:
/usr/include/lxi.h:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
int lxi_send(int device, char *message, int length, int timeout);
^
lxilua.c:141:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
if (question(command))
^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
extern int question(char *string);
^
--- End code ---
I don't know if those warnings are simply due to the older version of Lua I'm compiling against or what. As the compiler didn't error out, I'm inclined to think that Lua support will probably work.
lundmar:
--- Quote from: N0NB on March 18, 2018, 12:29:11 pm ---Well, I did get lxt-tools to compile with Lua 5.1.5. No telling if it works or not! :-//
I had to patch configure.ac as follows:
--- Code: ---$ diff -u /tmp/SBo/lxi-tools-1.19/configure.ac ./configure.ac
--- /tmp/SBo/lxi-tools-1.19/configure.ac 2018-03-10 18:54:41.000000000 -0600
+++ ./configure.ac 2018-03-18 07:21:43.825850367 -0500
@@ -14,8 +14,8 @@
AC_CHECK_LIB([readline], [readline], [], [AC_MSG_ERROR(libreadline not found)])
AC_CHECK_LIB([lxi], [lxi_connect], [], [AC_MSG_ERROR(liblxi not found)])
-# Check for Lua 5.2
-PKG_CHECK_MODULES([lua], [lua5.2])
+# Check for Lua 5.1 or newer
+PKG_CHECK_MODULES([lua], [lua >= 5.1])
# Handle bash completion
AC_ARG_WITH([bash-completion-dir],
--- End code ---
--- End quote ---
Perfectly fine patch :-+
I simply had it fixed at Lua 5.2 but I assume it will work fine with all 5.x. If you feel like it I invite you to create a github pull request to push your change upstream. Or I can apply the patch on your behalf.
--- Quote from: N0NB on March 18, 2018, 12:29:11 pm ---and run autoreconf --force -v --install to rebuild configure.
--- End quote ---
FYI - for convenience, same as running ./autogen.sh
--- Quote from: N0NB on March 18, 2018, 12:29:11 pm ---It built fine but with the following warnings:
--- Code: --- CC libapp_a-lxilua.o
lxilua.c: In function ‘connect’:
lxilua.c:51:26: warning: passing argument 1 of ‘lxi_connect’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
device = lxi_connect(address, 0, NULL, option.timeout, VXI11);
^
In file included from lxilua.c:36:0:
/usr/include/lxi.h:63:5: note: expected ‘char *’ but argument is of type ‘const char *’
int lxi_connect(char *address, int port, char *name, int timeout, lxi_protocol_t protocol);
^
lxilua.c: In function ‘scpi’:
lxilua.c:83:31: warning: passing argument 2 of ‘lxi_send’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
length = lxi_send(device, command, strlen(command), option.timeout);
^
In file included from lxilua.c:36:0:
/usr/include/lxi.h:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
int lxi_send(int device, char *message, int length, int timeout);
^
lxilua.c:92:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
if (question(command))
^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
extern int question(char *string);
^
lxilua.c: In function ‘scpi_raw’:
lxilua.c:132:31: warning: passing argument 2 of ‘lxi_send’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
length = lxi_send(device, command, strlen(command), option.timeout);
^
In file included from lxilua.c:36:0:
/usr/include/lxi.h:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
int lxi_send(int device, char *message, int length, int timeout);
^
lxilua.c:141:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
if (question(command))
^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
extern int question(char *string);
^
--- End code ---
I don't know if those warnings are simply due to the older version of Lua I'm compiling against or what. As the compiler didn't error out, I'm inclined to think that Lua support will probably work.
--- End quote ---
Those are warnings that are yet to be fixed. You can ignore them for now. To test you could start by running the basic Lua test script:
--- Code: ---lxi run test/basic-tests.lua
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version