LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running .lua Script using LabVIEW

Hello Folks,

 

I have .lua Script files which can be executed using 3rd party software, Now i want to add this .lua script execution in my LabVIEW Application.

 

Found lua for LabVIEW in LabVIEW Tools Options. (Is there any way to call .lua script using LabVIEW?)

 

Planning to get dll for 3rd party software to invoke the execution property using labVIEW, Meanwhile if something can be done only using LabVIEW it will be great

 

Please share your experience!

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 1 of 5
(4,157 Views)

I'm not sure what you imagine about doing with Lua scripts only using LabVIEW. Are you proposing to write a Lua interpreter engine entirely in LabVIEW? That is not going to work very well. Aside from the development effort it is going to be pretty slow too.

What remains is to use real Lua as an external resource to execute the Lua scripts and interface it to LabVIEW. One of the possibilities is Lua for LabVIEW, which you seem to already have found.

Another one is to simply call lua.exe through the System Exec as a command line tool and somehow interface with it through for instance files written to specific locations or some TCP/IP inter-application communication.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(4,110 Views)

Lua is designed to be embedded in applications.

 

If you want to use it in LabVIEW without using Lua, guess you have to make your own Lua interpreter. Technically, you'd still be using Lua of course.

 

You can probably invoke a Lua script from the command line, without any toolkit. But invoking Lua like that will not allow any interaction with LabVIEW.

 

As Lua is designed to be embedded, it's well documented how to do this, for instance in C\C++. LabVIEW is a bit different (that's why we love it), so it won't be that easy.

 

We've (successfully) used Lua for LabVIEW toolkit. You'd save yourself a lot of trouble by using it.

0 Kudos
Message 3 of 5
(4,093 Views)

Our T-series DAQ devices can run Lua scripts in hardware and we also have customers who use Lua as their host software to talk to our devices, so we have a good bit of experience with Lua.  Tell us more about what your Lua code does and we might have some ideas.  What information do you want to exchange between LabVIEW and Lua?

 

For example, if it is a simple script, you could run it on a T4 or T7 and use user-ram registers to easily exchange (via USB/Ethernet/WiFi)values with a LabVIEW program running on a host PC.  Strange use of a T4/T7 but could make sense for some reason:

 

https://labjack.com/support/datasheets/t-series/lua-scripting

 

0 Kudos
Message 4 of 5
(3,769 Views)

How about this LabVIEW<->LUA wrapper...

https://github.com/antonie-coetzee/GLue

0 Kudos
Message 5 of 5
(802 Views)