Short description
An input pulse increments or decrements an internal value, depending on the parameter setting. The output is set or reset when a configured threshold is reached. The direction of count can be changed with a signal at input Dir.
|
Connection |
Description |
|
Input R |
You reset the output and the internal counter value to the start value (StartVal) with a signal at input R (Reset) |
|
Input Cnt |
This function counts the 0 to 1 transitions at input Cnt. It does not count 1 to 0 transitions.
|
|
Input Dir |
Input Dir (Direction) determines the direction of count: Dir = 0: Up |
|
Parameter |
On: On threshold / Value range: 0 to 999999 |
|
Output Q |
Q is set and reset according to the actual value at Cnt and the set thresholds. |
Parameters On and Off
The on threshold On and the off threshold Off can be provided by the value of another already-programmed function:
Analog comparator: Ax - Ay
Analog threshold trigger: Ax
Analog amplifier: Ax
Analog multiplexer: AQ
Analog ramp: AQ
Mathematic instruction: AQ
PI controller: AQ
Up/Down counter: Cnt
For the 0BA7 and later version devices, you can additionally use the actual values of the following already-programmed functions:
On-delay: Ta
Off-delay: Ta
On-/off-delay: Ta
Retentive on-delay: Ta
Wiping relay(pulse output): Ta
Edge triggered wiping relay: Ta
Asynchronous pulse generator: Ta
Stairway light switch: Ta
Multiple function switch: Ta
Stopwatch: AQ
Analog filter: AQ
Average value: AQ
Max/Min: AQ
Threshold trigger: Fre
You select the required function by the block number.
For information on the validity and accuracy of the time base, refer to the LOGO! Manual.
Timing diagram
Description of the function
The function increments (Dir = 0) or decrements (Dir = 1) the internal counter by one count with every positive edge at input Cnt.
You can reset the internal counter value to the start value with a signal at the reset input R. As long as R=1, the output Q is 0 and the pulses at input Cnt are not counted.
Output Q is set and reset according to the actual value at Cnt and the set thresholds. See the following rules for calculation.
Calculation rule
If the on threshold ≥ off threshold, then:
Q = 1, if Cnt ≥ On
Q = 0, if Cnt < Off.
If the on threshold < off threshold, then:
Q = 1, if On ≤ Cnt < Off.
|
|
0BA0-0BA5: |
Caution
The function polls the limit value of the counter once in each cycle.
Thus, if the pulses at the fast inputs I3, I4, I5, or I6 are faster than the scan cycle time, the SFB might not switch until the specified limit has been exceeded.
Example: Up to 100 pulses per cycle can be counted; 900 pulses have been counted so far. On = 950; Off = 10000. The output is set in the next cycle, after the value has reached 1000.
The output would not be set at all if the value Off = 980
Scan cycle time
For information on how to determine the scan cycle time of a LOGO!, refer to the appendix in the LOGO! Manual.