Skip to Main Content Skip to Search
Product Documentation

Block Properties Dialog Box

The Block Properties 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 use 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 block parameters 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 any of the block property tokens that appear in the list on the left side of the pane. A block property token is simply the name of a block parameter preceded by %< and followed by >. When displaying the annotation, the Simulink software replaces the tokens with the values of the corresponding block parameters. For example, suppose that you enter the following text and tokens for a Product block:

Multiplication = %<Multiplication>
Sample time = %<SampleTime>

In the model editor window, the annotation appears as follows:

The block property token list on the left side of the pane lists all the parameters that are valid for the currently selected block (see Model and Block Parameters in the Simulink Reference). To add one of the listed tokens to the text field on the right side of the pane, select the token and then click the button between the list and the text 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 Functions).

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 right-hand field. Click OK or Apply 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 block parameters beneath the block as an "attributes format string," i.e., a string that specifies values of the block's attributes (parameters). Model and Block Parameters in Simulink Reference describes the parameters that a block can have. Use the Simulink set_param function 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

pri=%<priority>\ngain=%<Gain>

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.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS