Programmable Controllers

Programmable Logic Controllers

Pico Controllers

Counter Functions

High-Speed Counter “CH” 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

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

PicoGFX
Symbol in the function
block diagram

General Information on the CH High-Speed Counter

The devices provide 4 high-speed counters (CounterH) CH01...CH 04.

These high-speed up/down counters are internally connected with the digital inputs I01...I04 and operate independently of the cycle time.

You can enter upper and lower threshold values (setpoints) as comparison values.

The appropriate function block contact (bit output) switches according to the actual value determined.

Function

The maximum counter frequency is 5 kHz.

Only square wave signals are permissible.

The mark-to-space ratio is 1:1.

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  
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  
D_ Count direction 0 = up counting, 1 = down counting
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.