I have installed some relays with separate 5vdc power supply to basically turn on/off a power receptacle where my spindle and the vacuum cleaner are connected to and this is what it does without any software setup:
I started the computer, loaded Mach3, and turned on the control box and it stayed off as it should. I loaded a simple test program that didn’t have any M03 g-code in it and when I clicked on start the machine started running and the relayed turned on, ran the program and it came back to the starting point but the relay never turned off and the program had M05 (Spindle Off) and M02 (End Program). The relay also never turned off after I closed the Mach3 and turned off the control box. If I would disconnect the parallel cable from the computer it will turn off but after plugging the cable back in it would turn on again. The relay is connected to pin #14 so the got the power to turn it on when the program stated running and there was nothing there to shut it off after that and it’s still pumping 5v from the computer only. I have never played with that part of the software and I need to find out how to set it.