I am not sure how your plugin works but really your E-Stop button should be double pole, one telling Mach there is an E-Stop situation and the other controlling a hardware E-Syop string that shuts everything down mechanically. That way you are not relying on software to stop, the Axis, Spindle etc, in an emergency.
Hood