Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: joshsxr on July 01, 2015, 09:29:51 PM

Title: Change jog inc. With lua
Post by: joshsxr 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
Title: Re: Change jog inc. With lua
Post by: abarry54 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 (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.
Title: Re: Change jog inc. With lua
Post by: joshsxr 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
Title: Re: Change jog inc. With lua
Post by: dude1 on July 08, 2015, 09:59:07 PM
have a look at https://www.youtube.com/watch?v=MRyaRQwhYWk&list=PLPJIi-cVy_kf0DgD8Aglc30DVGVFd9PR3
Title: Re: Change jog inc. With lua
Post by: joshsxr on July 17, 2015, 10:22:20 PM
I found this thread. 

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