- Increments the accumulated value at each false to true transition and retains the accumulated value when the instruction goes false or when power cycle occurs.
- The CTU is an instruction that counts false to true transition. When this transition happens the accumulated value is incremented by one count.
- A CTU accumulation is reset by the RES instruction.
- If the accumulation value is over the maximum range then the overflow (OV) bit will be true.
Example 1
Count the number of times a switch goes from off to on. Once we reach a count of 10 energize a light. We should also have a button to reset the counter.
Input / Output
- Input I:1.0/0
- Light O:2.0/0
- Button I:1.0/1
Ladder Logic Solution
When Input goes from off to on the counter C5:0.Acc will increment by one. When Acc is equal to preset then C5:0.DN will be true.
When C5:0.DN is true then the light will go on.
Once the button is pressed the counter C5: 0.Acc will be reset to zero. Hence the counter will start over.
Note
- When the counters done bit goes on the counter will keep counting up. Therefore if the input keeps going from false to true at one point we will get the overflow bit on.
- If the accumulation value is over the maximum range then the overflow (OV) bit will be true.