Function-block instructions for counting events. Each counter instance exposes child fields (.CU/.CD, .R/.LD, .Q, .PV, .CV).
| Instruction |
Description |
| CTU |
Count-Up Counter — increments .CV on each rising edge; optional R reset input |
| CTD |
Count-Down Counter — decrements .CV on each rising edge; optional LD load input |
| CTUR |
Resettable Count-Up Counter with dedicated R reset input |
| CTDR |
Resettable Count-Down Counter with dedicated LD load input |
| Variable |
Type |
Description |
.CU / .CD |
BOOL |
Count-up / Count-down input |
.R / .LD |
BOOL |
Reset (CTU/CTUR) or Load (CTD/CTDR) input |
.Q |
BOOL |
Output signal (TRUE when count target is met) |
.PV |
INT |
Preset value (target or starting count) |
.CV |
INT |
Current count value |