Command Insert branch right
Symbol:
Function: The command adds a branch to the right of the currently selected position.
Call: Menu SFC, context menu
The type of the inserted branch depends on the selected element:
- If the top-most element of the currently selected elements is a transition or an alternative branch, TwinCAT inserts an alternative branch.
- If the top-most element of the currently selected element is a step, a macro, a jump or a parallel branch, TwinCAT adds a parallel branch with label Branch<x>, where x is a sequential number. You can edit this default label name. You can specify the label as the target of a jump.
- If a common element of an existing branch is currently selected (horizontal line), TwinCAT adds the new branch at the far right as an additional branch. If an entire branch of an existing branch is currently selected, TwinCAT adds the new branch directly to the right of it as a new branch.
Note that you can use the commands Alternative or Parallel to convert a branch to the respective other type. |
Example: Parallel branch
The following diagram shows a newly inserted parallel branch, generated with Command Insert branch right, while step11 was selected. TwinCAT automatically inserts a step (Step2 in the example).
Processing in online mode: If t2 returns TRUE, TwinCAT executes Step2 immediately after step11, before t3 is evaluated.
In contrast to alternative branches, TwinCAT therefore executes both branches.
Example: Alternative branch
The following diagram shows a newly inserted alternative branch, generated with Command Insert branch right, while transition t4 was selected. TwinCAT automatically inserts a step (Step32 in the example), a preceding and a subsequent transition (t41, t42).
Processing in online mode: If Step3 is active, TwinCAT evaluates the following transitions (t4, t41) from left to right. The first junction of the branch in which the first transition returns TRUE is executed. In contrast to parallel branching, only one junction is executed.
See also:
- Command Alternative
- Command Parallel
- Command Insert Branch
- PLC documentation: Sequential Function Chart (SFC)
- PLC documentation: SFC Editor
- PLC documentation: SFC element Branch