I am going to guess that you have the N/C side of the E-Stop wired into
your spindle power wiring. It is correct for this to reconnect power to the
spindle when you release the latching E-Stop button.
The other side of the E-Stop switch is N/O and should be wired to the
/Fault input if you have a PMDX-126. This will turn off all the outputs of
the PMDX-126 and also signal an E-Stop to the control software. It is the
responsibility of the software to turn off the spindle so that when the
E-Stop switch is released, the spindle (and everything else) remains off.
Mach3 must always have an E-Stop assigned. For the PMDX-126 that
should be Port 1, Pin 10, and Active High (red X in the Active Low box).
In Mach4 it is possible to configure the software without an E-Stop signal
enabled. Mach4 will run without a signal assigned to E-Stop, but it will not
carry out the responsibilities that are required for machine safety in the
event of an E-Stop.
If you are using a SmartBOB with Mach4, you must configure the E-Stop
input in Mach4 for the correct pin (typically Pin 10) and for Active Low
if you are using a N/O contact connected to Gnd. The chart of Input Signals
in Mach4 is very long and the E-Stop is near the bottom. You will have to
scroll down to see it.
You can verify that your software is seeing the E-Stop switch by looking
at the Diagnostics page in Mach3 or the Machine Diagnostics page in Mach4.