Skip to main content

Command: Insert Branch Right

Symbol: _cds_icon_sfc_insert_branch_right.png

Function: The command inserts a branch to the right of the selected position.

Call: SFC menu

. The type of inserted branch depends on the selected element.
  • If the top element of the selected elements is a transition or an alternative branch, then CODESYS inserts an alternative branch.

  • If the top element of the selected elements is a step, a macro, a jump, or a parallel branch, then CODESYS inserts a parallel branch with the jump marker Branch<x>, where x is an incremental number. You can edit the default name of the jump marker. You can define the jump marker as a jump destination.

  • If a common element of an existing branch is currently selected (horizontal line), then CODESYS inserts the new branch line as a branch line on the far right. If an entire branch line of an existing branch is currently selected, then CODESYS inserts the new branch line directly to the right as a new branch line.

Tip

Note: You can convert a branch into another type by means of the Alternative and Parallel commands.

Example 8. Example: Parallel branch

The following image shows a new inserted parallel branch generated by the Insert Branch Right command while the Step11 step was selected. CODESYS automatically inserts a step (Step2 in the example).

Processing in online mode: If t2 yields TRUE, then CODESYS executes Step2 immediately after step11 and before t3 is passed.

Therefore, different from alternative branches, CODESYS processes both branch lines.

_cds_img_sfc_simultaneous_branch.png


Example 9. Example: Alternative branch

The following image shows a new inserted alternative branch generated by the Insert Branch Right command while the t4 transition was selected. CODESYS automatically inserts a step (Step32 in the example) and a preceding and subsequent transition (t41, t42).

Processing in online mode: If Step3 is active, then CODESYS passes the subsequent transitions (t4, t41) from left to right. The first branch line of the main branch with the first transition yielding TRUE is passed. Therefore, only one branch line is processed as opposed to with a parallel branch.

_cds_img_sfc_alternative_branch.png