Flag Marker and Go-to-Flag Blocks

Flag markers and go-to-flags are blocks that are used in event analysis flowcharts to build subroutines and loops that repeat steps in a flowchart until a certain condition is reached. The flag marker marks a spot in the path of the flowchart, and the go-to-flag transfers the flow of execution to that spot. A flag maker can have any number of incoming and outgoing paths. A go-to-flag can have any number of incoming paths, and no outgoing paths. The flow of execution will always go from the go-to-flag to the designated flag marker.

In the case of multiple incoming paths, the diagram and/or the conditions set in prior blocks will dictate when the transfer happens (i.e., the number of paths that must reach the go-to-flag in order to initiate the transfer of flow). In other words, if multiple incoming paths are present, the behavior will depend on the connections and settings prior to the flag. You should use the Flowchart Simulation Debugger to review the execution sequence for your diagram in order to assure that the transfer happens as intended.

Loops

The following flowchart shows a simple example of how a flag marker and go-to-flag pair can form a loop. In this example, if the number generated by the standard block is higher than 50, the go-to-flag block transfers the flow of execution to the flag marker. The loop will continue to repeat until the task produces a value less than 50.

IMPORTANT: Avoid configurations that would create infinite loops. It may cause the software to be unresponsive or create unresolved issues. You can test your flowchart for any errors before running a simulation by using the Debug tool.

Subroutines

Subroutines are specific tasks that are separate from the main task of the flowchart. The following configuration, for example, shows a flowchart with a main task and a subroutine task. In this case, the main task is to compute for the total cost of repairs. The subroutine task is executed only when the product failure does not cause a fire, in which case, the subroutine computes for either type B or C costs, and then passes that value back to the main task so that it can be counted as part of the total cost. Notice that due to the location of the flag marker called "Costs," the main task skips the computation of the type A repair whenever the subroutine is executed.

To build a subroutine in an event analysis flowchart, follow these two steps:

  1. Create the subroutine task in the same diagram as the main flowchart. Use a flag marker as the starting block for the subroutine, as shown in the example above.
  2. Double-click the flag marker of the subroutine task to open its Block Properties window, and then select the Execute on Call Only check box, as shown next. This setting allows the subroutine to be executed only when it is called by a go-to-flag block. Note that this check box will appear only when the flag marker is used as a starting block. If you do not select this setting, the subroutine task may be executed before it is called by the main task (see also Flowchart Configurations and Execution for a discussion on how flowcharts are executed).

Advanced Configurations

  • Aside from marking a spot in the path of a flowchart, a flag marker may be used to store the value passed to it during simulation into a variable. For example, in the configuration shown next, the summing gate adds the outputs of Blocks A and B, but it cannot store the resulting value; it only passes the result to the next block in the flowchart. In this case, the flag marker can store the value from the summing gate into a storage variable, as well as pass that same value to Block C.

The following picture shows the Block Properties window of the flag marker in the example.