====== CTU Box Function ====== **Count Up Counter** Category: [[en-us_products:mpino_studio2:box_functions:counter|Counter Box Functions]] ===== Behavior ===== Increments the current value once whenever the left condition changes from OFF to ON. The done state turns ON at or above the set value, and counting stops at the maximum value. ===== Syntax and Arguments ===== **Syntax:** ''CTU C11 3'' * Target — counter memory C (16-bit) or DC (32-bit) that stores the count value * preset — count at which the done bit turns ON (an integer, not time) ===== Behavior Example ===== ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | Left condition ON | C11=0 | ''CTU C11 3'' | 3 rising edges → C11=3, C11 done contact=ON | {{ :en-us_products:mpino_studio2:counter-ctu-timing.svg?1000 |CTU input, current value, and done state }} ===== Cautions ===== * A counter changes once per rising edge of the left condition. On MPINO-8A4R(T)-S, C0 through C10 are mapped to board functions, so use C11 or later for a counter. ===== Box Functions in the Same Category ===== * [[en-us_products:mpino_studio2:box_functions:counter:ctd|CTD View details]] — Count Down Counter * [[en-us_products:mpino_studio2:box_functions:counter:ctud|CTUD View details]] — Count Up/Down Counter