Machsupport Forum

Mach Discussion => Mach Screens => Screen designer tips and tutorials => Topic started by: jcmoras82 on February 18, 2016, 03:11:34 PM

Title: Button to assign value to a variable
Post by: jcmoras82 on February 18, 2016, 03:11:34 PM
hi i'm using mach 3 and I need to make some changes to my screen to assign a value to one variable on my GCODE instead of editing the value of the variable directly in the GCODE.
I was thinking to put un DRO and then on button thats take that value and set it to the variable [ with Setvar()]

Can anyone help me with the code??? ( i don't know how to get the data of the DRO and then properly assign the value to the variable)

thanks !
Title: Re: Button to assign value to a variable
Post by: Overloaded on February 18, 2016, 04:13:10 PM
Hi,
 just playing with this idea.
Put a dro and a button on the screen
I used 1234 for example.
Put the script in the button.
Seem to work OK.
Title: Re: Button to assign value to a variable
Post by: jcmoras82 on February 18, 2016, 08:12:12 PM
Thanks It's work OK !