The data moves into the location when the container moves in front of TS14 [TS14 becomes 1] but then didn’t overwrite the data with 0 when the container passed [TS14 became 0 and stayed 0 for more than 600ms (0.6s].
This is the behavior you are seeing?
Especially the part about "
stayed 0 for more than 600ms (0.6s]?" So you saw T0512 expire after those 600ms and you saw T0512 change from 0 to 1?
In other words, is it possible that another container moves in front of TS14, so
TS14 becomes 1, and timer T0512
resets to a value of 0
before timer T0512 expires?
Because if you did see T0512 expire, and it is not possible that T0512 did not expire, then @MaxK is right in suggesting that this rung 46/3227 was not evaluated.
TL;DR
- Rung 13/3048 ensures that the value of D4113 cannot be 0 whenever
- The value of TS14 is 1 (Elvis is in the building)
- AND
- DS4112 is greater than 320
- Rung 78/3311 is a debounce timer to ignore short periods i.e. of less than 600ms, when the value of TS14 is 0 (Elvis is not in the building on this scan cycle)
- Rung 48/3227 puts a value of 0 into D4113 whenever the debounce timer T0512 expires (Elvis has left the building)
Another possibility is that we are not perceiving the actual order of the evaluation of these rungs' logic and the execution of their outputs because of how they are arranged in the image:
on each scan cycle, is Rung 13/3048 evaluated
before Rung 78/3311, and is Rung 78/3311 then evaluated
before Rung 46/3227? I don't think it makes a difference as it should only delay the expected logic by a scan cycle or so, but I have not looked at it too hard.
Remember: the PLC cares not a whit what you
want (or expect or think) it will do, but it will mercilessly and inexorably to
exactly what you
tell it to do.