Counter

Counter causes an Integer Tag to increment (or decrement) when a specific Bit Tag changes value.

Counter is a background task. When a Counter set to ‘counts up’ or ‘counts down’ is executed, it’ll continue counting until a Counter with the same Output Tag, set to ‘stop counter’ is executed.

You don’t have to execute this command every time you want it to increment or decrement. Execute it when you want to start, stop or change the Counter.

The ‘Output’ is the value that will count up or down. It can be of any Integer type (UI8, UI16, I16 or I32).

The other input box is for the Bit Tag that will cause the Output to count up or down. It isn’t needed for’stop counter’.

‘rise’ causes Output to count when your Bit Tag goes from value 0 to 1.

‘fall’ causes Output to count when your Bit Tag goes from value 1 to 0.

 

Note: In ladder, to execute tasks only once at startup, add a “BIT” that will be turned ON right after.