Type
| Function blockAvailable as standard (non-safety-related) and safety-related type (*_S). For the safety-related type, the safety-related data types (SAFE*) are expected at the formal parameters. |
Description
| Counts down. In case of a rising edge at the input CD and LOAD = FALSE, CV decrements by one. When the value 0 is reached, Q is set to TRUE and the function block stops counting.If LOAD = TRUE, the counter is initialized to the value at PV. To enable counting, the LOAD input must be FALSE. Otherwise the counter will always be re-initialized. |
Notes
|
- The inputs CD, LOAD and the output Q can be negated.Note: The negation of formal parameters is not supported in safety-related code (SNOLD).
- Function blocks have to be instantiated. The instance name of the function block has to be declared in the 'Variables' table of the POU where the FB is going to be used. The instance name must be unique within the POU.
|
Parameters
| Inputs
CD
Data type: | (SAFE)BOOL |
Description: | CV is decreased by one each time the CD input switches from FALSE to TRUE and LOAD=FALSE. |
LOAD
Data type: | (SAFE)BOOL |
Description: | If TRUE, the counter is initialized with PV. If FALSE, counting is enabled.As long as LOAD = TRUE, a rising edge from FALSE to TRUE at CD is ignored. LOAD must be FALSE to enable counting, otherwise CV is continually initialized to PV. |
PV
Data type: | (SAFE)INT |
Description: | Preset value. |
Outputs
Q
Data type: | (SAFE)BOOL |
Description: | TRUE if CV = 0. |
CV
Data type: | (SAFE)INT |
Description: | Counter result. |
|