Hello Guest it is October 11, 2024, 10:12:07 PM

Author Topic: newbie help with button  (Read 5308 times)

0 Members and 1 Guest are viewing this topic.

newbie help with button
« 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

Offline RICH

*
  • *
  •  7,427 7,427
Re: newbie help with button
« Reply #1 on: October 31, 2018, 09:44:08 AM »
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

  

Offline Tweakie.CNC

*
  • *
  •  9,233 9,233
  • Super Kitty
Re: newbie help with button
« Reply #2 on: November 01, 2018, 05:56:54 AM »
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.
PEACE