dcooper33
Lifetime Supporting Member + Moderator
Hi guys,
I was told to look into a strange problem the other day. PLC 5/40e has a counter that keeps track of shift runtime minutes and stores them in an N register(N7:0). At shift change (6:30 am and pm) that number is moved into a different integer (N7:1) and then N7:0 is cleared. N7:0 and N7:1 are both displayed on a PV+ for the operators to track production info.
Here is what the logic for that looks like originally (recreated in RS500 from RS5):
Then one day, the previous shift minutes display will only display Zero, rather than what the previous shift actually ran. So obviously the rung must have been re-executing and MOVing the NEW 0 value in N7:0 into N7:1.
Now, to me, the "Do not repeat" timer is redundant when you have a one-shot, not sure why it was in there. But I'm curious, so rather than replace the timer with a counter, I just leave the input logic alone and just add a counter to the output of the rung with a preset of 1 and an XIO of the done bit in series with the first MOV instruction. That way the rung can continue to execute as many times as it wants, but it will only move the runtime data once.
Sure enough, after coming back and looking at the results for a few shifts, I'm getting counts of 2-4 on C5:0. The operators are happy because their screen looks fine, but I can't figure out how this is happening. The logic, although clunky, looks sound to me. I don't see how it can re-execute unless the system clock is malfunctioning. Even then, the timer should keep the rung from being true again.
Now I'm looking at that ONS. I checked earlier and made sure it wasn't being used elsewhere in the program and it wasn't. Just for giggles I use a new bit and, voila!, no more multiple counts. Everything works just like it always did. Which leads me to my question-Can an internal memory bit fail like a physical I/O?
I'd just like to get the pros' opinions on this one, because even though all's well, I hate anomalies like this.
As always, insight is much appreciated.
Cheers,
Dustin
I was told to look into a strange problem the other day. PLC 5/40e has a counter that keeps track of shift runtime minutes and stores them in an N register(N7:0). At shift change (6:30 am and pm) that number is moved into a different integer (N7:1) and then N7:0 is cleared. N7:0 and N7:1 are both displayed on a PV+ for the operators to track production info.
Here is what the logic for that looks like originally (recreated in RS500 from RS5):
Then one day, the previous shift minutes display will only display Zero, rather than what the previous shift actually ran. So obviously the rung must have been re-executing and MOVing the NEW 0 value in N7:0 into N7:1.
Now, to me, the "Do not repeat" timer is redundant when you have a one-shot, not sure why it was in there. But I'm curious, so rather than replace the timer with a counter, I just leave the input logic alone and just add a counter to the output of the rung with a preset of 1 and an XIO of the done bit in series with the first MOV instruction. That way the rung can continue to execute as many times as it wants, but it will only move the runtime data once.
Sure enough, after coming back and looking at the results for a few shifts, I'm getting counts of 2-4 on C5:0. The operators are happy because their screen looks fine, but I can't figure out how this is happening. The logic, although clunky, looks sound to me. I don't see how it can re-execute unless the system clock is malfunctioning. Even then, the timer should keep the rung from being true again.
Now I'm looking at that ONS. I checked earlier and made sure it wasn't being used elsewhere in the program and it wasn't. Just for giggles I use a new bit and, voila!, no more multiple counts. Everything works just like it always did. Which leads me to my question-Can an internal memory bit fail like a physical I/O?
I'd just like to get the pros' opinions on this one, because even though all's well, I hate anomalies like this.
As always, insight is much appreciated.
Cheers,
Dustin
Last edited: