Machsupport Forum

Mach Discussion => FAQs => Topic started by: Joe@Majestic on September 07, 2010, 01:06:56 PM

Title: Toggling Outputs
Post by: Joe@Majestic on September 07, 2010, 01:06:56 PM
How do you toggle an output?

as it is right now the wiki shows output on/off 4-6 but no ability to toggle them

thank you

~Joe
Title: Re: Toggling Outputs
Post by: Tweakie.CNC on September 11, 2010, 03:57:43 AM
Joe,

One way is to create a VB screen button and paste in the following code ;

If IsOutputActive(OUTPUT5) Then ‘Check to see if its on
DeActivateSignal(OUTPUT5) ‘Its on so turn it off
Else
ActivateSignal(OUTPUT5) ‘Its off so turn it on
End If

Obviously this is for Output #5 change for whichever output you wish to toggle.

Tweakie.

Title: Re: Toggling Outputs
Post by: jorber on September 28, 2010, 06:01:01 PM
I am trying to make this script:

‘ Show the user the state of the Y HOME input
If IsActive(YHOME) Then
MsgBox “Y HOME is active”
Else
MsgBox “Y HOME  is inactive”
End If

But when I debugg it and I put the mouse over YHOME to see its value shows YHOME = "5" no matter if is active or inactive always the same then acts as always false the statement.
what wolbe happening here? ???
Title: Re: Toggling Outputs
Post by: jorber on September 28, 2010, 06:03:26 PM
I am trying to make this script:

‘ Show the user the state of the Y HOME input
If IsActive(YHOME) Then
MsgBox “Y HOME is active”
Else
MsgBox “Y HOME  is inactive”
End If

But when I debugg it and I put the mouse over YHOME to see its value shows YHOME = "5" no matter if is active or inactive always the same then acts as always false the statement.
what wolbe happening here? ???