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,445
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
2
Views
95
I was loading a program onto an XE1e2 PLC and it got stuck on these two windows and won't progress. It won't let me connect from the PC to reload...
Replies
0
Views
55
I'm a beginner in the automation field and I've set up an automation system connecting several devices (datalogger, radio, etc.) via Modbus RS485...
Replies
5
Views
179
I have a file which I'm hoping is for a Mitsubishi A172SHCPUN processor but I can't see how to open it in GX Developer V8.102G The file is a zip...
Replies
4
Views
175
Back
Top Bottom