Add event port to a subsystem block
Ports & Subsystems
Add event port to a Subsystem block.
Event type
— Select event type for subsystemInitialize
(default) | Terminate
| Reset
Select event type for subsystem to execute initialize, reset, or terminate algorithms.
Initialize
Select to trigger the execution of an Initialize Function block with an initialize event.
Terminate
Select to trigger the execution of a Terminate Function block with a terminate event.
Reset
Select to trigger the execution of an Initialize Function block reconfigured as a Reset Function block with a reset event.
Block Parameter:
EventType |
Type: character vector |
Value:
'Initialize' | 'Terminate' |
'Reset' |
Default:
'Initialize' |
Event name
— Specify event nameReset
(default) | event nameSpecify event name for Reset Function block
Reset
Default name on the face of the Reset Function block.
User entered name displayed on the face of the Reset Function block, and the name of the reset event port on the Model block containing the Reset Function block.
When tying the name for a reset function, the auto-completion list provides some suggestions. The list is not complete.
To enable this parameter, set the Event parameter
to Reset
.
Block Parameter:
EventName |
Type: character vector |
Value:
'reset' | '<event
name>' |
Default:
'reset' |
Enable variant condition
— Control activating the variant control (condition)Control activating the variant control (condition) defined with the Variant Control parameter.
Deactivate variant control of subsystem.
Activate variant control of subsystem.
Selecting this parameter, enables the Variant control and Generate preprocessor conditionals parameters.
When you select Enable variant condition parameter, the badge indicates the change.
Block Parameter:
Variant |
Type: character vector |
Value:
'off' | 'on' |
Default:
'off' |
Note
The Reset event port of a Model block can be conditional and propagates the net Variant conditions defined on the corresponding Reset Function block(s) in the referenced model.
Initialize and Terminate event ports are always unconditional because they control both the model default and block-specific initialize and terminate events of the referenced model. If you define an Initialize function block in the referenced model, it corresponds to an explicit initialize event.
Variant control
— Specify variant control (condition) expressionVariant
(default) | logical expressionSpecify variant control (condition) expression that executes a variant
Initialize function, Reset function, or
Terminate function block when the expression evaluates to
true
.
Variant
Default name for a logical (Boolean) expression.
A logical (Boolean) expression or a
Simulink.Variant
object representing a
boolean expression.
If you want to generate code for your model, define the
variables in the expression as
Simulink.Parameter
objects.
To enable this parameter, select the Enable variant condition parameter.
Block Parameter:
VariantControl |
Type: character vector |
Value:
'Variant' | '<logical
expression>' |
Default:
'Variant' |
Generate preprocessor conditionals
— Select if variant choices are enclosed within C preprocessor conditional statementsSelect if variant choices are enclosed within C preprocessor conditional statements.
Does not enclose variant choices within C preprocessor conditional statements.
When generating code for an ERT target, encloses variant choices within C preprocessor conditional statements (#if).
To enable this parameter, select the Enable variant condition parameter.
When you select Generate preprocessor conditionals parameter, the badge indicates the change.
Block Parameter:
GeneratePreprocessorConditionals |
Type: character vector |
Value:
'off' | 'on' |
Default:
'off' |