====== CTD Box Function ====== **Count Down Counter** Category: [[en-us_products:mpino_studio2:box_functions:counter|Counter Box Functions]] ===== Behavior ===== Preloads the current value with the set value, then decrements it once on each rising edge of the left condition. The done state turns ON at zero, where counting stops. ===== Syntax and Arguments ===== **Syntax:** ''CTD C12 3'' * Target — counter memory C (16-bit) or DC (32-bit) * preset — starting count loaded on reset (an integer, not time) ===== Behavior Example ===== ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | Left condition ON | C12=3 | ''CTD C12 3'' | 3 rising edges → C12=0, C12 done contact=ON | {{ :en-us_products:mpino_studio2:counter-ctd-timing.svg?1000 |CTD 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:ctu|CTU View details]] — Count Up Counter * [[en-us_products:mpino_studio2:box_functions:counter:ctud|CTUD View details]] — Count Up/Down Counter