Good day.
I have finally added a sander to my cnc …since it’s pneumatic I need to activate a solenoid at the start of the program and de-activate at the end to make things as automatic as possible.
Is there an easy and fast way to do this?
You can assign the output for the solenoid to either one of the coolant signals in Mach4 and then adding M7 or M8 ( whichever is the right one) to your post processor at the beginning of the Gcode to turn it on and M9 at the end to turn it off.
Slab Wizard already includes M9 (turn off all relays) and M30 (end program and rewind to start of program) as the last two commands. All you need to do is edit the gcode manually to add the appropriate relay-on command Jim mentioned somewhere around the ‘Move to X/Y Zero’ line. If you want to set your Z just a little lower each cycle, you can manipulate the Z-axis DRO by adding an offset rather than changing the gcode/running the Wizard.
Those M-codes control relays inside the control box. Those relays are triggered by the same kind of logic signal that could trigger a different external relay or solenoid. You’ll find two pair of wires (black) in terminal blocks at the edge of the card housing your prox sensor connectors. Put your DMM on the terminal block then play with the relay buttons in Mach4 to see how they work.