Control Flow Operators
Note |
|---|
Only available in the block diagram editor for software components. |
The following control-flow operators are available:
The If…Then statement evaluates a logical expression and activates a control flow branch if the result is True. | |||
If…Then…Else is similar to If…Then, but has two control flow branches. Depending on the value of the logical expression, the left or right branch is executed, the right branch is executed if the value is True, the left one if it is False. | |||
| The only loop construct available in block diagrams is the While loop. Care has to be taken to avoid infinite loops or loops unsuitable for real-time applications. | ||
The Switch construct is similar to the Case operator. A Switch evaluates a signed discrete or unsigned discrete value and, depending on that value, activates different control flow branches. These branches are separated from each other, so that a “fall through” like in the switch construct in C is not possible. | |||
| The break operator in the software component editor behaves similar to a C language return statement. In a method, the break operator causes an immediate return from the method. The user is responsible for the correct setting of any return values before the break operator is executed. In a process, the break operator causes a deferred exit. Deferred exit means that all send messages are sent before the exit occurs.
|
See also

Details






