Using Simulink    

Block Properties Dialog Box

This dialog box lets you set a block's properties. To display this dialog, select the block in the model window and then select Block Properties from the Edit menu.

The dialog box contains the following tabbed panes.

General Pane

This pane allows you to set the following properties.

Description.   Brief description of the block's purpose.

Priority.   Execution priority of this block relative to other blocks in the model. See Assigning Block Priorities for more information.

Tag.   Text that is assigned to the block's Tag parameter and saved with the block in the model. You can the tag to create your own block-specific label for a block.

Block Annotation Pane

The block annotation pane allows you to display the values of selected parameters of a block in an annotation that appears beneath the block's icon.

Enter the text of the annotation in the text field that appears on the right side of the pane. The text can include block property tokens, for example

of the form %<param> where param is the name of a parameter of the block. When displaying the annotation, Simulink replaces the tokens with the values of the corrresponding parameters, e.g.,

The block property tag list on the left side of the pane lists all the tags that are valid for the currently selected block. To include one of the listed tags in the annotation, select the tag and then click the button between the tag list and the annotation field.

You can also create block annotations programmatically. See Creating Block Annotations Programmatically.

Callbacks Pane

The Callbacks Pane allows you to specify implementations for a block's callbacks (see Using Callback Routines).

To specify an implementation for a callback, select the callback in the callback list on the left side of the pane. Then enter MATLAB commands that implement the callback in the righthand field. Click OK or Append to save the change. Simulink appends an asterisk to the name of the saved callback to indicate that it has been implemented.

Creating Block Annotations Programmatically

You can use a block's AttributesFormatString parameter to display selected parameters of a block beneath the block as an "attributes format string," i.e. a string that specifies values of the block's attributes (parameters). The Model and Block Parameters section in the online Simulink reference describes the parameters that a block can have. Use Simulink's set_param command to set this parameter to the desired attributes format string.

The attributes format string can be any text string that has embedded parameter names. An embedded parameter name is a parameter name preceded by %< and followed by >, for example, %<priority>. Simulink displays the attributes format string beneath the block's icon, replacing each parameter name with the corresponding parameter value. You can use line-feed characters (\n) to display each parameter on a separate line. For example, specifying the attributes format string

for a Gain block displays

If a parameter's value is not a string or an integer, Simulink displays N/S (not supported) for the parameter's value. If the parameter name is invalid, Simulink displays "???" as the parameter value.

State Properties Dialog Box

The State Properties dialog box allows you to specify code generation options for certain blocks with discrete states. To get help on using this dialog box, you must install the Real-Time Workshop documentation. See Block States: Storing and Interfacing in the online documentation for The Real-Time Workshop for more information.


  Setting Block Parameters Changing a Block's Appearance