Full Library / Math Operator / Counter / Counter
Block Name: Counter
Code File Location: VisualSim/actor/lib/Counter
Block Overview
- This actor implements an up-down counter of received inputs. Whenever a token is received on the increment input, the internal counter is incremented. Whenever a token is received on the decrement port, the internal counter is decremented. Whenever a token is received from either input port, a token is created on the output port with the integer value of the current count. At most one token will be consumed from each input during each firing. If a token is present on both input ports during any firing, then the increment and the decrement will cancel out, and only one output token will be produced.
increment
public TypedIOPort increment
- The increment port. If this input port receives a token, then the counter is incremented. The port has type general.
decrement
public TypedIOPort decrement
- The decrement port. If this input port receives a token, then the counter is decremented. The port has type general.
output
public TypedIOPort output
- The output port with type IntToken.
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator