Appearance
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
| Name | Type | Description |
|---|---|---|
| input | any | Increments the current count by one for each message. |
| reset | any | Resets the current count to zero (optional input). |
Outputs
| Name | Type | Description |
|---|---|---|
| counter | number | The current count of received signals. |
Parameters
| Parameter | Default | Valid values | Tunable |
|---|---|---|---|
| Reset threshold | 0 | number | ✅ |
| Enable reset input | false | boolean | ❌ |
| Enable automatic state reset | false | boolean | ❌ |
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).
Related links
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