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.
Inputs
Port
Type
Required
Description
> (Gate)
Any
No
When connected, a false or Nil value stops the path. See Gate Inputs.
Up
Any
No
When truthy, increments the counter by 1.
Down
Any
No
When truthy, decrements the counter by 1.
Reset
Any
No
When truthy, resets the counter to 0 (takes precedence).
Outputs
Port
Type
Default
Description
Count
Integer
0
Current counter value.
Overflow
Boolean
false
true for one cycle when an increment wraps the counter from its upper limit to 0.
Underflow
Boolean
false
true for one cycle when a decrement wraps the counter from 0 to its upper limit.
Properties
Name
Type
Default
Description
Counter Limit
StackedDataSet
Controls the counter’s upper bound:
Integer Value
Integer
100
Maximum 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 Error
Combo
Stop this branch
Per-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.
Gate check — If a Gate input is connected, evaluate it.
A false or Nil value stops the execution path; outputs keep their previous values.
Reset check — If Reset is truthy, the counter is set to 0 and both Overflow/Underflow are cleared. Processing stops.
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).
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.
Output — The current counter value and overflow/underflow flags are written.