Counter is incremented, if the input variable iDoCount is true.
If iReset is true, the counter is reset before an potential increment.
Increment and start value are customizable. Default increment is 1, start value is 0.
If cMin and cMax are set and cMax is bigger than cMin, then the counter counts cyclic (like a clock). The value of Counter will always be shifted between cMix and cMax (both inclusive).
If the Counter equals the (possibly shifted) cStartValue, a cycle is completed and the CycleNumber is incremented.
For cStartValue=1, cIncrement=1, cMin=1, cMax=10 the counter will start with 1 and give following sequence:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, ...
For cStartValue=3, cIncrement=-1, cMin=0, cMax=10 the counter will start with 1 and give following sequence:
3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9 ...
For cStartValue=18, cIncrement=5, cMin=1, cMax=12 the counter will start with 6 and give following sequence:
6, 11, 4, 9, 2, 7, 12, 5, 10, 3, 8, 1, 6, 11, 4, ...
(18 corresponds to 6 p.m., five hours later it will be 11 p.m, another five hours later 4 a.m. etc.)
Content Type | Name | Description | Data Type | Unit | Min Value | Max Value | Default Value |
---|---|---|---|---|---|---|---|
constant | cIncrement | increment of counter | INT | - | - | 1 | |
constant | cMax | maximal value of the counter of a cyclic counter | INT | - | - | - | |
constant | cMin | minimal value of the counter of a cyclic counter | INT | - | - | - | |
constant | cStartValue | start value of counter | INT | - | - | 0 | |
input | iDoCount | counter is incremented if true | BOOLEAN | - | - | false | |
input | iReset | resets the counter to its start value if true | BOOLEAN | - | - | false | |
out | Counter | actual value of the counter | INT | - | - | 1 | |
out | CycleNumber | number of cycles when counting between cMin and cMax | INT | - | - | 0 | |
out | NumberOfResets | number of resets | INT | - | - | 0 | |
out | TotalCount | total count starting from 0 and incremented by 1 | INT | - | - | 0 |