Thanks for covering for me, Ron. I've been trying to ween myself off this site (someone gave me a LIFE for Christmas, and I've been trying to figure out how to use it).
PERSPOLIS:
I assume that this is the link you are referring to:
http://www.plctalk.net/qanda/showthread.php?s=&postid=9086
First, just to explain a little further for you what Metz's problem was. He had code that looked something like this:
If the ANALOG signal is out of Range (1 to 5 V), go to a subroutine (3)
ANALOG 5
---+-----| > |---+-----( SUB 3 )
| |
| ANALOG 1 |
+-----| < |---+
This is subroutine 3
BLINK ACKNOWLEDGED ALARM_LIGHT
----| |------|/|-------+-------( )
|
ACKNOWLEDGED |
-------------| |-------+
.
What would happen is that when the ANALOG was out of range, the light would turn ON (I''ve left off lots of needed code in my example), but if the ANALOG were to come back within range, the subroutine would no longer be called, and the ALARM_LIGHT would stay in it's last
scanned condition, leaving it ON, even though the alarm condition (out of range) had cleared.
Metz desired to have the ALARM_LIGHT acknowledge itself (i.e., turn OFF) if the alarm condition cleared.
I suggested three possible solutions. The first was to move the ALARM_LIGHT coil out of the subroutine so that it would always be scanned, and thereby always be under program control (the program can't control a rung that it doesn't scan).
A second solution is to alter the subroutine logic so that is calls the routine on both an out-of-range, OR when the light is on.
ANALOG 5
---+-----| > |---+-----( SUB 3 )
| |
| ANALOG 1 |
+-----| < |---+
| |
| ALARM_LIGHT |
+----| |------+
.
Logic would have to be added to the ALARM_LIGHT rung to only have it ON when the ANALOG was out of range.
A third solution is to have a new subroutine (4) which will be called up when the ANALOG is
NOT out-of-range. This subroutine would also drive the ALARM_LIGHT coil. This would mean that ALARM_LIGHT would be "double coiled", which some PLCs won't let you do. But from a PLC scan standpoint, only one instance of the ALARM_LIGHT coil. It's not a very good solution to the problem, but it helps illustrate the main point:
if a subroutine isn't scanned, the outputs stay in the same state as they were last in, unless controlled by something else.
This rung is added to the Main program
If the ANALOG signal is IN Range (1 to 5 V), go to a subroutine (4)
ANALOG 1 ANALOG 5
--------| >= |--------| =< |------( SUB 4 )
This is subroutine 4
ALWAYS_OFF ALWAYS_OFF ALARM_LIGHT
----| |----------|/|-------------( )
.
Does that clear things up?
BTW: Check you Private Messages. There's a reply from me from 2 weeks ago that, according to tracking, you haven't read yet.