Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Host Lua scripting

Host Lua scripting

  • Please log in to reply
3 replies to this topic

#1 kmhill

kmhill
  • Members
  • 3 posts

Posted 12 May 2014 - 10:17 PM

I have a Labjack U3-LV that I hope to make more use of, this could be an excuse to experiment with Lua

 

A few years back, long before I knew or considered the T3, I was experimenting with Lua and first considered writing a Lua library for a host, to allow for scripting. At that time I was scripting with Python and I like the cross-platform capability that Labjack-Python has, so I looked into the possibility of having a such a cross-platform library for Lua and such a project seems to be very do-able.

 

Just the other day I was pleased to learn that Labjack has at least one acquisition module that is scriptable with Lua, by means of the embedded Lua interpreter eLua. I've been aware of eLua for some years now and I'm intrigued by it.

 

Okay, I have to ask, apart from the T3 which uses eLua, has there been any interest or development with Lua on a host system that is hosting a Labjack module. Say for example, the U3-LV? Regular Lua works well with C code. If you have any ideas or any experience with Lua as a host language under Linux, Windows, or Mac, I'd like to know.

 

Thanks



#2 kmhill

kmhill
  • Members
  • 3 posts

Posted 13 May 2014 - 03:05 PM

Apologies, my fingers slipped... Both references to a T3 were supposed to be to the T7, which is directly scriptable with eLua.



#3 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 13 May 2014 - 03:21 PM

Currently, as you mentioned, we only use Lua for running scripts on the LabJack T7. We haven't had requests for a computer (host) side Lua wrapper for our drivers/libraries that I'm aware of, and haven't done development on it.

 

Looking online, if you are looking into using Lua with our U3 library (liblabjackusb.so/dylib on Linux and Mac OS X, and LabJackUD.dll on Windows), or libraries in general, you can use the loadlib call, though I think you need to build a Lua C extension module wrapper to our library. SWIG can be useful in generating the Lua extension module code.

 

Alternatively, I believe LuaJIT FFI, Alien and C/Invoke (there may be more) will let you use our libraries directly. Here's some useful links relating to using C libraries and code in Lua:

 

http://www.lua.org/pil/8.2.html

http://lua-users.org...indingCodeToLua



#4 kmhill

kmhill
  • Members
  • 3 posts

Posted 14 May 2014 - 10:36 PM

Thanks for the references. I'll be digging and planning.





Also tagged with one or more of these keywords: Host Lua, scripting

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users