Input to toggle output
- djreiswig
- 4.5 Star Elite Contributing Member
- Posts: 2021
- Joined: Thu Nov 19, 2015 10:02 pm
- Location: SE Nebraska
Input to toggle output
I'm wanting to put a button on my screen to toggle an output on and off. I would also like to control this output with a mechanical switch tied to an input. How would I go about setting this up? I plan on having an LED on the screen to keep track of the output state. I think I can figure out how to make the screen button work by checking the LED and activating or deactivating the output, but how do I get the input to activate the button and toggle the output?
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
- acourtjester
- 6 Star Elite Contributing Member
- Posts: 8131
- Joined: Sat Jun 02, 2012 6:04 pm
- Location: Pensacola, Fla
Re: Input to toggle output
This may help I found this and used it to add a light to the program page to show when the probe was activated
https://www.youtube.com/watch?v=F1Siihp0nSo you need to got to Mach's web site and download Screen 4.
https://www.youtube.com/watch?v=F1Siihp0nSo you need to got to Mach's web site and download Screen 4.
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
- djreiswig
- 4.5 Star Elite Contributing Member
- Posts: 2021
- Joined: Thu Nov 19, 2015 10:02 pm
- Location: SE Nebraska
Re: Input to toggle output
Yeah, I can make the LED follow the output. I can also make the screen button toggle the output. I'm not sure how to get the input to toggle either the button or the output directly.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
- djreiswig
- 4.5 Star Elite Contributing Member
- Posts: 2021
- Joined: Thu Nov 19, 2015 10:02 pm
- Location: SE Nebraska
Re: Input to toggle output
I found this.
https://www.machsupport.com/forum/index ... #msg101160
It seems to be working with an emulated hotkey on the trigger input. Not sure if it will work with the actual switch, but I assume so.
https://www.machsupport.com/forum/index ... #msg101160
It seems to be working with an emulated hotkey on the trigger input. Not sure if it will work with the actual switch, but I assume so.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
- East German
- 4 Star Elite Contributing Member
- Posts: 591
- Joined: Sat Jan 05, 2013 8:21 am
- Location: Stapelburg Germany
Re: Input to toggle output
Hello
I have two button for suction and plasma cutter on off. They can be operated with the gamepad.
I do not have an external switch.
My Button Script:
If GetUserLED (1318) Then
SetUserLED(1318,0)
DeactivateSignal(18)
Else
ActivateSignal(18)
SetUserLED(1318,1)
end if
Maybe it helps.
Peter
I have two button for suction and plasma cutter on off. They can be operated with the gamepad.
I do not have an external switch.
My Button Script:
If GetUserLED (1318) Then
SetUserLED(1318,0)
DeactivateSignal(18)
Else
ActivateSignal(18)
SetUserLED(1318,1)
end if
Maybe it helps.
Peter
Sorry for my language! The last English class was in 1982.
Homemade CNC Plasma-Watertable
MyPlasmCNC
Hypertherm Powermax 85
Machine Torch
Hypertherm Powermax 1100
Machine Torch
Homemade CNC Plasma-Watertable
MyPlasmCNC
Hypertherm Powermax 85
Machine Torch
Hypertherm Powermax 1100
Machine Torch
- East German
- 4 Star Elite Contributing Member
- Posts: 591
- Joined: Sat Jan 05, 2013 8:21 am
- Location: Stapelburg Germany
Re: Input to toggle output
- Attachments
-
- OEM Button Code.jpg (30.19 KiB) Viewed 1153 times
- OEM Button Code.jpg (30.19 KiB) Viewed 1153 times
Sorry for my language! The last English class was in 1982.
Homemade CNC Plasma-Watertable
MyPlasmCNC
Hypertherm Powermax 85
Machine Torch
Hypertherm Powermax 1100
Machine Torch
Homemade CNC Plasma-Watertable
MyPlasmCNC
Hypertherm Powermax 85
Machine Torch
Hypertherm Powermax 1100
Machine Torch
- djreiswig
- 4.5 Star Elite Contributing Member
- Posts: 2021
- Joined: Thu Nov 19, 2015 10:02 pm
- Location: SE Nebraska
Re: Input to toggle output
I am going to use a manual button on an input. I needed a way for Mach to see the button and turn on an output. The OEM trigger was the key to get it to look for the button. Then the hotkeys get the input to run the macro to turn on the output. I did use code similar to what you posted earlier to do the toggle.
I'm setting up a second BOB to handle the additional functions, so it will be a bit before I can actually test the button, but it works with an emulated input so I'm hopeful.
I'm setting up a second BOB to handle the additional functions, so it will be a bit before I can actually test the button, but it works with an emulated input so I'm hopeful.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)