annotations
Control appearance of Simscape block based on the component
Parent Section: component
Syntax
annotations [Id1
,Id2
] : ExternalAccess=value
; UILayout = [UIGroup("Title 1
",p1
,p2
) UIGroup("Title 2
",p3
)] Icon = 'filename
'; [port1
,port2
] : Side=value
; [param1
,param2
] : UnitDropdown = common [var1
,int2
] : LoggingUnit = 'unit expression
' Faults = Fault(Name = 'FaultName
',Switch =logical_param
, ...) end
Description
annotations
begins the annotations section, which is terminated by
an end
keyword. A component file can have multiple
annotations
sections, with each section
containing one or more annotation declarations. However, component-level annotation,
such as UILayout
or
Faults
, can appear only once in a component
file.
These annotation types control various cosmetic aspects of a Simscape™ block generated from the component:
ExternalAccess
— Define conditional visibility of component members, such as parameters, variables, nodes, inputs, and outputs, in block icons and dialog boxes. Possible values are:modify
,observe
, andnone
.UILayout
— Specify block interface layout by defining titled groups of component parameters, the order of these groups, and the order of parameters in each group. When you deploy the component as a custom Simscape block, these groups translate into dialog box tabs (and into Property Inspector tree nodes).UILayout
is a component-level annotation, meaning that it can appear only once in a component file. For more information, see Group and Reorder Block Parameters Using Annotation.Icon
— Specify a custom block icon and change it based on the block variant.Side
— Control port location by placing it on a specific side of the block icon. Ports on a block icon correspond to nodes, inputs, and outputs declared in the underlying component file. Possible values are:left
,right
,top
, andbottom
.UnitDropdown
— Prepopulate a unit drop-down list for a parameter in the block dialog box with commonly used units. The only accepted value iscommon
.
These annotation types affect certain aspects of block functionality during simulation:
LoggingUnit
— Specify a preferred data logging unit for component members, such as intermediates, variables, inputs, and outputs. If specified, the same unit is also used for other display purposes, such as in the Variable Viewer or in the operating point.The specified logging unit must be commensurate with the intrinsic unit of the component member, such as the declared unit of a variable, typed input, or typed output. For intermediates and untyped inputs and outputs, the intrinsic unit is computed by the compiler.
Faults
— Categorize fault behavior and fault triggering information for your custom component. You model fault behavior and triggering logic by using other Simscape language constructs, such as parameters, equations, conditional assignments and expressions. The annotation provides the necessary information to the unified Faults interface, which lets you systematically model fault behaviors and trigger faults during simulation.Faults
is a component-level annotation, meaning that it can appear only once in a component file. For more information, see Fault Annotations.
Examples
Version History
Introduced in R2019a