TimVargo Posted August 3, 2012 Report Share Posted August 3, 2012 Using LuaVIEW v1.2, I require the use of an external function library (BitOp <http://bitop.luajit.org/api.html>). I have already compiled it from C into a DLL, and my intent is to call a couple of its bit-wise functions from a Lua script, which is invoked from LuaVIEW, which is of course invoked from LabVIEW. The function call is working just fine on my development machine, which has a full LabVIEW development environment (v8.5.1), the full LuaVIEW package (v1.2), and a complete installation of the Lua interpreter (v5.0). The problem is that in the deployed environment (Win XP), the very same DLL is not found by the function call. I have poured over the Lua documentation concerning the package.path, package.cpath, package.loaders, package.loadlib, etc.; and nothing I have tried has resulted in the function call being able to find this library and run. Are there elements missing from the deployed environment that prevents what I am trying to do? Has anyone else tried to use a third-party DLL function library in a deployed LuaVIEW environment, and succeeded? Any pointers would be very appreciated. TimV Quote Link to comment
Rolf Kalbermatter Posted August 3, 2012 Report Share Posted August 3, 2012 Using LuaVIEW v1.2, I require the use of an external function library (BitOp <http://bitop.luajit.org/api.html>). I have already compiled it from C into a DLL, and my intent is to call a couple of its bit-wise functions from a Lua script, which is invoked from LuaVIEW, which is of course invoked from LabVIEW. The function call is working just fine on my development machine, which has a full LabVIEW development environment (v8.5.1), the full LuaVIEW package (v1.2), and a complete installation of the Lua interpreter (v5.0). The problem is that in the deployed environment (Win XP), the very same DLL is not found by the function call. I have poured over the Lua documentation concerning the package.path, package.cpath, package.loaders, package.loadlib, etc.; and nothing I have tried has resulted in the function call being able to find this library and run. Are there elements missing from the deployed environment that prevents what I am trying to do? Has anyone else tried to use a third-party DLL function library in a deployed LuaVIEW environment, and succeeded? Any pointers would be very appreciated. TimV Where did you try to put the DLL in the executable and what cpath did you use? It's been a while that I dealt with this issue for an application so I'm not sure about the details at this moment. I do remember something about that it didn't work properly without the compat-5.1 fix that was floating around at that time. And being busy to go through all the tests for the new beta package makes this also a bit harder. But I will look into it as soon as the beta is released. Could you maybe provide a small example project that shows the problem? That would certainly accelerate the issue a lot. Quote Link to comment
TimVargo Posted August 3, 2012 Author Report Share Posted August 3, 2012 >> ... it didn't work properly without the compat-5.1 fix ... Ah HA! Those few words are probably the answer. I have never applied this fix. I will try this next week and let you know the outcome. THANKS! TimV Quote Link to comment
TimVargo Posted August 14, 2012 Author Report Share Posted August 14, 2012 I spent several hours last Friday on this, and was unable to get either of loadlib or require to find the DLL in the runtime (deployed) environment. However, while re-reading the LuaVIEW manual, I (re)discovered the statically linked "lv" library, which includes bitwise functions! This solved my original problem. Although it still bugs me that I should have been able to get a dynamically linked library to work, I will hopefully not need to do so again until I am up and running with LuaVIEW v2.0, which will probably make it much easier (due to the Lua 5.1 module system). Thanks for the help though. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.