Counter Blocks

In event analysis flowcharts, a counter block increments its value by a specified amount each time the simulation passes through it, and then passes the recorded value to the next block in the flowchart. It may have multiple incoming and outgoing paths. The following example shows a counter block that records the number of loops that it goes through. The counter block passes its tally to the conditional block that stops the loop when the condition is met.

The following picture shows the Block Properties window of the counter block in the example. In this case, the Start Value field indicates that the count starts at 0, and the Increment By field indicates that the start value increments by 1 every time the simulation passes through the block.

The Counter Type field allows you to configure how the block will keep count. There are three options:

  • Reset After Each Simulation. A simulation is a single pass through the flowchart. However, if the flowchart contains one or more loops, and the counter block is within a loop, the simulation may pass through the block multiple times. In this case, the block will count the number of loops repeated, and then reset once the simulation has reached the end of the flowchart.
  • Reset After Each Run. A run is a set of simulations. The counter block will reset after the specified number of simulations have been completed.
  • Reset After Analysis. An analysis is a set of runs. The counter block will reset after each set of runs has been completed.

In addition to passing the recorded value to the next block in the flowchart, the counter block may also be configured to store its output in a variable. The Storage Variable field displays the name of the storage variable, if any.

Advanced Configurations

  • If your block has multiple incoming paths, you can configure the block to not pass an output or compute a result until  the block has received a certain number of inputs. This allows you to control the number of inputs that the block processes at any given time. To do this, enter a value in the Required Number of Executed Incoming Paths field in the Block Properties window. Note that this value simply refers to how many inputs are required, and does not distinguish based on which path(s) the inputs come from. For example, if there are three incoming paths and three required inputs, one input from each path would trigger the block, but so would three inputs from the first path. An asterisk (*) in this field means that the required number of inputs is equal to the number of paths into the block. See Flowchart Configurations and Execution for an example.  

Related Topics and Links