If
Subsystem selection by if-else condition.
Description
The If block implements the if-else logic to control the execution of the subsystem.
Restrictions
The If block has the following restrictions:
-
The block does not support on-the-fly adjustable parameters. Values for If expressions and Elseif expressions parameters cannot be configured during simulation in normal or accelerator mode, or during execution of generated code.
-
To implement on-the-fly configurable if-else expressions, configure the expression outside the If block. For example, use the Relational Operator block to evaluate an expression outside the If block, or add a customisable parameter as input to the If block.
Ports
Parameters
Number of inputs - number of input ports
1 (by default)
| <integer number>
-
1
- one input port. -
` integer` - number of input ports. The block ports are labelled with the symbol 'u' followed by a number: 1,2,…,n, where n is equal to the number of specified inputs.
Block parameter |
|
Values |
|
By default |
|
If expression is a logical if expression.
u1 > 0 (By default)
| <логическое выражение>
Blocks connected to the if port are executed when the expression associated with the port takes the value true (1)
.
-
u1 > 0
- Sends an action signal to the output port if the input value on port u1 is greater than0
. -
<логическое выражение>`
- logical expression. This expression is displayed on the block icon next to the if output port.
Block parameter |
|
Values |
'u1 > 0' | '<логическое выражение>' |
By default |
'u1 > 0' |
Elseif expressions - logical expression elseif
' ' (By default)
| <список логических выражений>
Blocks connected to the elseif port are executed if the expression associated with the port takes the value true (1)
and all if and else expressions take the value false (0)
.
-
' '`
- logical expressions are not specified. -
<список логических выражений>
- comma-separated list of logical expressions. Expressions appear on the block icon under the if port.
Block parameter |
|
Values |
|
By default |
|
Show else condition - port display control else
on (By default)
| off
If the expression on port if and all expressions on port elseif are false, port else sends a signal to execute the connected blocks.
-
enabled
- port else is displayed on the block icon. -
disabled
- the else port is hidden.
Block parameter |
|
Values |
|
By default |
|
Enable zero-crossing detection - managing the definition of zero crossing
включено (by default)
| выключено
Managing the definition of zero crossing.
-
включено
- define zero crossings. -
выключено
- do not define zero crossings.
Block parameter |
|
Value |
|
By default |
|