Signal Specification
Specify desired dimensions, sample time, data type, numeric type, and other attributes of signal
Libraries:
Simulink /
Signal Attributes
HDL Coder /
Signal Attributes
Description
The Signal Specification block allows you to specify the attributes of the signal connected to its input and output ports. If the specified attributes conflict with the attributes specified by the blocks connected to its ports, the software displays an error when it compiles the model. For example, at the beginning of a simulation, if no conflict exists, the software eliminates the Signal Specification block from the compiled model. In other words, the Signal Specification block is a virtual block. It exists only to specify the attributes of a signal and plays no role in the simulation of the model.
You can use the Signal Specification block to ensure that the actual attributes of a signal meet desired attributes. For example, suppose that you and a colleague are working on different parts of the same model. You use Signal Specification blocks to connect your part of the model with your colleague's. If your colleague changes the attributes of a signal without informing you, the attributes entering the corresponding Signal Specification block do not match. When you try to simulate the model, you get an error.
You can also use the Signal Specification block to ensure correct propagation of signal attributes throughout a model. However, if some blocks have unspecified attributes for the signals they accept or output, the model does not have enough information to propagate attributes correctly. In these cases, the Signal Specification block can provide the information the software needs. Using the Signal Specification block also helps speed up model compilation when blocks are missing signal attributes.
The Signal Specification block supports signal label propagation. For more information, see Signal Label Propagation.
Examples
Modeling Objects with Identical Dynamics Using For Each Subsystem
Model multiple objects with identical dynamics using the For Each subsystem. The number of objects is parameterized by the length of the input signal.
Ports
Input
Input signal whose attributes to check, specified as a scalar, vector, matrix, or N-D array. The block checks the attributes of the input signal against the desired attributes you specify in the block dialog box. If the attributes do not match, the block generates an error.
Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated | bus | image
Output
Output signal is the input signal when all attributes of the signal match those specified in the dialog box. If the attributes do not match, the block generates an error.
Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated | bus | image
Parameters
Specify the minimum value for the block output as a finite real double scalar value.
The software uses this value to perform:
Simulation range checking (see Specify Signal Ranges)
Automatic scaling of fixed-point data types
Dependencies
The software ignores the value of this parameter when Data
type specifies a Simulink.ValueType or
Simulink.Bus object. The software uses the minimum values specified
by the Simulink.ValueType object or the
Simulink.BusElement objects in the Simulink.Bus
object instead.
Programmatic Use
Block Parameter:
OutMin |
| Type: character vector |
| Values: scalar |
Default: '[
]' |
Specify the maximum value for the block output as a finite real double scalar value.
The software uses this value to perform:
Simulation range checking (see Specify Signal Ranges)
Automatic scaling of fixed-point data types
Dependencies
The software ignores the value of this parameter when Data
type specifies a Simulink.ValueType or
Simulink.Bus object. The software uses the maximum values specified
by the Simulink.ValueType object or the
Simulink.BusElement objects in the Simulink.Bus
object instead.
Programmatic Use
Block Parameter:
OutMax |
| Type: character vector |
| Values: scalar |
Default: '[
]' |
Specify the desired output data type. If the data type of the input signal does not match the value you specify, the block generates an error or warning.
The Data Type Assistant helps you set data
attributes. To use the Data Type Assistant, click
. For more information, see Specify Data Types Using Data Type Assistant.
You can specify any of these options:
Inherited data type
Built-in Simulink® data type — For example, specify
singleoruint8. See Data Types Supported by Simulink.Fixed-point data type — Use the
fixdtfunction. For example, specifyfixdt(1,16,0).Enumerated data type — Use the name of the type preceded by
Enum:. For example, specifyEnum: myEnumType.Bus data type — Use the name of the
Simulink.Busobject preceded byBus:. For example, specifyBus: myBusObject.Simulink image data type — If you have Computer Vision Toolbox™, use the constructor for the
Simulink.ImageType(Computer Vision Toolbox) object and specify the properties to describe the image. By default, the data type uses theSimulink.ImageType(480,640,3)expression that represents the rows, columns, and channels of the image respectively.Value type — Use the name of the
Simulink.ValueTypeobject preceded byValueType:. For example, specifyValueType: windVelocity.Custom data type — Use a MATLAB® expression that specifies the type. For example, you can specify a
Simulink.NumericTypeobject whoseDataTypeModeproperty is set to a value other than'Fixed-point: unspecified scaling'.
When you specify a Simulink.ValueType or
Simulink.Bus object as the data type, some parameters of the
Signal Specification block are ignored. For example, the Min,
Max, and Unit parameters of the
Signal Specification block are ignored. The software uses the corresponding properties of
the Simulink.ValueType object or the Simulink.BusElement objects
in the Simulink.Bus object instead. For example, suppose a block sets
Unit to ft/s. When the Data type of
the block specifies a ValueType object that has m/s as its
unit, the block uses m/s instead of ft/s.
Programmatic Use
Block Parameter:
OutDataTypeStr
|
| Type: character vector |
Value:
'Inherit: auto' | 'double' | 'single' | 'half' | 'int8' |
'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'int64' |
'uint64' | 'boolean' | 'fixdt(1,16,0)' | 'fixdt(1,16,2^0,0)' |
'string' | 'Enum: <class name>' | 'Bus: <object
name>' | 'ValueType: <object name>' | <data type
expression> | Simulink.ImageType(480,640,3)
|
Default:
'Inherit: auto'
|
Select this parameter to prevent the fixed-point tools from overriding the output data type you specify on the block. For more information, see Use Lock Output Data Type Setting (Fixed-Point Designer).
Dependencies
The software ignores the value of this parameter when Data type
specifies a Simulink.ValueType object.
Programmatic Use
Block Parameter:
LockScale |
Values: 'off' |
'on' |
Default: 'off' |
If you specify a bus object as the data type, use this parameter to specify whether to accept only nonvirtual bus signals.
off— Specifies that a signal must come from a virtual bus.on— Specifies that a signal must come from a nonvirtual bus.
Dependencies
To enable this parameter, the Data type block parameter must
resolve to a Simulink.Bus object.
Programmatic Use
Block Parameter:
BusOutputAsStruct
|
| Type: character vector |
Value:
'off' | 'on'
|
Default:
'off'
|
Specify the physical unit of the input signal to the block. To specify a unit, begin
typing in the text box. As you type, the parameter displays potential matching units.
For a list of supported units, use the showunitslist function.
To constrain the unit system, click the link to the right of the parameter:
If a Unit System Configuration block exists in the component, its dialog box opens. Use that dialog box to specify allowed and disallowed unit systems for the component.
If a Unit System Configuration block does not exist in the component, the model Configuration Parameters dialog box displays. Use that dialog box to specify allowed and disallowed unit systems for the model.
Dependencies
The software ignores the value of this parameter when Data type
specifies a Simulink.ValueType or Simulink.Bus object. The
software uses the units specified by the Simulink.ValueType object or the
Simulink.BusElement objects in the Simulink.Bus object
instead.
Programmatic Use
Block Parameter:
Unit
|
| Type: character vector |
Values:
'inherit' | '<Enter unit>'
|
Default:
'inherit'
|
To specify the physical unit of the input signal to the block
without propagation, use UnitNoProp.
Specify the dimensions of the input and output signals.
-1— Specifies that signals inherit dimensions.n— Specifies a vector of widthn.[m n]— Specifies a matrix withmrows andncolumns.
Dependencies
The software ignores the value of this parameter when Data
type specifies a Simulink.ValueType object. The
software uses the dimensions specified by the Simulink.ValueType
object instead.
Programmatic Use
Block Parameter:
Dimensions
|
| Type: character vector |
Values:
'-1' | n | [m
n]
|
Default:
'-1'
|
Specify the signal to be of variable-size, fixed size, or both.
Inherit— Allows variable-size and fixed-size signals.No— Does not allow variable-size signals.Yes— Allows only variable-size signals.
When the signal is a variable-size signal, the Dimensions parameter specifies the maximum dimensions of the signal.
Dependencies
When Data type specifies a
Simulink.Busobject, the simulation allows variable-size signals only with a disabled bus object.The software ignores the value of this parameter when Data type specifies a
Simulink.ValueTypeobject. The software uses the dimensions mode specified by theSimulink.ValueTypeobject instead.
Programmatic Use
Block Parameter:
VarSizeSig
|
| Type: character vector |
Values:
'Inherit' | 'No' |
'Yes'
|
Default:
'Inherit'
|
Specify the time interval between samples. To inherit the sample time, set
this parameter to -1. See Specify Sample Time for
more information.
Programmatic Use
Parameter:
SampleTime
|
| Type: character vector |
| Values: Any valid sample time |
Default:
'-1'
|
Specify the complexity of the input and output signals.
auto— Accepts eitherrealorcomplexas the numeric type.real— Specifies the numeric type as a real number.complex— Specifies the numeric type as a complex number.
Dependencies
The software ignores the value of this parameter when Data
type specifies a Simulink.ValueType or
Simulink.Bus object. The software uses the complexity specified by
the Simulink.ValueType object or the
Simulink.BusElement objects in the Simulink.Bus
object instead.
Programmatic Use
Parameter:
SignalType
|
| Type: character vector |
Values:
'auto' | 'real' |
'complex'
|
Default:
'auto'
|
Select the category of data to specify. For more information, see Specify Data Types Using Data Type Assistant.
-
Inherit Inheritance rules for data types. Selecting
Inheritenablesauto.-
Built in Built-in data types. Selecting
Built inenables a list of possible values:double(default)singleint8uint8int16uint16int32uint32int64uint64boolean
-
Fixed point Fixed-point data types.
-
Enumerated Enumerated data types. Selecting
Enumeratedenables a text box to the right, where you can enter a class name.-
Bus object Bus object. Selecting
Bus objectenables a text box to the right, where you enter the name of a bus object that you want to use to define the structure of the bus. To create or change a bus object, click Edit to the right of the text box.-
Value type Value type. Selecting
Value typeenables a text box to the right, where you enter the name of a value type that you want to use to define the properties of the signal. To create or change a value type, click Edit to the right of the text box.-
Expression Expressions that evaluate to data types. Selecting
Expressionenables a text box to the right, where you can enter the expression.Do not specify a bus object as the expression.
Dependencies
To enable this parameter, click the Show data type assistant
button
.
Specify whether the fixed-point data is signed or unsigned. Signed data can represent positive and negative values, but unsigned data represents positive values only.
Signed, specifies the fixed-point data as signed.Unsigned, specifies the fixed-point data as unsigned.
For more information, see Specify Data Types Using Data Type Assistant.
Dependencies
To enable this parameter, set Mode to Fixed
point.
Select the data type override mode for this signal.
When you select
Inherit, Simulink inherits the data type override setting from its context, that is, from the block,Simulink.Signalobject or Stateflow® chart in Simulink that is using the signal.When you select
Off, Simulink ignores the data type override setting of its context and uses the fixed-point data type specified for the signal.
For more information, see Specify Data Types Using Data Type Assistant in the Simulink documentation.
Dependencies
To enable this parameter, set Mode to Built
in or Fixed point.
Tips
The ability to turn off data type override for an individual data type provides greater control over the data types in your model when you apply data type override. For example, you can use this option to ensure that data types meet the requirements of downstream blocks regardless of the data type override setting.
Specify the bit size of the word that holds the quantized integer. For more information, see Specifying a Fixed-Point Data Type.
Dependencies
To enable this parameter, set Mode to
Fixed point.
Specify the method for scaling your fixed-point data to avoid overflow conditions and minimize quantization errors. For more information, see Specifying a Fixed-Point Data Type.
Dependencies
To enable this parameter, set Mode to
Fixed point.
Specify fraction length for fixed-point data type as a positive or negative integer. For more information, see Specifying a Fixed-Point Data Type.
Dependencies
To enable this parameter, set Scaling to
Binary point.
Specify slope for the fixed-point data type. For more information, see Specifying a Fixed-Point Data Type.
Dependencies
To enable this parameter, set Scaling to
Slope and bias.
Specify bias for the fixed-point data type as any real number. For more information, see Specifying a Fixed-Point Data Type.
Dependencies
To enable this parameter, set Scaling to
Slope and bias.
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has a pass-through implementation.
| ConstrainedOutputPipeline | Number of registers to place at
the outputs by moving existing delays within your design. Distributed
pipelining does not redistribute these registers. The default is
|
| InputPipeline | Number of input pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
| OutputPipeline | Number of output pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
This block supports code generation for complex signals.
Simulink.ValueType Object SupportThis block supports code generation for Simulink.ValueType object. For
more information about value types, see Specify Common Set of Signal Properties as Value Type.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
