PLCs are about time (not timers), and the scan cycle is the clock.
Once each scan cycle, all program instructions, rungs and branches are processed in order, starting at top left and going left to right, and top to bottom. If the processing reaches the end of a branch, it goes back to the most recent beginning of that branch and processes all parallel branches having the same beginning and end points.
The scan cycle then repeats.
Say we are watching the PLC in slow motion, counting scan cycles.
- T298 has not yet expired
- T299 is reset because the T298 output bit is 0
- The rising edge/pulse instruction is waiting for a rising edge of the T298 output bit.
- D1 and D0 both have values of 0.
Then, on scan cycle N, while evaluating rung@0, T298 has reached or exceeded the 3s (300cs) preset time since the previous scan cycle N-1, so the T298 output transitions from 0 to 1.
On the next rung@5,
during that same scan cycle 1, T298 being 1 starts the T299 timer and also increments D1 by 1. The preset time of T299 is 0. But what does that mean?
- Case 1: does T299 expire immediately, i.e. during the current scan cycle N at rung@5, so the T299 output bit changes to 1 for the rest of the current scan cycle N?
- Case 2: does T299 not expire until the next scan cycle N+1, so the T299 output bit keeps its value of 0 during the rest of current scan cycle N?
I don't know the answer, i.e. I don't know which case is matches the timer implementation in that PLC,
a priori (I don't even know this PLC).
But if you run those two cases forward in you head, i.e. evaluate the logic left-to-right and top-to-bottom for the
rest of the
current scan cycle, and then die one or two
more scan cycles, and then compare the resulting values of D1 from those two cases, I suspect you will know the answer.
The scan cycle is the clock.