PLC 5 Frozen Rung of Logic

Hakutsuru

Member
Join Date
Nov 2005
Location
Texas
Posts
168
Recently had an issue that I tracked down to a frozen rung of logic. The PLC is an AB PLC5/40E. the rung of logic is simple. (I hope the text formats correctly)

--][-----[ons]---------(U)
-B3/0 -- B3/1 ------- B3/0

There is another branch of the output that moves a number into an N7 register, but that's harder to draw in text, and I don't think it could cause this. So what I was getting was that B3/0 and B3/1 were both on and staying on. Neither of the bits is used anywhere else in the program. B3/0 is set by my MMI, and the file is scanning. All I had to do was toggle B3/0 and the rung started acting normally again. But since then I've been trying to make the rung lock up again and cannot do it.

There are about 100 of these rungs in the PLC and its been running for probably 5 years now, apparently without having this issue. I say that because I can't see any way for it to reset without intervention from a programmer, and when it does happen it disables an important portion of the code. I actually saw it on my test system. So has anyone seen anything like this, or can you think of a way this can happen? I would feel much better if I knew a way to reproduce it.
 
There is a timing error between the scan of your PLC and the MMI. When the MMI turns on B3/0 the PLC sets B3/1 in the ONS and clears B3/0. If the MMI sets B3/0 again before the PLC gets to the rung on the next scan, the ONS will prevent B3/0 from unlatching and both 0 and 1 bit will be on. If the MMI never clears B3/0, you will get the "frozen" situation. You should just remove the ONS instruction, it does not appear to be necessary. Or use an acknowledge bit back to the MMI to coordinate the two devices.
 
Because the HMI writes asynchronously to the PLC scan you should buffer the reset of B3/0 instead of using the ONS insruction. If the HMI sets B3/0 half way through the program scan and your reset is at the end of the program then any references to it in the first half of the program won't pick it up. In that case you really want to wait until the end of the next scan to reset it. Steve has also pointed out something that can happen rarely, but it can happen with your method. One simple way to buffer the reset until the next scan is like this:

B3/0 B3/1 B3/0
---] [----] [------(U)---

B3/0 B3/1
---] [-------------( )---



The two rungs must be in that order. It still functions like a one shot, but it is constructed by two rungs which makes a subtle but useful difference. It makes sure that B3/0 is on for at least a full entire lap through the program no matter when the asynchronous write from the HMI happens, and the rare situation Steve described won't happen. I recommend you document it so that someone does not come along at some future time and change it back to using the ONS instruction thinking it will work exactly the same way, because it won't always work because it is not exactly the same.


BTW, the way you get ladder text to appear in a post is to use the ladder BB code tag supported by this forum. The text ladder you see above was created by entering the following:
Code:
[ladder]
  B3/0   B3/1      B3/0
---] [----] [------(U)--- 

  B3/0             B3/1
---] [-------------( )---



A branching example
     A                     C
----] [-----+---------+---( )--
            |         |
     B      |         |    D
----] [-----+         +---( )--

[/ladder]

The ladder tag does not lend itself well to editing if you should decide to change your post, its very difficult to get an edited post with a ladder tag to look right.
 
Thanks for the answers. My MMI has a 1 second update time, so I don't think its actually possible for it to have set the bit twice in a single program scan. What is possible is that the PLC was powered off mid scan right after that command was sent. Its not very likely because I don't remember any unplanned outages, but it is possible and it seems like it could have caused this condition.
 

Similar Topics

This hasn't become my problem yet, but it may soon... Ancient PLC-3 (yeah, I know) has been humming along for decades. It now has some analog...
Replies
5
Views
2,457
The past week we received a new piece of equipment from Germany which utilizes siemens controls. Typically in our company we use A.B. controls for...
Replies
9
Views
184
the conveyor can stop because of a safety sensor or safety switch. And also it can stop because of an object jam detector sensor. If the conveyor...
Replies
5
Views
186
Good Day to all of you, this is my first post, i will try to explain as best as possible, english is not my natural language. I am performing an...
Replies
0
Views
40
Hi All, Someone at work has put a PLC system on my desk, that's just been taken off an idle production line. He said "It's an S7 PLC. We don't...
Replies
10
Views
250
Back
Top Bottom