set_tag & branch_by_tag¶
The scene for this combination is: when there is a common part in multiple logical branches, the common part is not required to be copied by multiple times, use set_tag to mark the current branch, merge it into the common part, and then use branch_by_tag module to restore the program running logic to the original branch.
The following figure is an example:
![../../../../_images/sample.png](../../../../_images/sample.png)
The three branches have common modules: move and relative_move. No matter which branch, they will proceed to the same position when completing the previous process. At this time, the same module can be selected, and set_tag modules are added to the branches to mark the current branch number. When the program finishes move and relative_move modules, branch_by_tag will restore the program running logic to the previously running branch according to the current identification.
Parameter settings
set_tag
![../../../../_images/set_tag_property.png](../../../../_images/set_tag_property.png)
Basic parameters for non-movement, see Other General Parameters
routePort: the ID of the current branch, used to restore the branch of the branch_by_tag module
branch_by_tag
![../../../../_images/branch_by_tag_property.png](../../../../_images/branch_by_tag_property.png)
Basic parameters for non-movement, see Other General Parameters
size: output ports of the branch_by_tag module, based on the total number of routePort