RBlabs Posted February 20, 2015 Share Posted February 20, 2015 New to LabJack, Azeotech and Lua, I have just written a Lua script to average N pulse-width measurements taken every ms; each time N (typ 1000) is reached it calculates the average and updates a register in Lua IO Memory for DaqFactory to read and plot. I also want to be able to update N in Lua IO Memory with a DaqFactory Variable Value Component: Set To action from the Graph page. My Lua script works but I do not yet know how to go about accessing these shared registers from DaqFactory. Link to comment Share on other sites More sharing options...
LabJackSupport Posted February 23, 2015 Share Posted February 23, 2015 New to LabJack, Azeotech and Lua, I have just written a Lua script to average N pulse-width measurements taken every ms; each time N (typ 1000) is reached it calculates the average and updates a register in Lua IO Memory for DaqFactory to read and plot. Say your script will put a value in LUA_IO0_READ for DF to read. I can think of 2 ways for DAQFactory to read any register: 1. Call eReadName in script somewhere, or 2. In the Channels setup choose I/O Type = Special and put the desired register name in the Quick Note column. I also want to be able to update N in Lua IO Memory with a DaqFactory Variable Value Component: Set To action from the Graph page. My Lua script works but I do not yet know how to go about accessing these shared registers from DaqFactory. Sounds like you want DAQFactory to write a value to LUA_IO0_WRITE for the script to read & use. I can think of 2 ways for DAQFactory to write any register: 1. Call eWriteName in script somewhere, or 2. In the Channels setup choose I/O Type = Special and put the desired register name in the Quick Note column. Link to comment Share on other sites More sharing options...
RBlabs Posted March 3, 2015 Author Share Posted March 3, 2015 Thank you for your input, which by the way is spot on. Both of your suggestions are correct and my script is working fine. I am new to forums as well, and impatient, so though I figured this out myself soon after posting my questions I neglected to go back to the forum to see your response. I do appreciate your help and will try to do better in the future. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.