Skip to main content
Submitted by jeremychoate on Wed, 03/22/2017 - 18:19

I have written the following simple code to handle the ELO Active condition:

#AMPERR
HX 1
#ERRWAIT
WT 2
JP #ERRWAIT,_TA3=3
RE

As you can see, when the ELO input goes active, the code halts the other thread that I have running and enters into a waiting loop for as long as the ELO remains active.

The problem is, when I wrote the code, I was under the impression that _TA3 would clear as soon as the ELO input condition was cleared, allowing the code to escape the loop. This is not the case. TA3 is effectively latched until the ELO condition is cleared AND the MO -> SH commands are issued for the axis or the controller is reset. So, I have created an infinite loop that I can never escape.

What is the proper way to recover from an ELO Active condition?

Comments 4

KushalP on 03/23/2017 - 15:23

Hi jeremychoate,

The way to recover from an ELO Active condition is to first wait for the ELO condition to clear. Then clear the latched _TA3 value by issuing the MO command. Following the MO you can wait an additional time and then turn the motor back on with the SH command. This will ensure that your code will only resume once the ELO condition is cleared and _TA3 no longer reports a value of 3.

jeremychoate on 03/23/2017 - 16:15

Thanks for the reply, Kushal.

I guess my question, though, involves the "waiting for the ELO condition to clear." How would I know that the condition has cleared?

Let's follow the progression of events:

1) I press the e-stop pushbutton which drops my safety relay, sending voltage to the ELO input
2) The ELO (TA3AD) shows active in the watch window of GalilTools
3) I pull out the e-stop pushbutton and reset the safety relay; there is no voltage on the ELO input, now
4) The ELO still shows active in the watch window of GalilTools

I understand that I should recover using MO -> SH when the condition that caused the ELO input to go active is cleared (the safety circuit is reset). However, if the ELO remains active even after the safety circuit is reset, how do I know when it is OK to issue the MO -> SH commands? It would be nice if there were a way to read the ELO input to determine when the safety circuit had been reset. See the pseudo-code:

#AMPERR
- Perform actions upon amplifier error
- Enter into a waiting loop until the safety circuit has been reset (no voltage on ELO pins)
- Upon exiting the loop, reset the axis using MO and SH
- Return from automatic subroutine

What's my condition for exiting the waiting loop?

Thanks.

KushalP on 03/27/2017 - 17:20

Hi jeremychoate,

I see that your question was answered via a call with one of the other Applications Engineers here. The solution being to also connect your ELO signal to a free Digital Input, and use the AI trip point in conjunction with the #AMPERR routine to check if the ELO signal is cleared before issuing MO and SH.

Please let us know if you have any other questions.

jeremychoate on 03/28/2017 - 13:21

Yes, that is correct.
.
However, instead of using a physical input (to save on wiring and give me a bit more flexibility), I am simply using a Modbus variable from my PLC as the exit condition for my loop.
.

For everyone else's benefit: I have configured the DMC as a Modbus slave and my PLC as a Modbus master and am using a separate thread to map data to/from the PLC. One of the signals that I am mapping is a resume bit that I have assigned to a variable named "Resume" in the DMC.
.

When an e-stop occurs, my DMC program drops into the #AMPERR routine, where I will turn off all motors and halt any motion-related threads while keeping the Modbus thread running. Once I've done this, the code enters a waiting loop, where I am waiting for the Resume variable to go high before exiting the loop. Upon exiting the loop, I issue the SH command to turn on all servos, clearing the ELO Active condition and go on with my life.
.

#AMPERR
MO
HX 1
HX 2
#ERRLOOP
WT 2
JP #ERRLOOP,(Resume=0)
SH
WT 2
RE

Hope that helps someone.