Counter
This function block keeps a running total of numeric inputs. It is useful for simple accumulations, counters, or integrating values over time. Use the reset input to clear the accumulated value when needed.
π₯ Inputs
Number
Provide a numeric value to be added to the running total. Each evaluation adds this value to the current accumulation.
Reset
A boolean signal that clears the accumulated total when active (true).
π€ Outputs
Number
The current accumulated total after processing the inputs.
πΉοΈ Controls
This block does not expose additional on-block controls or sliders. It operates based on the provided inputs.
π― Features
Persistent accumulation of incoming numeric values across evaluations.
Immediate reset capability via the
Resetinput to start counting from zero.Skips disconnected inputs so only active numeric sources affect the total.
π Usage Instructions
Connect a numeric source to the
Numberinput to increase the counter.Use a boolean source on the
Resetinput to clear the counter when needed.Read the current total from the block's
Numberoutput.
π How it runs
On each run, the block checks the Number input and adds it to the stored total. If the Reset input is active, the stored total is cleared before continuing. The updated total is emitted through the Number output.
π‘ Tips and Tricks
Combine with
Number Inputto manually test counting behavior.Use
Logic Inputas a convenient way to trigger theResetsignal from the UI.Use
Data Memoryto freeze or retain a recorded total under certain conditions.Send the output into
CSV ExportorData to JSONto log counts over time for later analysis.Visualize numeric changes live by connecting the output to
Scope.
π οΈ Troubleshooting
No change in total: ensure the
Numberinput is connected and producing numeric values. UseIs NoneorData Type Converterif needed to validate inputs.Unexpected values or types: insert
Roundor other math operation blocks to sanitize incoming numbers.Need periodic persistence: export the output with
CSV ExportorData to JSONso counts are stored outside the scenario.
Last updated
Was this helpful?