Counter - Manual - SIMATIC AX - System Counters Library - System.Counters,library

System.Counters library

Portfolio
SIMATIC AX
Product
SIMATIC AX
Software version
8.0.8
Edition
08/2025
Language
English (original)
Package Name
@ax/system-counters

Increments and decrements an integer value on rising signal edges.

If the reset parameter is TRUE, value is 0; changes at other parameters have no effect.

If the reset parameter is FALSE and the loadPreset parameter is TRUE, value is the value of presetValue.

Incrementing a counter with a value of LINT#MAX or decrementing a counter with a value of LINT#MIN will not change the value.

Parameters:

Name Type Section Description
up BOOL Input Increment value by 1 on rising edge.
down BOOL Input Decrement value by 1 on rising edge.
reset BOOL Input Set value to 0.
loadPreset BOOL Input Set value to presetValue.
presetValue LINT Input Value to use as preset.
presetReached BOOL Output value is equal to or greater than presetValue.
zeroReached BOOL Output value is equal to or less than 0.
value LINT Output Current count value.