Instruction that set an input to decrement a counter.
Syntax |
ct_cd (counter cnt, inCond) |
---|---|
cnt |
Name of counter (defined as type of variable) |
inCond |
Count input (rising edge). Can be any condition, even an expression (e.g., cp(1) > 1000) |
Validity |
Rule, Task |
Note |
Counters are not retentive |
On the rising edge of the input(inCond), the current value (CV) is decremented by 1. The output (QU) goes into the ON state when the current value (CV) becomes <= of the preset value (PV). The count (CV) is a non limited i32 type variable (from the maximum negative value goes to the maximum positive value).
Example of use:
|