So you think on my 3rd rung X3(NO) then I should insert |Y0| before [C1 K5] ?
That suggestion was meant to prevent spurious counts when the conveyor isn't running. The sensor that detects objects on the conveyor probably can't tell the difference between actual objects and other things that might pass in front of it.
This helps troubleshooting?
My comment about troubleshooting was in regard to my suggestion to put the counter reset rung immediately following the counter. Someone trying to troubleshoot issues with the object count will probably want to know the conditions under which the counter is reset. Having the logic controlling the reset right after the counter rung instead of having to look for it several rungs later makes his job easier.
Both of those comments are more about matters of style. Your program may work fine without them
when everything on the machine behaves as expected. The real challenge is to be able to gracefully handle things when they don't behave as expected.
And once again I have to ask if you understand the way the PLC works. Some of your comments have made me suspect you don't have a firm grasp of that.
Step 1: The PLC reads the data from the hard wired inputs.
Step 2: Armed with the latest input data it evaluates each rung of the program in sequence.
Step 3: It updates all of the hard wired outputs.
Step 4: It does some housekeeping.
Step 5: It goes back to Step 1 and repeats the sequence.
It continues like that until something or somebody tells it to stop. Each loop through the sequence takes somewhere between a few hundred microseconds to a few dozen milliseconds.
There are exceptions to that sequence but at this stage of your learning curve you should not be worrying about them.