Hi,
it depends on what you want the motor alarm to do?
If the alarm is a 'following error' you probably want the machine to stop rather than continue to machine an inaccurate part.
The question is do you want it to Estop, ie crash stop and potentially lose reference OR do you want to Cycle Stop and come
to a graceful halt without loss of reference?.
Either could be achieved.
I would recommend that you connect Port2Pin9 (MOTOR_ALARM) to a general purpose Mach4 input.
On the ESS Input Signals tab assign Input#5 to MOTOR_ALARM. Note that I have chose input#5 with malice
aforethought because on the Mach diagnostics tab there is an LED that corresponds to Input#5 so you can see it,
very handy when you are coding something new.
Now you would put an entry into the Signal Library in the screen load script.
I have written an introductory guide to using the Signal Library (SigLib{} ) which may help:
https://www.machsupport.com/forum/index.php?topic=40051.msg267764#msg267764In any event you can now put in the in-line function how you wish Mach to behave when it encounters a ISIG_INPUT5:
rc = mc.mcCntlCycleStop(
number mInst)
Description:
Stop a Gcode file that is running.
OR, you could Estop with:
rc = mc.mcCntlEStop(
number mInst)
Description:
Disables the control and optionally dereferences all axes
Craig