I need to have a few physical buttons out on the machine for activating some things like solenoid for collet closer. Obviously I could just put a switch directly on the solenoid power, but I need the condition of the solenoid to be known by mach3 and also be able to toggle it within gcode, so basically I need to be able to run a macro with a physical button.
So how do I do this? Do I need to just pump the macro and have it checking the condition of the input? Or is there a more simple way that I'm not thinking of?