Common Block Parameters

About Common Block Parameters

This table lists the parameters common to all Simulink blocks, including block callback parameters (see Using Callback Functions). Examples of commands that change these parameters follow this table (see Examples of Setting Block Parameters).

Common Block Parameters

ParameterDescriptionValues

AncestorBlock

Name of the library block that the block is linked to (for blocks with a disabled link).

string

AttributesFormatString

String format specified for block annotations in the Block Parameters dialog box.

string

BackgroundColor

Block background color.

RGB value array string | [r,g,b,a] where r, g, b, and a are the red, green, blue, and alpha values of the color normalized to the range 0.0 to 1.0, delineated with commas. The alpha value is optional and ignored.

Block background color can also be 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'.

BlockDescription

Block description shown in the Block Properties dialog box.

string

BlockType

Block type (read only).

string

ClipboardFcn

Function called when block is copied to the clipboard (Ctrl+C) or when the menu item Copy is selected.

string

CloseFcn

Function called when close_system is run on block.

string

CompiledPortComplexSignals

Complexity of port signals after updating diagram. You must compile the model before querying this parameter. For example:

vdp([],[],[],'compile');
d = get_param(gcb,'CompiledPortDataTypes');
vdp([],[],[],'term');
structure array

CompiledPortDataTypes

Data types of port signals after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals.

structure array

CompiledPort
Dimensions

Dimensions of port signals after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals.

structure array

CompiledPortFrameData

Frame mode of port signals after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals.

structure array

CompiledPortWidths

Structure of port widths after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals.

structure array

CompiledSampleTime

Block sample time after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals.

vector [sample time, offset time]

CopyFcn

Function called when block is copied. See Block Callback Parameters in the Using Simulink documentation for details.

string

DataTypeOverrideCompiled

For internal use.

 

DeleteFcn

Function called when block is deleted. See Block Callback Parameters in the Using Simulink documentation for details.

MATLAB expression

DestroyFcn

Function called when block is destroyed. See Block Callback Parameters in the Using Simulink documentation for details.

MATLAB expression

Description

Description of block. Set by the Description field in the General pane of the Block Properties dialog box.

text and tokens

Diagnostics

For internal use.

 

DialogParameters

Names/attributes of parameters in block's parameter dialog box.

structure

DropShadow

Display drop shadow.

{'off'} | 'on'

ExtModeLoggingSupported

Enable a block to support uploading of signal data in external mode (for example, with a scope block).

{'off'} | 'on'

ExtModeLoggingTrig

Enable a block to act as the trigger block for external mode signal uploading.

{'off'} | 'on'

ExtModeUploadOptionEnable a block to upload signal data in external mode when the Select all check box on the External Signal & Triggering dialog box is not selected. A value of log indicates the block uploads signals. A value of none indicates the block does not upload signals. The value monitor is currently not in use. If the Select all check box on the External Signal & Triggering dialog box is selected, it overrides this parameter setting.{'none'} | 'log' | 'monitor'

FontAngle

Font angle.

'normal' | 'italic' | 'oblique' | {'auto'}

FontName

Font name.

string

FontSize

Font size. A value of -1 specifies that this block inherits the font size specified by the DefaultBlockFontSize model parameter.

real {'-1'}

FontWeight

Font weight.

'light' | 'normal' | 'demi' | 'bold' | {'auto'}

ForegroundColor

Foreground color of block's icon.

RGB value array string | [r,g,b,a] where r, g, b, and a are the red, green, blue, and alpha values of the color normalized to the range 0.0 to 1.0, delineated with commas. The alpha value is optional and ignored.

Block background color can also be 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'.

Handle

Block handle.

real

HiliteAncestors

For internal use.

 

InitFcn

Initialization function for a block. Created on the Callbacks pane of the Model Properties dialog box. See Creating Model Callback Functions in Simulink User's Guide for further information.

On non-masked blocks, updating the diagram or running the simulation call this function.

MATLAB expression

InputSignalNames

Names of input signals.

cell array

IOSignalStrings

Block paths to objects that are connected to the Signal & Scope Manager. Simulink software saves these paths when the model is saved.

list

IOType

Signal & Scope Manager type.

{'none'} | 'viewer' | 'siggen'

LineHandles

Handles of lines connected to block.

structure

LinkStatus

Link status of block. Updates out-of-date reference blocks when queried using get_param.

{'none'} | 'resolved' | 'unresolved' | 'implicit' | 'inactive' | 'restore' | 'propagate'

LoadFcn

Function called when block is loaded.

MATLAB expression

MinMaxOverflowLogging_Compiled

For internal use.

 

ModelCloseFcn

Function called when model is closed. The ModelCloseFcn is called prior to the block's DeleteFcn and DestroyFcn callbacks, if either are set.

MATLAB expression

ModelParamTableInfo

For internal use.

 

MoveFcn

Function called when block is moved.

MATLAB expression

Name

Block name.

string

NameChangeFcn

Function called when block name is changed.

MATLAB expression

NamePlacement

Position of block name.

{'normal'} | 'alternate'

ObjectParameters

