Skip to content

Counter

Overview

The Counter node counts the total number of signals received. The counter increases by one for every message whose content is neither false or None.

Use Counter when:

  • Tracking the number of items processed in a flow.
  • Counting occurrences of specific events like defects or triggers.

💡 Tip

The Counter increments only when it receives a signal. To sum numeric values from inputs, use the Accumulator node instead.

Inputs

NameTypeDescription
inputanyIncrements the current count by one for each message.
resetanyResets the current count to zero (optional input).

Outputs

NameTypeDescription
counternumberThe current count of received signals.

Parameters

ParameterDefaultValid valuesTunable
Reset threshold0number
Enable reset inputfalseboolean
Enable automatic state resetfalseboolean

Reset threshold

Automatically resets the counter to zero once this value is reached. A value of 0 disables automatic resetting.

Enable reset input

Adds a reset input port to the node, allowing manual resets via signals from other nodes.

Enable automatic state reset

Resets the count to zero whenever the flow state becomes inactive.

Example

Defected items counter

An inspection flow identifies defects in products. Each time at least one defect on the product is detected, a signal is sent to the Counter node to track the total number of faulty items in the current batch.

Configuration:

  • Reset threshold: None
  • Enable reset input: true

Result: The counter increments for each defect and resets or when a manual reset signal is received (end of batch).

Reference:

  • Accumulator — sums the numeric values of inputs
  • Count Polygons — counts the number of polygons in an input list
  • Schedule — entry point for scheduled datetime data
  • Switch — produces a constant boolean value