Programmable Logic Controllers
Pico Controllers
Counter Functions
Incremental Counter "CI" for Pico GFX
The control relays and visualization devices provide a range of different high-speed counter functions.
These counter function blocks can be connected directly to the digital inputs.
The following counter functions are possible:
- CF.. Frequency counters, frequency measurement
- CH.. High-speed counters, high-speed signal counting
- CI.. Incremental encoders, dual-channel incremental encoder signal counting
Inputs I 01...I 04 are designed for activating high-speed counters. The following wiring requirements must be observed:
- I 01 => CF 01, CH 01 or CI 01
- I 02 => CF 02, CH 02 or CI 01
- I 03 => CF 03, CH 03 or CI 02
- I 04 => CF 04, CH 04 or CI 02
Input assignment
Caution: Each I .. input on the device can only be used once by a CF, CH, CI function block. If an input Ixx is used several times, only the high-speed counter is run that is positioned at the back in the order of processing in the function block diagram.
Example of an impermissible input assignment
- I 01 = High-speed counter CH 01
- I 01 = Frequency counter CF 02
- I 01 = Incremental encoder channel A CI 02
- All function blocks are associated with the digital input I1, but only CH01 is triggered and supplies the correct counter value.
Example of a permissible input assignment:
- I 01 = High-speed counter CH 01
- I 02 = Frequency counter CF 02
- I 03 = Incremental encoder channel A CI 02
- I 04 = Incremental encoder channel B CI 02
Incremental Encoder Counter

Symbol in the function
block diagram
The devices provide two incremental encoders (Counter Incremental) CI01 and CI02 for selection.
The high-speed counter inputs are permanently connected with the digital inputs I01, I02 or I03, I04 and count independently of the cycle time.
You can also define lower and upper limit values as comparison values as well as an actual value (start value) at the SV input.
The appropriate function block contact (bit output) switches according to the actual value determined.
Function
The maximum counter frequency is 3 kHz.
Only square wave signals are permissible.
The mark-to-space ratio is 1:1.
The signals of channels A and B must be offset by 90°. Otherwise the count direction cannot be determined.
Note: Due to the internal function of the incremental counter, double the number of pulses are counted. The incremental encoder evaluates rising and falling edges in order to ensure reliable detection. You must therefore divide the actual value at QV by two in order to determine the actual number of pulses.
The counter wiring must observe the following digital input assignment:
- I01 Counter input for counter CI01 channel A
- I02 Counter input for counter CI01 channel B
- I03 Counter input for counter CI02 channel A
The Function Block and its Parameters
| Description | Note | |
|---|---|---|
| Function block inputs (DWord) |
||
| SH | Upper setpoint | The function block operates in the integrer range from -2147483648…+2147483647 |
| SL | Lower setpoint | |
| SV | Preset actual value | |
| Function block output (DWord) |
||
| QV | Actual value in RUN mode | Each pulse is counted twice. Example: Value at CI..QV = 42000; the counter has actually counted 21000 pulses. |
| Contact (bit output) |
||
| OF | Status 1 if the actual value is greater than or equal to the upper setpoint (Overflow) | |
| FB | Status 1 if the actual value is less than or equal to the lower setpoint (Fall below) | |
| CY | Status 1 if the above value range is exceeded. | |
| ZE | Status 1 if the value of the QV function block output (i.e. the counter status) is zero | |
| Coil function (bit input) |
||
| EN | Enable for counter function block | |
| SE | With a rising edge transfer the preset actual value | |
| RE | Reset the actual value to zero | |
| Parameter set | ||
| Call enabled | Function block parameters can be viewed on the device. | |
| Simulation | ||
| Not possible | Hardware-dependent function block | |
Memory Requirement
The function block requires 52 bytes of memory plus 4 bytes per function block input configured with an NU constant.
Retention
Counter relays can be run with retentive actual values. The number of counter relays can be selected in Project View in the Device Properties dialog. The retentive actual value requires 4 bytes of memory. If a counter relay is retentive, the actual value is retained when the operating mode is changed from RUN to STOP and when the power supply is switched off. When the device is restarted in RUN mode, the counter relay continues with the retentively stored actual value.
