T7, Vee, and Lau script | LabJack
 

T7, Vee, and Lau script

3 posts / 0 new
Last post
hw22
hanswennerstrom22's picture
T7, Vee, and Lau script

What I am trying to do is to controll a stepper motor, but the motor needs to go back to start with higher speed then I can get with a host computer and the T7, so I am using a Lau script. This is working fine, the proble is loading the Lau script using Vee software and the library. I have been trying everything I can think of on how to do this for about a week, still with no sucess.

I can load the Lau script with Kipling, and set it so the device starts the script automatically when the device is powered up. This is working jsut fine. I then use Vee and write directly to the 6000 address (LAU_RUN) to stop the script. I will then do a few other things with the T7 via the host computer. Then when I use the 6000 address to re-start the script, I get a an error code 2386, which is LUA_CODE_BUFFER_EMPTY Attempted to run a program that is not present.

Any idea on how to solve this problem, or how to load the script directly from the Vee software?

LabJack Support
labjack support's picture
When you write a 0 to LUA_RUN

When you write a 0 to LUA_RUN, the Lua script will be stopped and memory will start to be cleaned up. As part of this, your script is wiped from RAM. To load your Lua script back into RAM to be ran, you must write a nonzero value to the UINT32 register LUA_LOAD_SAVED. After doing that, you should be able to start your script again by writing a 1 to LUA_RUN.

This functionality should have been documented better, so I added an anchor on our Lua scripting page with relevant information:

https://labjack.com/support/datasheets/t-series/lua-scripting#flash-to-ram

hw22
hanswennerstrom22's picture
Perfect, it is now working as

Perfect, it is now working as expected. Not sure how I missed that in the Lua section or in the MOD BUS map tool. I have the T7 loading the Lua script from Kipling, then use the MOD BUS map to send a 1 to the 6034 address to re-load the script into RAM. I can then use the 6000 address to start and stop the Lua script. I needed the Lua script to get the faster pulse rate for the stepper motor in order to get the higher RPM speed out of the motor, especially when I needed it to reset back to the starting position, and everything it is now working perfectly. Thanks, again, very happy with the T7 and will recomend your products to everyone.