Hello Guest it is May 14, 2021, 06:54:32 PM

Author Topic: Change jog inc. With lua  (Read 1797 times)

0 Members and 1 Guest are viewing this topic.

Change jog inc. With lua
« on: July 01, 2015, 09:29:51 PM »
Hello,

I'm wondering if anyone could give me an example of how to send a value to a dro in a lua script and how to format the number. 
I'm trying to use a bdc switch to select the jog inc value, I'm not sure if changing the value of the Inc dro is the best way to make this happen or not.  Any suggestions?

Thank you,
Josh
Re: Change jog inc. With lua
« Reply #1 on: July 02, 2015, 09:37:01 PM »
I'm not sure if this is exactly what you are after but look at the thread I started a week or two ago

http://www.machsupport.com/forum/index.php/topic,30346.0.html

I asked for help doing something pretty similar, the Lua command is scr.SetProperty('DroName', 'Value', tostring(variable)) where DroName is what you named the DRO in the screen set and the variable is the value you want displayed. 'Value' should be left as is.
Re: Change jog inc. With lua
« Reply #2 on: July 08, 2015, 08:30:57 PM »
Thanks Adam,

This is what I believe I need.  I didn't do a good job describing what I'm trying to achieve.  I have a rotary switch that's binary decimal coded, I have a script that decodes the switch to a number.  I then pass this to a table where I call (make active) the different screens.  What I want to do is have several several of the positions of the switch set the increment value for jogging.  For example going from .001 to .01 to .1.
I guess the second part of the question is, would sending the value to the dro change the increment?

I'll be testing this weekend I'll Post my results.

Thanks Again!
Josh
Re: Change jog inc. With lua
« Reply #4 on: July 17, 2015, 10:22:20 PM »