Document, Document, Document, Document
Annotating your code is one of the most important HABITS that you need to develop.
When describing your bits, USE VERBS.
Don't just call label it
Flow Switch
FS-100
------| |------
Instead, be more descriptive of the process:
Product
Is Detected
FS-100
------| |------
In this way, you know that -| |- means Product IS Detected and -|/|- means Product IS NOT Detected.
When describing your rungs, describe what you INTEND to happen, not what the rung is doing.
So often, I read descriptions that read something like: "When FS-100 is made, one-shot move a 0 into Total." That's not particularly helpful, because I can see the same thing in the code.
But if it said something like: "When Product is showing up at the flow switch, this is the starting point by which we'll measure how much product we're sending. Clear the Total at the start of the process."
Now you understand WHY the components are there. You might even realize that, if the flow gets interrupted for some reason, the ONS will drop out, and fire again when restarting, giving you a low total. So you might want to come up with a better way of detecting "Start of the process". The comment may remain unchanged, but the code will change.