Main Content

Display

Show value of input

  • Library:
  • Simulink / Sinks

    HDL Coder / Sinks

  • Display block

Description

TheDisplayblock shows the value of the input data. You can specify the frequency of the display. For numeric input data, you can also specify the format of display.

If the block input is an array, you can resize the block vertically or horizontally to show more than just the first element. If the block input is a vector, the block sequentially adds display fields from left to right and top to bottom. The block displays as many values as possible. A black triangle indicates that the block is not displaying all input array elements.

TheDisplayblock shows the first 200 elements of a vector signal and the first 20 rows and 10 columns of a matrix signal.

Note

If you specify a numeric display format that is not large enough to display all the digits of a value, the displayed values may lose precision. The result depends on your computer hardware and operating system.

Display Abbreviations

The following abbreviations appear on theDisplayblock to help you identify the format of the value.

When You See... The Value That Appears Is...

(SI)

存储的整数值

Note

(SI)does not appear when the signal is of an integer data type.

hex

In hexadecimal format

bin

In binary format

oct

In octal format

Displaying Strings

When working with strings, theDisplayblock displays:

  • Strings with double quotes.

  • Special characters such as newline are shown as escaped sequences, for example'\n'.

  • Non-displayable characters as escaped octal number, for example'\201'.

If the incoming signal is of type string, theNumeric display formatparameter selection does not affect the display of the string.

Ports

Input

expand all

Input data to display.

Data Types:single|double|half|int8|int16|int32|int64|uint8|uint16|uint32|uint64|string|Boolean|fixed point|enumerated

Parameters

expand all

Specify the format of the numeric data that appears.

If You Select... The Block Displays...
short A 5-digit scaled value with fixed decimal point
long A 15-digit scaled value with fixed decimal point
short_e A 5-digit value with a floating decimal point
long_e A 16-digit value with a floating decimal point
bank A value in fixed dollars and cents format (but with no $ or commas)
hex (Stored Integer) 存储的整数值of a fixed-point input in hexadecimal format
binary (Stored Integer) 存储的整数值of a fixed-point input in binary format
decimal (Stored Integer) 存储的整数值of a fixed-point input in decimal format
octal (Stored Integer) 存储的整数值of a fixed-point input in octal format

If the numeric input to aDisplayblock has an enumerated data type (seeSimulink EnumerationsandDefine Simulink Enumerations):

  • The block displays enumerated values, not the values of underlying integers.

  • SettingNumeric display formatto any of theStored Integersettings causes an error.

If the incoming signal is of type string, the selection of theNumeric display formatparameter does not affect the display of the string.

Programmatic Use

Block Parameter:Format
Type:character vector
Values:'short'|'long'|'short_e'|'long_e'|'bank'|'hex (Stored Integer)'|'binary (Stored Integer)'|'decimal (Stored Integer)'|'octal (Stored Integer)'
Default:'short'

Specify how often to display data.

The amount of data that appears and the time steps at which the data appears depend on theDecimationblock parameter and theSampleTimeproperty.

  • TheDecimationparameter enables you to display data at everynth sample, wherenis the decimation factor. The default decimation,1, displays data at every time step.

    Note

    显示块initi更新其显示al time, even when theDecimationvalue is greater than one.

  • TheSampleTimeproperty, which you can set withset_param, enables you to specify a sampling interval at which to display points. This property is useful when you are using a variable-step solver where the interval between time steps is not the same. The default sample time,-1, causes the block to ignore the sampling interval when determining the points to display.

    Note

    If the block inherits a sample time ofInf,Decimationparameter is ignored.

Programmatic Use

Block Parameter:Decimation
Type:character vector
Values:'1'| integer
Default:'1'

To use the block as a floating display, select theFloating displaycheck box. The block input port disappears and the block displays the value of the signal on a selected line.

If you selectFloating display:

  • Turn off signal storage reuse for your model. SeeSignal storage reuse(Simulink Coder)for more information.

  • Do not connect a multidimensional signal to a floating display.

Programmatic Use

Block Parameter:Floating
Type: character vector
Values:'on'|'off'
Default:'on'

Block Characteristics

Data Types

Boolean|double|enumerated|fixed point|half|integer|single|string

Direct Feedthrough

yes

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Introduced before R2006a