branch_by_msg

Description

When an external device sends a branch command to the adapter, the adapter calls this Task after processing the command, and runs the corresponding branch

This Task performs two functions in the program:

  • Run the corresponding branch process based on the data of the external device

  • Interrupt the running program, and continue to run when the external signal is received

Parameters

objectName

Since the adapter calls this Task by names, it is required to change the object name when using this Task

  • When running different branches, the names can be written as: branch_1, branch_2

  • If it is used for interruption, the names can be written as: interrupt_1, interrupt_2

BasicNonMove

See General Parameters of Non-Move Tasks

size

The number of output ports for this Task, for example, the size is 3, this Task has 3 output ports, which can be connected to three processes respectively; if this Task is used for interruption, set size to 1.

affectFutureMovement

True by default, interrupting the planning of subsequent logic in the software (when this Task is used to execute different branches, since it does not know which branch will be run in the future, it will definitely affect program planning);

If it is only used to interrupt and wait for external signals, the subsequent program logic will not change. This parameter can be set to False.

runInAdvanceOnPlanned

The default is False, the Task will not receive commands from external devices in advance; if True is checked, the commands sent by external devices can be temporarily stored. When the program is proceeded to this Task again, the temporary stored branch number will run directly to optimize the process.s