Does anyone knows if the PLC AB1500 has a nice instruction like the AutomationDirect Ibox “INC” instruction, (increment) where you can use it as a counter and will reset itself after counting up to 9,999 without giving you an overflow error.
No, you gotta roll your own. The CTU might be a good starting point. If you preset it to 10000 and on the following rung XIC the DN bit and RES the counter, then it would do the same thing.
The INC instruction is not a counter. Counters only increment on false-to-true transitions. I.e. if input rung is TRUE on this scan AND was FALSE on last scan, then increment counter accumulator. The INC instruction increments its argument every time the input rung is true.
The argument is not being reset by the INC instruction once its value is greater than 9999. The value is rolling over like an odometer.
The reason 9999 is the max value is that the Koyo default math is BCD and 9999 is the max value for a 16 bit word.