Input to toggle output

Mach3 and Mach4 questions, tips and topics can be posted here
Post Reply
User avatar
djreiswig
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1938
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Input to toggle output

Post by djreiswig »

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)
User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 7792
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: Input to toggle output

Post by acourtjester »

This may help I found this and used it to add a light to the program page to show when the probe was activated :D
https://www.youtube.com/watch?v=F1Siihp0nSo you need to got to Mach's web site and download Screen 4.
probe button.JPG
probe button.JPG (53.6 KiB) Viewed 831 times
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
User avatar
djreiswig
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1938
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: Input to toggle output

Post by djreiswig »

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)
User avatar
djreiswig
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1938
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: Input to toggle output

Post by djreiswig »

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.
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)
User avatar
East German
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 583
Joined: Sat Jan 05, 2013 8:21 am
Location: Stapelburg Germany

Re: Input to toggle output

Post by East German »

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
Attachments
Gamepad.jpg
Gamepad.jpg (65.81 KiB) Viewed 820 times
Hypertherm on off.jpg
Hotkey.jpg
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
User avatar
East German
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 583
Joined: Sat Jan 05, 2013 8:21 am
Location: Stapelburg Germany

Re: Input to toggle output

Post by East German »

Attachments
OEM Button Code.jpg
OEM Button Code.jpg (30.19 KiB) Viewed 810 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
User avatar
djreiswig
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1938
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: Input to toggle output

Post by djreiswig »

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.
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)
Post Reply

Return to “Mach3 & Mach4 CNC”