Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Signal Specification

Specify desired dimensions, sample time, data type, numeric type, and other attributes of signal

Library

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, Simulink® software displays an error when it compiles the model. For example, at the beginning of a simulation, if no conflict exists, Simulink 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. The capability of allowing the Simulink to propagate attributes from block to block is powerful. 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. For these cases, the Signal Specification block is a good way of providing the information Simulink 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.

Data Type Support

The Signal Specification block accepts real or complex signals of any data type that Simulink supports, including fixed-point and enumerated data types, as well as bus objects. The input data type must match the data type specified by the Data type parameter.

    Note:   If you specify a bus object as the data type for this block, do not set the minimum and maximum values for bus data on the block. Simulink ignores these settings. Instead, set the minimum and maximum values for bus elements of the bus object specified as the data type. The values should be finite real double scalar.

    For information on the Minimum and Maximum properties of a bus element, see Simulink.BusElement.

For more information, see Data Types Supported by Simulink.

Parameters and Dialog Box

Minimum

Specify the minimum value for the block output.

Settings

Default: [] (unspecified)

This number must be a finite real double scalar value.

    Note:   If you specify a bus object as the data type for this block, do not set the minimum value for bus data on the block. Simulink ignores this setting. Instead, set the minimum values for bus elements of the bus object specified as the data type. For information on the Minimum property of a bus element, see Simulink.BusElement.

Simulink uses this value to perform:

  • Simulation range checking (see Signal Ranges)

  • Automatic scaling of fixed-point data types

Command-Line Information

Parameter: OutMin
Type: string
Value: Any valid finite real double scalar value
Default: '[]'

Maximum

Specify the maximum value for the block output.

Settings

Default:[] (unspecified)

This number must be a finite real double scalar value.

    Note:   If you specify a bus object as the data type for this block, do not set the maximum value for bus data on the block. Simulink ignores this setting. Instead, set the maximum values for bus elements of the bus object specified as the data type. For information on the Maximum property of a bus element, see Simulink.BusElement.

Simulink uses this value to perform:

  • Simulation range checking (see Signal Ranges)

  • Automatic scaling of fixed-point data types

Command-Line Information

Parameter: OutMax
Type: string
Value: Any valid finite real double scalar value
Default: '[]'

Data type

Specify the output data type.

Settings

Default: auto

Inherit: auto

Inherits the data type.

double

Specifies the data type is double.

single

Specifies the data type is single.

int8

Specifies the data type is int8.

uint8

Specifies the data type is uint8.

int16

Specifies the data type is int16.

uint16

Specifies the data type is uint16.

int32

Specifies the data type is int32.

uint32

Specifies the data type is uint32.

boolean

Specifies the data type is boolean.

fixdt(1,16,0)

Specifies the data type is fixed point fixdt(1,16,0).

fixdt(1,16,2^0,0)

Specifies the data type is fixed point fixdt(1,16,2^0,0).

Enum: <class name>

Specifies the data type as enumerated.

Bus: <object name>

Data type is a bus object.

<data type expression>

The name of a data type object, for example Simulink.NumericType

Do not specify a bus object as the expression.

Dependency

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Data type parameters.

Command-Line Information

Parameter: OutDataTypeStr
Type: string
Value: 'Inherit: auto' | 'double' | 'single' | 'int8' | 'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'boolean' | 'fixdt(1,16,0)' | 'fixdt(1,16,2^0,0)' | 'Enum: <class name>' | 'Bus: <object name>' | <data type expression>
Default: 'Inherit: auto'

See Also

Specify Block Output Data Types.

Show data type assistant

Display the Data Type Assistant.

Settings

The Data Type Assistant helps you set the Output data type parameter.

For more information, see Specify Block Output Data Types.

Mode

Select the category of data to specify.

Settings

Default: Inherit

Inherit

Specifies inheritance rules for data types. Selecting Inherit enables auto.

Built in

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

  • double (default)

  • single

  • int8

  • uint8

  • int16

  • uint16

  • int32

  • uint32

  • boolean

Fixed point

Specifies fixed-point data types.

Enumerated

Specifies enumerated data types. Selecting Enumerated enables you to enter a class name.

Bus

Bus object. Selecting Bus enables a Bus object parameter to the right, where you enter the name of a bus object that you want to use to define the structure of the bus. If you need to create or change a bus object, click Edit to the right of the Bus object field to open the Simulink Bus Editor. For details about the Bus Editor, see Manage Bus Objects with the Bus Editor.

Expression

Expressions that evaluate to data types. Selecting Expression enables a second menu/text box to the right, where you can enter the expression.

Do not specify a bus object as the expression.

Dependency

Clicking the Show data type assistant button enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

Specify Data Types Using Data Type Assistant.

Data type override

Specify data type override mode for this signal.

Settings

Default: Inherit

Inherit

Inherits the data type override setting from its context, that is, from the block, Simulink.Signal object or Stateflow® chart in Simulink that is using the signal.

Off

Ignores the data type override setting of its context and uses the fixed-point data type specified for the signal.

Tip

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.

Dependency

This parameter appears only when the Mode is Built in or Fixed point.

Signedness

Specify whether you want the fixed-point data signed or unsigned.

Settings

Default: Signed

Signed

Specifies fixed-point data as signed.

Unsigned

Specifies the fixed-point data as unsigned.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

Specifying a Fixed-Point Data Type.

