Counter

Read with AI
All docs in one file (llms-full.txt)
Counter #Operation #Node
Counter

Counts each time Count Trigger arrives and outputs an integer to Count Output. Reset Trigger returns it to Min Value, not to 0.

  • The initial values are Min Value = 0, Max Value = 100, Loop = ON
  • The counting direction is determined by which of Max and Min is larger. If Max > Min it is +1, if Max < Min it is -1, and if Max and Min are equal the value does not move even when Count Trigger fires
  • When Loop is ON, going above Max wraps around to Min, and going below Min wraps around to Max
  • The node has Count / Min / Max fields and a Loop toggle, and Count can be edited directly

When Loop is OFF, the value does not stop. The handling for going out of range is only implemented for the looping case, so with Loop OFF it keeps increasing past Max (the same applies in the decreasing direction). If you want it to stop at the limit, place a Math Min / Max downstream to bound it.

Input ports

Port IDType
Count Triggertrigger
Reset Triggertrigger
Min Valueint
Max Valueint
Loopbool

Output ports

Port IDType
Count Outputint

Scriptable members

PathType
minValueInputint
maxValueInputint
loopInputbool
currentCountint
minValueint
maxValueint
loopbool

Synapse Apps (scripting)

await synapse.modules.create({ type: "Counter" })

Pages linking here

Also referenced from