Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
slref.pdf
Скачиваний:
39
Добавлен:
26.03.2015
Размер:
16.01 Mб
Скачать

8 Model and Block Parameters

Common Block Parameters

In this section...

“About Common Block Parameters” on page 8-96 “Examples of Setting Block Parameters” on page 8-107

About Common Block Parameters

This table lists the parameters common to all Simulink blocks, including block callback parameters (see “Callback Functions”). Examples of commands that change these parameters follow this table (see “Examples of Setting Block Parameters” on page 8-107).

Common Block Parameters

 

Parameter

Description

Values

 

 

AncestorBlock

Name of the library block

string

 

 

 

that the block is linked to (for

 

 

 

 

blocks with a disabled link).

 

 

 

AttributesFormatString

String format specified for

string

 

 

 

block annotations in the Block

 

 

 

 

Parameters dialog box.

 

 

 

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. The alpha value is

 

 

 

 

ignored.

 

 

BlockDescription

Block description shown in the

string

 

 

 

Block Properties dialog box.

 

 

 

BlockType

Block type (read only).

string

 

 

 

 

 

 

8-96

Common Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

ClipboardFcn

Function called when block

string

 

 

 

is copied to the clipboard

 

 

 

 

(Ctrl+C)

 

 

 

CloseFcn

Function called when

string

 

 

 

close_system is run on

 

 

 

 

block.

 

 

 

CompiledPort-

Complexity of port signals

structure array

 

 

ComplexSignals

after updating diagram.

 

 

 

CompiledPortDataTypes

Data types of port signals after

structure array

 

 

 

updating diagram.

 

 

 

CompiledPortDimensions

Dimensions of port signals

structure array

 

 

 

after updating diagram.

 

 

 

CompiledPortFrameData

Frame mode of port signals

structure array

 

 

 

after updating diagram.

 

 

 

CompiledPortWidths

Structure of port widths after

structure array

 

 

 

updating diagram.

 

 

 

CompiledSampleTime

Block sample time after

vector [sample time, offset

 

 

 

updating diagram.

time]

 

 

CopyFcn

Function called when block is

string

 

 

 

copied.

 

 

 

DataTypeOverrideCompiled

For internal use.

 

 

 

 

 

 

 

8-97

8 Model and Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

DeleteFcn

Function called when block

MATLAB expression

 

 

 

is deleted. If a block

 

 

 

 

is graphically deleted,

 

 

 

 

you can still undo the

 

 

 

 

operation and call the block’s

 

 

 

 

UndoDeleteFcn. In addition,

 

 

 

 

for graphically deleted blocks,

 

 

 

 

the block’s DestroyFcn is still

 

 

 

 

called when the model is closed

 

 

 

 

or any subsystem containing

 

 

 

 

the block is destroyed using

 

 

 

 

delete_block.

 

 

 

DestroyFcn

Function called when block

MATLAB expression

 

 

 

is destroyed. If you run the

 

 

 

 

delete_block command

 

 

 

 

for a block, it first calls the

 

 

 

 

block’sDeleteFcn, then calls

 

 

 

 

the DestroyFcn for that block;

 

 

 

 

no undo is possible. The

 

 

 

 

DestroyFcn is also called

 

 

 

 

when you close the model

 

 

 

 

or invoke delete_block on

 

 

 

 

a subsystem containing the

 

 

 

 

block.

 

 

 

Description

Description of block. Set by

text and tokens

 

 

 

the Description field in the

 

 

 

 

General pane of the Block

 

 

 

 

Properties dialog box.

 

 

 

Diagnostics

For internal use.

 

 

 

DialogParameters

Names/attributes of

structure

 

 

 

parameters in block’s

 

 

 

 

parameter dialog box.

 

 

 

DropShadow

Display drop shadow.

{'off'} | 'on'

 

 

 

 

 

 

8-98

Common Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

ExtModeLoggingSupported

Enable a block to support

{'off'} | 'on'

 

 

 

uploading of signal data in

 

 

 

 

external mode (for example,

 

 

 

 

with a scope block).

 

 

 

ExtModeLoggingTrig

Enable a block to act as the

{'off'} | 'on'

 

 

 

trigger block for external mode

 

 

 

 

signal uploading.

 

 

 

ExtModeUploadOption

Enable a block to upload signal

{'none'} | 'log' |

 

 

 

data in external mode when

'monitor'

 

 

 

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.

 

 

 

FontAngle

Font angle.

'normal' | 'italic' |

 

 

 

 

'oblique' | {'auto'}

 

 

FontName

Font.

string

 

 

FontSize

Font size. A value of -1

real {'-1'}

 

 

 

specifies that this block

 

 

 

 

inherits the font size specified

 

 

 

 

by the DefaultBlockFontSize

 

 

 

 

model parameter.

 

 

 

FontWeight

Font weight.

'light' | 'normal'

 

 

 

 

| 'demi' | 'bold' |

 

 

 

 

{'auto'}

 

 

 

 

 

 

8-99

8 Model and Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

ForegroundColor

Foreground color of block’s

string {'black'} |

 

 

 

icon.

