Programmable Controllers

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:

Note:The incremental encoder is always assigned an input pair, e.g. I03 and I04!

Inputs I 01...I 04 are designed for activating high-speed counters. The following wiring requirements must be observed:

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

Example of a permissible input assignment:

Incremental Encoder Counter

PicoGFX
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:

Note: Avoid unforeseeable switch states. Only use each coil of a relay once in the circuit diagram. Only use a counter input for CF, CH, CI counters once.

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.