T-n-T: Advanced counter

General description

Using these solutions, it is possible: to count the number of events (leading edges of incoming signals) without using the “Counter” functional block, to set the initial value of the counter (other than zero) or reset the counter (to set the initial value to zero) upon an event or an external command, and also set an increase in the counter value by more than 1.

Program cycle counter

The problem

It is required to organize the Program cycle counter, which have passed since the controller’s power was restored.

The solution

Counter of the diagram execution cycles: after the diagram is started, the increase in the counter value will be performed at each cycle of its execution; the counting of cycles is performed with overflow - if the counter value is 65535, the next cycle of the diagram execution will make it equal to 0.

Program cycle counter. The solution (diagram).

Counter with initial value

The problem

It is required to organize a counter with the ability to set an initial value.

The solution

Event counter with initial setting.

Counter with initial value. The solution (diagram).

Counter with setting different increment values

The problem

It is required to organize a counter with the ability to set an initial value and various increment values.

The solution

Increase the counter by one value or another, depending on the specified conditions.

Counter with setting different increment values.

TODO:TRANSLATE

SEE ALSO