Word length

Specify the bit size of the word that holds the quantized integer.

Settings

Default: 16

Minimum: 0

Maximum: 32

Large word sizes represent large values with greater precision than small word sizes.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

Specifying a Fixed-Point Data Type.

Scaling

Specify the method for scaling your fixed-point data to avoid overflow conditions and minimize quantization errors.

Settings

Default: Best precision

Binary point

Specify binary point location.

Slope and bias

Enter slope and bias.

Best precision

Specify best-precision values.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Selecting Binary point enables:

  • Fraction length

  • Calculate Best-Precision Scaling

Selecting Slope and bias enables:

  • Slope

  • Bias

  • Calculate Best-Precision Scaling

See Also

For more information, see Specifying a Fixed-Point Data Type.

Fraction length

Specify fraction length for fixed-point data type.

Settings

Default: 0

Binary points can be positive or negative integers.

Dependencies

Selecting Scaling > Binary point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

Specifying a Fixed-Point Data Type.

Slope

Specify slope for the fixed-point data type.

Settings

Default: 2^0

Specify any positive real number.

Dependencies

Selecting Scaling > Slope and bias enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

Specifying a Fixed-Point Data Type.

Bias

Specify bias for the fixed-point data type.

Dependencies

Selecting Scaling > Slope and bias enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

Specifying a Fixed-Point Data Type.

Require nonvirtual bus

If you specify a bus object as the data type, use this parameter to specify whether to accept only nonvirtual bus signals.

Settings

Default: off

Off

Specifies that a signal must come from a virtual bus.

On

Specifies that a signal must come from a nonvirtual bus.

Dependencies

The following Data type values enable this parameter:

  • Bus: <object name>

  • <data type expression> that specifies a bus object

Command-Line Information

Parameter: BusOutputAsStruct
Type: string
Value: 'off' | 'on'
Default: '-1off'

Lock output data type setting against changes by the fixed-point tools

Select to lock the output data type setting of this block against changes by the Fixed-Point Tool and the Fixed-Point Advisor.

Settings

Default: Off

On

Locks the output data type setting for this block.

Off

Allows the Fixed-Point Tool and the Fixed-Point Advisor to change the output data type setting for this block.

Command-Line Information

Parameter: LockScale
Type: string
Value: 'off' | 'on'
Default: 'off'

See Also

For more information, see Use Lock Output Data Type Setting.

Dimensions (-1 for inherited)

Specify the dimensions of the input and output signals.

Settings

Default: -1

-1

Specifies that signals inherit dimensions.

n

Specifies vector signal of width n.

[m n]

Specifies matrix signal having m rows and n columns.

Command-Line Information

Parameter: Dimensions
Type: string
Value: '-1' | n | [m n]
Default: '-1'

Variable-size signal

Specify a variable-size signal, fixed-size signal, or both.

Settings

Default: Inherit

Inherit

Allows variable-size and fixed-size signals.

No

Does not allow variable-size signals.

Yes

Allows only variable-size signals.

Dependencies

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

If you specify a bus object, the simulation allows variable-size signals only with a disabled bus object.

Command-Line Information

Parameter: VarSizeSig
Type: string
Value: 'Inherit' | 'No' | 'Yes'
Default: 'Inherit'

See Also

Variable-Size Signal Basics

Sample time (-1 for inherited)

Specify the time interval when simulation updates the block.

Settings

Default: -1

Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See Specify Sample Time for more information.

Command-Line Information

Parameter: SampleTime
Type: string
Value: Any valid sample time
Default: '-1'

See Also

Specify Sample Time

Signal type

Specify the numeric type of the input and output signals.

Settings

Default: auto

auto

Accepts either real or complex as the numeric type.

real

Specifies the numeric type as a real number.

complex

Specifies the numeric type as a complex number.

Command-Line Information

Parameter: SignalType
Type: string
Value: 'auto' | 'real' | 'complex'
Default: 'auto'

Sampling mode

Select the sampling mode for this block.

Settings

Default: auto

auto

Accepts any sampling mode.

Sample based

Specifies the output signal to be sample-based.

Frame based

Specifies the output signal to be frame-based.

Tip

To generate frame-based signals, you must have the DSP System Toolbox™ product installed.

Command-Line Information

Parameter: SamplingMode
Type: string
Value: 'auto' | 'Sample based' | 'Frame based'
Default: 'auto'

Bus Support

The Signal Specification block supports virtual and nonvirtual buses. If you specify a bus object as the data type, then set these other block parameters as follows:

Block ParameterRequired Value for a Bus Data Type
Variable-size signalNo
Sampling modeSample based

All elements of the bus input to a Signal Specification block must have the same names as specified in the bus object.

All signals in a nonvirtual bus input to a Signal Specification block must have the same sample time, even if the elements of the associated bus object specify inherited sample times. You can use a Rate Transition block to change the sample time of an individual signal, or of all signals in a bus. See Composite Signals and Bus-Capable Blocks for more information.

The Model Configuration Parameters > Diagnostics > Connectivity Mux blocks used to create bus signals diagnostic must be set to Error.

Characteristics

Direct Feedthrough

Yes

Sample Time

Specified by the Sample time parameter

Scalar Expansion

No

Dimensionalized

Yes

Multidimensionalized

Yes

Virtual

Yes

For more information, see Virtual Blocks.

Zero-Crossing Detection

No

Was this topic helpful?