Machsupport Forum

Mach Discussion => Mach Screens => Topic started by: madeintheshed on September 02, 2009, 03:01:22 AM

Title: ON/OFF buttons
Post by: madeintheshed on September 02, 2009, 03:01:22 AM
Greetings.

Is there a way that I could create seperate "on" and "off" buttons for various functions?
For example, I want to assign different keyboard shortcuts to "Optional Stop" so that one button will turn it on, and another will turn it off. This is so that I can use a hardware switch connected to a keyboard encoder. I would rather not use the toggle fuction that that button already uses.
Looking at the screen designer software, it apears that for that function (op stop) there is only a toggle on/off via the same button.
Could someone point me in the direction to find my solution please.

Jon
Title: Re: ON/OFF buttons
Post by: zealous on September 09, 2009, 10:45:39 AM
You can check the state of Optional stop in VB

'turn off M01 bnt
Code: [Select]
if getOEMLED(65)=true Then
'Optional stop is on turn it off
DoOEMButton(177)
End If

'turn on M01 bnt
Code: [Select]
if getOEMLED(65)=false Then
'Optional stop is off turn it on
DoOEMButton(177)
End If

Title: Re: ON/OFF buttons
Post by: madeintheshed on September 15, 2009, 09:05:08 PM
Yeah, that works!
Just had to add onother button so that there is one for off, and one for on.

Now, the other buttons......

Does anyone know the OEM code for Single Block/Step. I cant see it in the list of OEM codes.
Title: Re: ON/OFF buttons
Post by: ger21 on September 15, 2009, 09:53:10 PM
82
Title: Re: ON/OFF buttons
Post by: madeintheshed on September 15, 2009, 10:01:52 PM
Thanks.

But, isnt 82 for the LED?
Title: Re: ON/OFF buttons
Post by: ger21 on September 15, 2009, 10:07:34 PM
Oops, thought that was what you wanted. Try 1004.
Title: Re: ON/OFF buttons
Post by: madeintheshed on September 17, 2009, 07:30:38 AM
Yeap. Thats the one. Thanks