Signal Specification - Specify desired dimensions, sample time, data type, numeric type, and other attributes

        of signal - Simulink ([original](https://in.mathworks.com/help/simulink/slref/signalspecification.html)) ([raw](?raw))

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

Ports

Input

expand all

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

expand all

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

expand all

Specify the minimum value for the block output as a finite real double scalar value.

The software uses this value to perform:

Dependencies

The software ignores the value of this parameter when Data type specifies a Simulink.ValueType orSimulink.Bus object. The software uses the minimum values specified by the Simulink.ValueType object or theSimulink.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:

Dependencies

The software ignores the value of this parameter when Data type specifies a Simulink.ValueType orSimulink.Bus object. The software uses the maximum values specified by the Simulink.ValueType object or theSimulink.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 the Show data type assistant button. For more information, see Specify Data Types Using Data Type Assistant.

You can specify any of these options:

When you specify a Simulink.ValueType orSimulink.Bus object as the data type, some parameters of theSignal Specification block are ignored. For example, the Min,Max, and Unit parameters of theSignal 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 setsUnit 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: ' 'Bus: ' 'ValueType: ' 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.

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:

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 theSimulink.BusElement objects in the Simulink.Bus object instead.

Programmatic Use

Block Parameter: Unit
Type: character vector
Values: 'inherit' | ''
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.

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.

When the signal is a variable-size signal, the Dimensions parameter specifies the maximum dimensions of the signal.

Dependencies

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.

Dependencies

The software ignores the value of this parameter when Data type specifies a Simulink.ValueType orSimulink.Bus object. The software uses the complexity specified by the Simulink.ValueType object or theSimulink.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 Inherit enablesauto.

Built in

Built-in data types. Selecting Built in enables a list of possible values:

Fixed point

Fixed-point data types.

Enumerated

Enumerated data types. Selecting Enumerated enables a text box to the right, where you can enter a class name.

Bus object

Bus object. Selecting Bus object enables 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, clickEdit to the right of the text box.

Value type

Value type. Selecting Value type enables 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, clickEdit to the right of the text box.

Expression

Expressions that evaluate to data types. SelectingExpression enables 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.

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.

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 toFixed point.

Specify the method for scaling your fixed-point data to avoid overflow conditions and minimize quantization errors. For more information, seeSpecifying a Fixed-Point Data Type.

Dependencies

To enable this parameter, set Mode toFixed 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 toBinary point.

Specify slope for the fixed-point data type. For more information, seeSpecifying a Fixed-Point Data Type.

Dependencies

To enable this parameter, set Scaling toSlope 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 toSlope and bias.

Block Characteristics

Data Types Boolean | bus double enumerated fixed point half integer single string
Direct Feedthrough no
Multidimensional Signals yes
Variable-Size Signals yes
Zero-Crossing Detection no

Extended Capabilities

expand all

HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.

HDL Architecture

This block has a pass-through implementation.

HDL Block Properties

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 is0. For more details, see ConstrainedOutputPipeline (HDL Coder).
InputPipeline Number of input pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is0. For more details, see InputPipeline (HDL Coder).
OutputPipeline Number of output pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is0. For more details, see OutputPipeline (HDL Coder).

Complex Data Support

This block supports code generation for complex signals.

Version History

Introduced before R2006a