en-us_products:mpino_studio2:box_functions:counter:ctd
Table of Contents
CTD Box Function
Count Down Counter
Category: 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<n> (16-bit) or DC<n> (32-bit)
- preset — starting count loaded on reset. An integer or a memory address such as
D10(time units are not accepted)
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 |
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.
- When the preset is a memory address, CTD reads the value only at boot and when it is initialized by a RESET coil. After changing the value while running, for example from an HMI, you must turn the RESET coil on once to apply it. When the memory value is 0, the counter does not complete. For details, see Set the Preset from Memory.
Box Functions in the Same Category
- CTU View details — Count Up Counter
- CTUD View details — Count Up/Down Counter
en-us_products/mpino_studio2/box_functions/counter/ctd.txt · Last modified: by 127.0.0.1
