Hello Guest it is April 19, 2024, 01:17:40 AM

Author Topic: Adding a button to 2 screens in Mach3Turn  (Read 2561 times)

0 Members and 1 Guest are viewing this topic.

Adding a button to 2 screens in Mach3Turn
« on: July 17, 2012, 05:20:15 PM »
I am a new newb to Mach and am trying to add a button to the Manual and Automatic screens of Mach3Turn. I would like this button to Ref All Home with Z first, then X. This would save having to click the Set Home Z button and then the Set Home X. I have the button placed on the screens but am totally lost from there. I have attached a .lset file of what I have so far. Any help would be greatly appreciated. Thanks
Doug

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Adding a button to 2 screens in Mach3Turn
« Reply #1 on: July 17, 2012, 05:54:23 PM »
What you want to do is have the button set as a VB button, you need to do that in the screen editor you use. Once done then you can open in Mach and edit the button by going to the Operator menu then Edit Button Script. The button will be flashing, click it and the editor will open.
What script you have will depend whether your switches share an input or not but either way the safest would be

Do OemButton(1024)
While IsMoving()
Wend
Do OemButton(1022)
While IsMoving()
Wend
Re: Adding a button to 2 screens in Mach3Turn
« Reply #2 on: July 18, 2012, 03:48:03 PM »
Thanks for the reply, Hood. Using Screen4,  I got the button set as a VB button then added the script that you listed above but I get a script error.  I forgot to mention that I am also using my homing switches as limit switches. Do I have to enter more data into the script to make it work?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Adding a button to 2 screens in Mach3Turn
« Reply #3 on: July 18, 2012, 03:55:57 PM »
My apologies, there shouldnt be a space between the Do and the OemButton, so it should be

DoOemButton(1024)
While IsMoving()
Wend
DoOemButton(1022)
While IsMoving()
Wend
Re: Adding a button to 2 screens in Mach3Turn
« Reply #4 on: July 18, 2012, 04:08:00 PM »
Thanks for the fast reply! That fixed the problem.  Thanks for your excellent help. I'm glad there are guys like you out there to help a greenhorn.
Thanks


Doug

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Adding a button to 2 screens in Mach3Turn
« Reply #5 on: July 18, 2012, 05:03:47 PM »
We were all greenhorns at one time and to be honest  the only people not learning new stuff each day are 6ft under ;)
Hood