Machsupport Forum
Mach Discussion => Mach Screens => Screen designer tips and tutorials => Topic started by: Tiggger ZA on October 29, 2018, 10:28:21 AM
-
Hi guys
completely new to messing with the button functions etc
Friend of mine is looking to have a button added to the axis DRO that will half the readout
ie if the X axis reads 200mm he wants the button to halve it and rewrite the DRO as 100mm...
is this possible?
and if so , how the heck do I do it?
thankooo
Glen
-
Glen,
Yes it is possible. I assume you this is in reference to Mach3. If Mach4, the following does not apply.
1. You will need a screen editor, like MachScreen to add the button.
2. You can write / assign some code to manipulate the DRO value in the screen editor.
An option could be to ceate an M code which can do the same but you will need to call the Mcode via the MDI line.
Welcome to the learning curve........................,
RICH
-
Following the suggestion by Rich, if you add a new screen button then on the button press the following button code will half the value shown in the X axis DRO half it and then write the new value back to the X axis DRO.
Tw=GetOEMDRO(800)
Call SetOEMDRO(800,Tw/2)
Tweakie.