Hello Guest it is August 20, 2019, 10:45:57 AM

Author Topic: Toggle output from button input?  (Read 8646 times)

0 Members and 1 Guest are viewing this topic.

Re: Toggle output from button input?
« Reply #10 on: March 09, 2015, 10:33:54 AM »
Thanks for your help guys, maybe I'm doing something wrong but no joy I'm afraid. Maybe I'll just do it outside of Mach 3.

I was hoping just to copy the routine that's used for the Flood Toggle and Mist Toggle buttons on the Diagnostic screen, both of which I have operated from external buttons. I'm clearly missing something basic.

Offline TPS

*
  •  1,375 1,375
    • View Profile
Re: Toggle output from button input?
« Reply #11 on: March 09, 2015, 10:38:49 AM »
Have you macropump enabled in general config ?
is your macropump macro in the wright folder ?
is your input1 working in diagnostic screen ?
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Toggle output from button input?
« Reply #12 on: March 09, 2015, 10:52:00 AM »
Have you macropump enabled in general config ? Yes

is your macropump macro in the wright folder ? Yes

is your input1 working in diagnostic screen ? No

Where's the drowning man emoticon, I think I'm way out of my depth here!
Re: Toggle output from button input?
« Reply #13 on: March 09, 2015, 10:58:04 AM »
I think I'm getting very confused here, Do I just enter the macro as this

If not IsActive (Input1)  = True Then
  LED = GetOEMLED(78)  ' LED looks at state of Output 5 LED
End If

If IsActive (Input1) And LED = True Then  ' looking at input 1 and LED of Output 5
  DeActivateSignal (OutPut5)
Else
 If IsActive (Input1) And LED = False Then
   ActivateSignal (OutPut5)
 End If
End If

Or do I follow the guide in the pdf attached to Thomas's post???

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Toggle output from button input?
« Reply #14 on: March 09, 2015, 11:09:07 AM »
That should work as above.

Remember you need to restart Mach any time you alter the macropump.

Is Input 1 working yet when you press your switch?

Hood
Re: Toggle output from button input?
« Reply #15 on: March 09, 2015, 11:17:51 AM »
Ok, have re-entered as above, input 1 is operating in diagnostics but not triggering output 5?

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Toggle output from button input?
« Reply #16 on: March 09, 2015, 11:22:14 AM »
Does output 5 LED light on diagnostics?

Hood
Re: Toggle output from button input?
« Reply #17 on: March 09, 2015, 11:33:26 AM »
Does output 5 LED light on diagnostics? No!

If I step through the macro in debug mode with no input to input 1 nothing happens, with input 1 on when I get to the 2nd last EndIf then output 5 turns on but stays on irrespective of input 1 status. only reset seems to clear it.?

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Toggle output from button input?
« Reply #18 on: March 09, 2015, 11:38:38 AM »
Is your switch a momentary switch?

Hood
Re: Toggle output from button input?
« Reply #19 on: March 09, 2015, 11:41:38 AM »
Is your switch a momentary switch?.............. Yes