Names/attributes of block's parameters.

structure

OpenFcn

Function called when this block's Block Parameters dialog box is opened.

MATLAB expression

Orientation

Where block faces.

{'right'} | 'left' | 'up' | 'down'

OutputSignalNames

Names of output signals.

cell array

Parent

Name of the system that owns the block.

string {'untitled'}

ParentCloseFcn

Function called when parent subsystem is closed. The ParentCloseFcn of blocks at the root model level is not called when the model is closed.

MATLAB expression

PortConnectivity

The value of this parameter is an array of structures, each of which describes one of the block's input or output ports. Each port structure has the following fields:

  • Type

    Specifies the port's type and/or number. The value of this field can be:

    • n, where n is the number of the port for data ports

    • 'enable' if the port is an enable port

    • 'trigger' if the port is a trigger port

    • 'state' for state ports

    • 'ifaction' for action ports

    • 'LConn#' for a left connection port where # is the port's number

    • 'RConn#' for a right connection port where # is the port's number

  • Position

    The value of this field is a two-element vector, [x y], that specifies the port's position.

  • SrcBlock

    Handle of the block connected to this port. This field is null for output ports and -1 for unconnected input ports.

  • SrcPort

    Number of the port connected to this port, starting at zero. This field is null for both output ports and unconnected input ports.

  • DstBlock

    Handle of the block to which this port is connected. This field is null for input ports and contains a 1-by-0 empty matrix for unconnected output ports.

  • DstPort

    Number of the port to which this port is connected, starting at zero. This field is null for input ports and contains a 1-by-0 empty matrix for unconnected output ports.

structure array

PortHandles

The value of this parameter is a structure that specifies the handles of the block's ports. The structure has the following fields:

  • Inport

    Handles of the block's input ports.

  • Outport

    Handles of the block's output ports.

  • Enable

    Handle of the block's enable port.

  • Trigger

    Handle of the block's trigger port.

  • State

    Handle of the block's state port.

  • LConn

    Handles of the block's left connection ports.

  • RConn

    Handles of the block's right connection ports.

  • Ifaction

    Handle of the block's action port.

structure array

Ports

The value of this parameter is a vector that specifies the numbers of each kind of port. The order of the vector's elements corresponds to the following port types:

  • Inport

  • Outport

  • Enable

  • Trigger

  • State

  • LConn

  • RConn

  • Ifaction

vector

Position

Position of block in model window.

vector [left top right bottom]
not enclosed in quotation marks. The maximum value for a coordinate is 32767.

PostSaveFcn

Function called after the block is saved.

MATLAB expression

PreCopyFcnFunction called before the block is copied. See Block Callback Parameters in the Using Simulink documentation for details. MATLAB expression
PreDeleteFcnFunction called before the block is deleted. See Block Callback Parameters in the Using Simulink documentation for details. MATLAB expression

PreSaveFcn

Function called before the block is saved. See Block Callback Parameters in the Using Simulink documentation for details.

MATLAB expression

Priority

Specifies the block's order of execution relative to other blocks in the same model. Set by the Priority field on the General pane of the Block Properties dialog box.

string {''}

ReferenceBlock

Name of the library block that this block is linked to.

string {''}

RequirementInfo

For internal use.

 

RTWData

User specified data, used by Real-Time Workshop software.

 

SampleTime

Value of the sample time parameter. See Specifying Sample Time in the Using Simulink documentation for more details.

string

Selected

Status of whether or not block is selected.

{'on'} | 'off'

ShowName

Display block name.

{'on'} | 'off'

StartFcn

Function called at the start of a simulation.

MATLAB expression

StatePerturbationForJacobian

State perturbation size to use during linearization. See Linearizing Individual Blocks Using Block Perturbation in the Simulink Control Design documentation for details.

string
StaticLinkStatusLink status of block. Does not update out-of-date reference blocks when queried using get_param.{'none'} | 'resolved' | 'unresolved' | 'implicit' | 'inactive' | 'restore' | 'propagate'

StopFcn

Function called at the termination of a simulation.

MATLAB expression

Tag

Text that appears in the block label that Simulink software generates. Set by the Tag field on the General pane of the Block Properties dialog box.

string {''}

Type

Simulink object type (read only).

'block'

UndoDeleteFcn

Function called when block deletion is undone.

MATLAB expression

UserData

User-specified data that can have any MATLAB data type.

{'[]'}

UserDataPersistent

Status of whether or not UserData will be saved in the model file.

'on' | {'off'}

Examples of Setting Block Parameters

These examples illustrate how to change common block parameters.

This command changes the orientation of the Gain block in the mymodel system so it faces the opposite direction (right to left).

set_param('mymodel/Gain','Orientation','left')

This command associates an OpenFcn callback with the Gain block in the mymodel system.

set_param('mymodel/Gain','OpenFcn','my_open_cb')

This command sets the Position parameter of the Gain block in the mymodel system. The block is 75 pixels wide by 25 pixels high. The position vector is not enclosed in quotation marks.

set_param('mymodel/Gain','Position',[50 250 125 275])
  


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