Skip to content

Counter

The Counter operation maintains an unsigned integer counter with Up, Down, and Reset inputs. It supports an optional maximum value; when the limit is reached the counter wraps to 0 (overflow) or to the maximum (underflow), signalling the event on dedicated outputs. It includes gate control to conditionally skip counting.

With neither Up nor Down connected the count never moves, and the Editor flags the Node with a warning frame.

Counter operation

Inputs

PortTypeRequiredDescription
> (Gate)AnyNoWhen connected, a false or Nil value stops the path. See Gate Inputs.
UpAnyNoWhen truthy, increments the counter by 1.
DownAnyNoWhen truthy, decrements the counter by 1.
ResetAnyNoWhen truthy, resets the counter to 0 (takes precedence).

Outputs

PortTypeDefaultDescription
CountInteger0Current counter value.
OverflowBooleanfalsetrue for one cycle when an increment wraps the counter from its upper limit to 0.
UnderflowBooleanfalsetrue for one cycle when a decrement wraps the counter from 0 to its upper limit.

Properties

NameTypeDefaultDescription
Counter LimitStackedDataSetControls the counter’s upper bound:
 Integer ValueInteger100Maximum value (min 1). When exceeded the counter wraps to 0. If this sub-type is not selected, the counter runs up to 2 147 483 647.
On ErrorComboStop this branchPer-op On Error verb (Stop this branch / Continue with the last value / Continue with the fallback). See the Error Handling guide.

State on Reload

Counter value and all outputs are preserved across restarts within the configured time window. There is no compatibility check on reload: if the Limit Mode or Max Value changed, the restored counter may be outside the new range and will trigger overflow on the next count-up. Review the counter value after reconfiguration.


  1. Gate check — If a Gate input is connected, evaluate it. A false or Nil value stops the execution path; outputs keep their previous values.

  2. Reset check — If Reset is truthy, the counter is set to 0 and both Overflow/Underflow are cleared. Processing stops.

  3. Up / Down — If Reset is not active, Up and Down are evaluated in order. Both may fire in the same cycle (net effect may cancel out, but overflow/underflow can still trigger).

  4. Wrap-around — If a configured Counter Limit is set:

    • Incrementing past the limit wraps to 0 and sets Overflow to true.
    • Decrementing below 0 wraps to the limit and sets Underflow to true.
  5. Output — The current counter value and overflow/underflow flags are written.


Counter Limit: No max value

Up: true   Down: false   Reset: false

Starting from 0, the counter becomes 1.

OutputValue
Count1
Overflowfalse
Underflowfalse

  • Tracking events (messages processed, successful operations)
  • Implementing iteration counters
  • Managing resource limits or quotas with wrap-around behaviour

  • Counter range is 0 to 2 147 483 647.
  • Only unit increments/decrements; larger steps require multiple trigger events or external logic.