[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. The alpha value is

 

 

 

 

ignored.

 

 

Handle

Block handle.

real

 

 

HiliteAncestors

For internal use.

 

 

 

InitFcn

Initialization function for a

MATLAB expression

 

 

 

masked block. Created on

 

 

 

 

the Callbacks pane of the

 

 

 

 

Model Properties dialog box.

 

 

 

 

See “Create Model Callback

 

 

 

 

Functions” in the Using

 

 

 

 

Simulink documentation for

 

 

 

 

further information.

 

 

 

InputSignalNames

Names of input signals.

cell array

 

 

IOSignalStrings

 

list

 

 

IOType

Signal & Scope Manager type.

 

 

 

 

For internal use.

 

 

 

LineHandles

Handles of lines connected to

struct

 

 

 

block.

 

 

 

LinkStatus

Link status of block.

{'none'} | 'resolved' |

 

 

 

Updates out-of-date reference

'unresolved' | 'implicit'

 

 

 

blocks when queried using

| 'inactive' | 'restore'

 

 

 

get_param.

| 'propagate'

 

 

LoadFcn

Function called when block is

MATLAB expression

 

 

 

loaded.

 

 

 

MinMaxOverflow-

For internal use.

 

 

 

Logging_Compiled

 

 

 

 

 

 

 

 

8-100

Common Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

ModelCloseFcn

Function called when model

MATLAB expression

 

 

 

is closed. The ModelCloseFcn

 

 

 

 

is called prior to the block’s

 

 

 

 

DeleteFcn and DestroyFcn

 

 

 

 

callbacks, if either are set.

 

 

 

ModelParamTableInfo

For internal use.

 

 

 

MoveFcn

Function called when block is

MATLAB expression

 

 

 

moved.

 

 

 

Name

Block name.

string

 

 

NameChangeFcn

Function called when block

MATLAB expression

 

 

 

name is changed.

 

 

 

NamePlacement

Position of block name.

{'normal'} | 'alternate'

 

 

ObjectParameters

Names/attributes of block’s

structure

 

 

 

parameters.

 

 

 

OpenFcn

Function called when this

MATLAB expression

 

 

 

Block Parameters dialog box

 

 

 

 

opens.

 

 

 

Orientation

Where block faces.

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

 

 

 

 

| 'down'

 

 

OutputSignalNames

Names of output signals.

cell array

 

 

Parent

Name of the system that owns

string {'untitled'}

 

 

 

the block.

 

 

 

ParentCloseFcn

Function called when parent

MATLAB expression

 

 

 

subsystem is closed. The

 

 

 

 

ParentCloseFcn of blocks

 

 

 

 

at the root model level is

 

 

 

 

not called when the model is

 

 

 

 

closed.

 

 

8-101

8 Model and Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

PortConnectivity

The value of this parameter

structure array

 

 

 

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.

 

 

8-102

Common Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

 

SrcBlock

 

 

 

 

Handle of the block

 

 

 

 

connected to this port.

 

 

 

 

This field is null for output

 

 

 

 

ports.

 

 

 

 

SrcPort

 

 

 

 

Number of the port

 

 

 

 

connected to this port.

 

 

 

 

This field is null for output

 

 

 

 

ports.

 

 

 

 

DstBlock

 

 

 

 

Handle of the block to which

 

 

 

 

this port is connected. This

 

 

 

 

field is null for input ports.

 

 

 

 

DstPort

 

 

 

 

Number of the port to which

 

 

 

 

this port is connected. This

 

 

 

 

field is null for input ports.

 

 

 

PortHandles

The value of this parameter

structure array

 

 

 

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.

 

 

 

 

 

 

 

8-103

8 Model and Block Parameters

Common Block Parameters (Continued)

Parameter

Description

Values

 

 

 

 

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.

 

Ports

The value of this parameter

vector

 

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

 

 

 

 

8-104

Common Block Parameters

Common Block Parameters (Continued)

Parameter

Description

 

Values

 

 

 

 

 

 

Trigger

 

 

 

 

State

 

 

 

 

LConn

 

 

 

 

RConn

 

 

 

 

Ifaction

 

 

 

Position

Position of block in model

 

vector of coordinates (in pixels)

 

window.

 

not enclosed in quotation

 

 

 

marks: [left top right

 

 

 

bottom]

 

 

 

 

 

 

 

 

Note The origin is located in

 

 

 

the upper left corner of the

 

 

 

model window. The maximum

 

 

 

value for a coordinate is 32767.

 

 

 

 

 

PostSaveFcn

Function called after the

 

MATLAB expression

 

block is saved. Created on

 

 

 

 

the Callbacks pane of the

 

 

 

 

Model Properties dialog box.

 

 

 

 

See “Create Model Callback

 

 

 

 

Functions” in the Using

 

 

 

 

Simulink documentation for

 

 

 

 

further information.

 

 

 

PreCopyFcn

Function called before

 

MATLAB expression

 

the block is copied. See

 

 

 

 

“Block Callback Parameters”

 

 

 

 

in the Using Simulink

 

 

 

 

documentation for details.

 

 

 

8-105

8 Model and Block Parameters

Common Block Parameters (Continued)

 

Parameter

Description

Values

 

 

PreDeleteFcn

Function called before

MATLAB expression

 

 

 

the block is deleted. See

 

 

 

 

“Block Callback Parameters”

 

 

 

 

in the Using Simulink

 

 

 

 

documentation for details.

 

 

 

PreSaveFcn

Function called before the

MATLAB expression

 

 

 

block is saved.

 

 

 

Priority

Specifies the block’s order of

string {''}

 

 

 

execution relative to other

 

 

 

 

blocks in the same model. Set

 

 

 

 

by the Priority field on the

 

 

 

 

General pane of the Block

 

 

 

 

Properties dialog box.

 

 

 

ReferenceBlock

Name of the library block to

string {''}

 

 

 

which this block links.

 

 

 

 

 

 

 

 

RequirementInfo

For internal use.

 

 

 

RTWData

User specified data, used by

 

 

 

 

Simulink Coder software.

 

 

 

SampleTime

Value of the sample time

string

 

 

 

parameter.

 

 

 

Selected

Status of whether or not block

{'on'} | 'off'

 

 

 

is selected.

 

 

 

ShowName

Display block name.

{'on'} | 'off'

 

 

StartFcn

Function called at the start of

MATLAB expression

 

 

 

a simulation.

 

 

8-106

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]