Operations with Counters

Top  Previous  Next

 

There are ‘Counters’ in the PLC 512 which can be used to count events. The counters are numbered from Z0 up to Z511, naturally you can name them sensibly by the symbol table. Counters can be used as up-counter, down-counter and as up- and down-counter. The counting range goes from 0 up to 999.

 

Examples of a counter in FBD:

 

 

If there is a rising edge at the CU the count will be increased by 1. If there is a rising edge at the input ZR the count will be decreased by 1. If there is a rising edge at the input S the counter will be set to the value that is present at the PV input. If ‘1’ is the signal state at input R the counter will be set to ‘0’statically, that means not just with an edge. At the output CV the current count is written binary coded into any word variable. At the output BCD_V the count is written BCD-coded into any word variable. In this form it can be used again directly to serve another counter as PV-value. The output Q will be‘1’ if the counter is > 0. Negative counts or values > 999 do not exist. If there is an edge at the CD-input at the count 0 nothing will happen, this is the same as if at the state of 999 an edge will appear at the CU-input.

 

ZCU

Count up

ZD

Count down

S

Set the counter to the value that is specified at PV

PV

To this preset value the counter is set at a rising edge at S

R

Set the counter to 0

FR (not implemented)

 

 

List of operations