Main Content

In Bus Element

Select input from external port

  • In Bus Element block

Libraries:
Simulink / Ports & Subsystems
Simulink / Sources
HDL Coder / Ports & Subsystems
HDL Coder / Sources

Alternative Configurations of In Bus Element Block:
Bus Element In

Description

TheIn Bus Elementblock, also known as theBus Element Inblock, combines the functionality of anInportblock and a总线选择器block. This block is of theInportblock type, and allIn Bus Elementblocks that correspond with the same port share a dialog box.

Use anIn Bus Elementblock to select a bus element, bus, nonbus signal, or message associated with the port. To select multiple elements from a bus, use multipleIn Bus Elementblocks.

For interfaces that include buses composed of many bus elements,In Bus Elementblocks:

  • Reduce signal line complexity and clutter in a block diagram.

  • Allow you to more easily make incremental changes to the interface.

  • Allow access to a bus element closer to the point of usage, avoiding the use of a总线选择器andGotoblock configuration.

To convert an interface to useIn Bus Elementblocks, seeSimplify Subsystem and Model Interfaces with Bus Element Ports

TheIn Bus Elementblock does not support mixing message and signal elements as outputs.

Examples

expand all

In a model component, each input bus element port is represented by one or more In Bus Element blocks.

Open the example model namedCreateInputBusElementPort

To add an input bus element port for a model, add an In Bus Element block to the top level of the model. For example, double-click the canvas and start typing the block name. Then, select the In Bus Element block.

To add an input bus element port to a subsystem, add an In Bus Element block to the subsystem or click the edge of the Subsystem block and selectCreate in bus port

打开子系统,双击子system block.

The subsystem contains a default In Bus Element block that corresponds to the input port you created on the Subsystem block. The block label uses default values for its two interactive text fields: the port name (InBus) and the bus element (signal1).

To create another input bus element port from inside a model component, holdCtrlwhile you drag an existing In Bus Element block to a new location. Upon releasing the pointer, click创建新的端口

An In Bus Element block with a unique port name appears.

In this example, the new port is namedInBus1

To edit the port name, click the port name in the block label. Then, enter a new name.

Alternatively, set thePort nameblock parameter to the desired name for the port.

When multiple blocks are associated with the same port and you change the name of the port, all blocks that share the port update to reflect the new port name.

The input to a bus element port can be a bus, signal, or message. To pass the entire input through anIn Bus Elementblock instead of selecting an element of an input bus, remove the part of the block label that represents an element.

For example, in theInBus.signal1label of a defaultIn Bus Elementblock, clicksignal1

Default In Bus Element block

删除the text from this field. Then, click elsewhere on the canvas to commit the change.

In Bus Element block labeled InBus

To change the name of the port associated with the block, edit the first text field in the block label.

For example, suppose the port expects a chirp signal. In the block label, clickInBus

InBus.signal1 block label with cursor after InBus

删除InBusand enterchirp。Ignore the placeholder text that shows where you can enter an element name.

In Bus Element block labeled chirp

Alternatively, set thePort nameblock parameter to the desired name for the port.

To select elements of an input bus element port of a subsystem, use an In Bus Element block for each element that you want to select.

Open and compile the example model namedSelectInputBusElements。To compile the model, on theModelingtab of the Simulink Toolstrip, clickUpdate ModelorRun。Compiling the model updates the line styles, which you can use to visually identify buses.

A Bus Creator block creates a virtual bus that contains two elements: a nested bus namednonconstantand a signal namedconstant。Thenonconstantbus contains two signals namedsineandchirp。The top-level bus connects to the input port of the Subsystem block.

打开子系统,双击子system block.

The subsystem contains an In Bus Element block that corresponds to the input port. The block label indicates that the block selects the signal namedconstantfrom the input port.

To change the element that the block selects, edit the second text field in the block label. When the second text field is empty, a menu provides the elements of the port along with the previously selected element.

When the list of input elements is long, filter the list of elements by starting to type the name of the element you want to select.

For this example, typechirp

The list provides the text you type as an option. However, the top-level input bus does not contain a signal namedchirp。The nested bus namednonconstantcontains the signal namedchirp。Therefore, select the option namednonconstant.chirp。Each dot in the label follows the name of a bus in the input bus hierarchy.

Open the Property Inspector. Then, select the In Bus Element block. Alternatively, double-click the block to open a dialog box.

The element that the block selects is highlighted. The elements that an In Bus Element block does not select are gray and italicized.

To add blocks for additional input elements, click an element name or holdCtrlas you click multiple element names. Then, clickAdd blocks for selected signals

Corresponding In Bus Element blocks appear in the block diagram.

Multiple In Bus Element blocks can select the same element. For example, add another block that selects the element namedconstant

The duplicate block is highlighted.

To find duplicate blocks when the block diagram is complicated, select the block, pause on the ellipsis, and in the action bar, clickRelated Blocks

When multiple blocks correspond to the selected block, a list of related blocks opens. You can filter the list of related blocks by entering a search term in the text box. Clicking a related block in the list selects the block in the block diagram.

To specify the elements of an input bus element port at a model interface, you can:

  • Define the bus hierarchy with aSimulink.Busobject.

  • Add elements with or without adding blocks to the block diagram.

Referenced models support passing through an entire bus with anIn Bus Elementblock in either of these scenarios:

  • The bus is defined by aSimulink.Busobject.

  • AdditionalIn Bus Elementblocks pass each leaf element of the bus into the referenced model.

Note

Only elements that are selected by blocks supportSimulink.Busobject data types.

This example shows how to define an input bus element port at a model interface without aSimulink.Busobject.

In a blank model, add anIn Bus Elementblock.

Default In Bus Element block

Open theProperty Inspector。Then, select theIn Bus Elementblock. Alternatively, double-click the block to open a dialog box.

To add an element to the port with a block, select the element that you want to contain the new element. Then, click theAdd elementbutton.

Pointer paused on Add element button

The new element is nested under the previously selected element. In the block diagram, a block that selects the new element appears.

A second In Bus Element block is labeled InBus.signal2.

To add an element without a block, in the Property Inspector or dialog box, select the element that you want to contain a new element. Then, click theAdd elementbutton arrow, and selectAdd element without block

指针停在没有阻止按钮添加元素

The new element is nested under the previously selected element in the Property Inspector or dialog box. The block diagram is unchanged.

InBus with a new element named signal1 nested under signal2

Optionally, reorder input elements by dragging them to new locations in the list of elements.

To add blocks for additional input elements, click an element name or holdCtrlas you click multiple element names. Then, clickAdd blocks for selected signals

Pointer paused on Add blocks for selected signals button

CorrespondingIn Bus Elementblocks appear in the block diagram.

When multipleIn Bus Elementblocks select the same element, selecting one of the blocks highlights the other blocks that select the same element.

The duplicate In Bus Element block is highlighted in purple.

To find duplicate blocks when the block diagram is complicated, select the block, pause on the ellipsis, and in the action bar, clickRelated Blocks

Pointer paused on Related Blocks button

When multiple blocks correspond to the selected block, a list of related blocks opens. You can filter the list of related blocks by entering a search term in the text box. Clicking a related block in the list selects the block in the block diagram.

Use compact labels and block colors to customize the appearance of In Bus Element and Out Bus Element blocks.

Open the example model namedBusElementPortBlocks

The model contains:

  • In Bus Element blocks that represent two unique bus element ports namedInbusandpulse

  • Out Bus Element blocks that represent a bus element port namedOutBus

To reduce the size of the block labels, display only the leaf element names. Select an In Bus Element or Out Bus Element block, pause on the ellipsis, and in the action bar, clickCompact Notation

All In Bus Element and Out Bus Element blocks in the block diagram display shortened block labels that use only the leaf element name.

To show the full block label, in the action bar, you can clickExpanded Notation。For this example, keep the compact block labels.

Block colors can help differentiate unique ports when the block labels are compact.

Open the Property Inspector. Then, select an In Bus Element block that corresponds with the port namedInBus。For example, select the block labeledconstant。另外,双击打开一个块dialog box.

In the Property Inspector or dialog box, selectInBus。Then, clickSet colorand select a color from the menu.

The blocks related to the port use the chosen color.

To identify the blocks that select the nested bus namednonconstantor its elements, selectnonconstant。Then, clickSet colorand select a different color from the menu.

The blocks related to the nested bus use the chosen color.

To remove allIn Bus Elementblocks associated with the selected element or elements in the Property Inspector or dialog box, you can click a button.

  • For a subsystem interface, clickRemove blocks of selected signals。This operation removes all blocks that select the highlighted elements. When a corresponding element is available at the input port, it remains in the list of elements.

  • For a model interface, clickRemove selected elements。This operation removes the highlighted elements and allIn Bus Elementblocks that select them.

For example, suppose you have a subsystem interface that receives a bus namedInBus。One of the elements of the bus, namedpulse, has been removed. However, at least oneIn Bus Elementblock selects the element.

Three elements appear under InBus. The selected element, pulse, is red and italicized.

To remove the blocks that select the invalidpulseelement, click the element name. Then, clickRemove blocks of selected signals

Pointer paused on Remove blocks of selected signals

The operation removes the invalid element and corresponding block.

An unconnected line where the block was removed

Ports

Output

expand all

Select a bus, signal, or message from the corresponding external input port of the parent subsystem or model.

While you can select bus elements, you cannot select elements of arrays of buses.

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

Parameters

expand all

To interactively edit the parameters of the block, the corresponding port, and the elements at the port, double-click the block or open theProperty Inspectorand select the block.

Specify a port name that is not already in use by another block or port. The name appears on the parentSubsystemorModelblock. The name also appears next to the block. Multiple blocks can access the same port.

Programmatic Use

To set the block parameter value programmatically, use theset_paramfunction.

Parameter: PortName
Values: 'InBus'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/PortBlock','PortName','myBus')

Specify the order in which the port that corresponds to the block appears on the parentSubsystemorModelblock.

  • If you add a block that creates another port, the port number is the next available number.

  • Deleting all blocks associated with a port deletes the port. Other ports are renumbered so that they are sequential and do not skip any numbers.

  • Specifying a port number that exceeds the number of ports creates a port for that number and for any skipped sequential numbers.

Programmatic Use

To set the block parameter value programmatically, use theset_paramfunction.

Parameter: Port
Values: '1'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/PortBlock','Port','5')

Specify the block background color. This specification sets the color of blocks associated with selected bus elements, or of all blocks associated with the port if you do not select any bus elements.

Programmatic Use

To set the block parameter value programmatically, use theset_paramfunction.

Parameter: BackgroundColor
Values: 'black'(default) |'white|'red'|'green'|'blue'|'cyan'|'magenta'|'yellow'|'gray'|'lightBlue'|'orange'|'darkGreen'|'[r,g,b]'wherer,g, andb, are the red, green, blue values of the color in the range 0.0 to 1.0

Example:set_param('mymodel/Subsystem1/PortBlock','BackgroundColor','magenta')

Specify a search term to use for filtering a long list of bus elements. Do not enclose the search term in quotation marks. The filter does a partial string search and supports regular expressions. To use a regular expression character as a literal, include an escape character (\). For example, to use a question mark, typesig\?1

Attributes

To specify attributes, such as data type, pause on the name of a bus, signal, or message. Then, click the pencil buttonthat appears.

Pencil button next to bus name

When you specify attributes, they appear next to the name of the bus, signal, or message. Click an attribute summary to edit the attributes of the bus, signal, or message.

Attribute summaries next to bus and bus element names

The data type of a bus, signal, or message can be inherited, specified directly, or expressed as a data type object such as aSimulink.NumericTypeobject.

You can specify any of these options:

  • Inherited data type

  • Built-in Simulink®data type — For example, specifysingleoruint8。SeeData Types Supported by Simulink

  • Fixed-point data type — Use thefixdtfunction. For example, specifyfixdt(1,16,0)

  • Enumerated data type — Use the name of the type preceded byEnum:。For example, specifyEnum: myEnumType

  • Bus data type — Use the name of theSimulink.Busobject preceded byBus:。For example, specifyBus: myBusObject

  • Value type — Use the name of theSimulink.ValueTypeobject preceded byValueType:。For example, specifyValueType: windVelocity

  • Custom data type — Use a MATLAB expression that specifies the type. For example, you can specify aSimulink.NumericTypeobject whoseDataTypeModeproperty is set to a value other than'Fixed-point: unspecified scaling'

When you specify aSimulink.ValueTypeobject as the data type, some parameters of the element are ignored. For example, theMin,Max, andUnitparameters are ignored. The software uses the corresponding properties of theSimulink.ValueTypeobject. For example, suppose you setUnittoft/sfor an element. When theData typeof the element specifies aValueTypeobject that hasm/sas its unit, the element usesm/sinstead offt/s

When you specify aSimulink.Busobject as the data type, some parameters of the element are reset to their default values. For example, theMin,Max, andUnit参数重置。软件使用相关系数ponding properties of theSimulink.BusElementobjects in theSimulink.Busobject instead.

Tips

When you specify a bus using aSimulink.Busobject or aSimulink.ValueTypeobject with aSimulink.Busobject data type, the Property Inspector and block dialog box display the elements defined by the correspondingSimulink.BusElementobjects.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: OutDataTypeStr
Values: 'Inherit: auto'(default) |'double'|'single'|'half'|'int8'|'uint8'|'int16'|'uint16'|'int32'|'uint32'|'int64'|'uint64'|'boolean'|'fixdt(1,16)'|'fixdt(1,16,0)'|'fixdt(1,16,2^0,0)'|'string'|'Enum: '|'Bus: '|'ValueType: '|''

Example:set_param('mymodel/Subsystem1/myBus.signal1','OutDataTypeStr','int32')

Specify whether to inherit the bus virtuality or define the bus as virtual or nonvirtual. For more information, seeComposite Interface Guidelines

This parameter determines whether the blocks inherit or define the bus virtuality. If the blocks define the bus virtuality and the virtuality of the input bus does not match, compiling the model produces an error.

Dependencies

To enable this parameter,Data typemust resolve to aSimulink.Busobject. For example, setData typeto aSimulink.Busobject or aSimulink.ValueTypeobject that specifies aSimulink.Busobject as its data type.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: BusVirtuality
Values: 'inherit'(default) |'virtual'|'nonvirtual'

Example:set_param('mymodel/Subsystem1/myBus.nestedBus','BusVirtuality','nonvirtual')

Specify the data mode of the elements of the bus.

  • inherit— Bus elements inherit their data modes.

  • signal— Bus elements must be signals.

  • message— Bus elements must be messages.

    When you choosemessageas the data mode, an envelope button appears next to the bus or bus element. Use the envelope button to specify custom queue properties for each message element.

Dependencies

To enable this parameter, the block must be at the top level of a model.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: DataMode
Values: 'inherit'(default) |'signal'|'message'

Example:set_param('mymodel/InBus','DataMode','signal')

Specify the dimensions of a signal.

  • -1— The signal can have any dimensions.

  • N— The signal must be a vector of sizeN

  • [R C]— The signal must be a matrix havingRrows andCcolumns.

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter to1。The software uses the dimensions specified by theSimulink.BusElementobjects in theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the dimensions specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: PortDimensions
Values: '-1'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/myBus.signal1','PortDimensions','[1 3]')

Specify the type of signals allowed.

  • Inherit— Allow variable-size and fixed-size signals.

  • Variable— Allow only variable-size signals.

  • Fixed— Allow only fixed-size signals. Do not allow variable-size signals.

When the signal is variable-sized, theDimensionsparameter specifies the maximum dimensions of the signal.

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter toInherit。The software uses the dimensions modes specified by theSimulink.BusElementobjects in theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the dimensions mode specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: VarSizeSig
Values: 'Inherit'(default) |'No'|'Yes'

Example:set_param('mymodel/Subsystem1/myBus.signal1','VarSizeSig','No')

Specify the physical unit of the signal. For a list of supported units, in the MATLAB Command Window, entershowunitslist

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter toinherit。The software uses the units specified by theSimulink.BusElementobjects in theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the unit specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: Unit
Values: 'inherit'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/myBus.signal1','Unit','m/s')

Specify the numeric type of the signal. To choose the numeric type of the signal, selectauto。Otherwise, choose a real or complex signal type.

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter toauto。The software uses the complexity specified by theSimulink.BusElementobjects in theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the complexity specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: SignalType
Values: 'auto'(default) |'real'|'complex'

Example:set_param('mymodel/Subsystem1/myBus.signal1','SignalType','real')

Lower value of the range that the software checks.

This number must be a finite real double scalar value.

The software uses this value to perform:

  • Simulation range checking. For more information, seeSpecify Signal Ranges

  • Automatic scaling of fixed-point data types.

  • Optimization of the code that you generate from the model. This optimization can remove algorithmic code and affect the results of some simulation modes such as SIL or external mode. For more information, seeOptimize using the specified minimum and maximum values(Embedded Coder)

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter to[]。The software uses the minimum values specified by theSimulink.BusElementobjects in theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the minimum value specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: OutMin
Values: '[]'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/myBus.signal1','OutMin','0')

Upper value of the range that the software checks.

This number must be a finite real double scalar value.

The software uses this value to perform:

  • Simulation range checking. For more information, seeSpecify Signal Ranges

  • Automatic scaling of fixed-point data types.

  • Optimization of the code that you generate from the model. This optimization can remove algorithmic code and affect the results of some simulation modes such as SIL or external mode. For more information, seeOptimize using the specified minimum and maximum values(Embedded Coder)

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter to[]。The software uses the maximum values specified by theSimulink.BusElementobjects in theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the maximum value specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: OutMax
Values: '[]'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/myBus.signal1','OutMax','2')

Use the description to document information about the bus, signal, or message, such as where it is used. This information does not affect processing.

Dependencies

  • WhenData typespecifies aSimulink.Busobject, the software sets this parameter to''(empty). The software uses the description specified by theSimulink.Busobject.

  • WhenData typespecifies aSimulink.ValueType忽略了对象,软件的价值标准ameter. The software uses the description specified by theSimulink.ValueTypeobject instead.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: Description
Values: ''(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/myBus.signal1','Description','This signal is used by...')

Execution Attributes

To specify execution attributes, such as sample time, pause on the name of a bus, signal, or message. Then, click Specify execution attributes

Mouse pointer paused on Specify execution attributes button next to bus name.

Specify the discrete interval between sample time hits or specify another type of sample time, such as continuous (0) or inherited (-1). For more options, seeTypes of Sample Time

By default, the signal inherits its sample time.

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: SampleTime
Values: '-1'(default) | character vector | string scalar

Example:set_param('mymodel/Subsystem1/InBus.signal1','SampleTime','2')

In a rate-based system, you can configure an input port in the top model or on a model reference interface to trigger the execution of one or more model partitions in response to the flow of data into the port. The parameter stores the event triggers associated with the port. Each event trigger maps an input event to the name of the schedule event it triggers. The schedule for the model specifies the partition to execute in response to the schedule event and the priority of execution.

The table summarizes the event triggers you can configure. You can configure an input port with one event trigger for each input event.

Input Event Input Event Description Event Trigger Object
Input write Value for input port updates. simulink.event.InputWrite
Input write timeout Input port value does not update within a specified amount of time. simulink.event.InputWriteTimeout
Input write lost Input port value update overwrites unprocessed data. simulink.event.InputWriteLost

To configure the schedule for your model, use theSchedule Editor

When you configure input events on a bus port, where you specify the event triggers depends on the virtuality of the bus.

  • For a virtual bus, specify event triggers on leaf elements of the bus. Specifying input events on the virtual bus itself is not supported.

  • For a nonvirtual bus, specify event triggers on the bus. Specifying input events on elements of a nonvirtual bus is not supported.

In Bus Elementblocks must select each element with event triggers.

Dependencies

To enable this parameter, the block must be at the top level of a model.

Programmatic Use

To set the block parameter value programmatically, use theset_paramfunction.

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: EventTriggers
Values: [](default) |1-by-1cell array |2-by-1cell array |3-by-1cell array

Example:set_param('mymodel/PortBlock','EventTriggers',{inputWrite,writeTimeout,writeLost})

Example:set_param('mymodel/InBus.signal1','EventTriggers',{inputWrite,writeTimeout,writeLost})

Queue Attributes

Queue attributes are visible only when the block is at the top level of a model and you set theData modeparameter tomessage

To specify queue attributes, click the envelope buttonUse default queue attributesnext to the name of a bus or message.

Envelope button next to bus element name

Use this parameter to select between default or custom queue specifications.

To use the default queue properties, leave the parameter selected. In this case, for each message bus element, a LIFO overwriting queue of capacity 1 is automatically inserted.

To use custom specifications, clear the parameter and configure the queue properties. Queue attributes are applicable if there is no storage block placed outside a component.

For more information, seeSpecify Queue Properties for Message Interface

Dependencies

To enable this parameter for an element, set theData modeof the element tomessage

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: MessageQueueUseDefaultAttributes
Values: 'on'(default) |'off'

Example:set_param('mymodel/InBus.message1','MessageQueueUseDefaultAttributes','off')

Specify the number of messages elements the queue can store.

Dependencies

To enable this parameter for an element, set theData modeof the element tomessage

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: MessageQueueCapacity
Values: '1'(default) | character vector | string scalar

Example:set_param('mymodel/InBus.message1','MessageQueueCapacity','10')

Choose one of these queue types:

  • FIFO— First-in-first-out

  • LIFO— Last-in-first-out

Dependencies

To enable this parameter for an element, set theData modeof the element tomessage

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: MessageQueueType
Values: 'LIFO'(default) |'FIFO'

Example:set_param('mymodel/InBus.message1','MessageQueueType','FIFO')

Select this parameter to choose between two queue overwriting policies.

  • If you select the parameter, an incoming message element overwrites the oldest message if the queue is full.

  • If you clear the parameter, the block does not accept new messages if the queue is full.

Dependencies

To enable this parameter for an element, set theData modeof the element tomessage

Programmatic Use

To programmatically set the attribute value for an element, use theset_paramfunction, specifying the element as the block path of the model component with the element label.

Parameter: MessageQueueOverwriting
Values: 'on'(default) |'off'

Example:set_param('mymodel/InBus.message1','MessageQueueOverwriting','off')

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

Alternative Configurations

expand all

TheBus Element Inblock differs from theIn Bus Elementblock by name only.

Libraries:
Simulink / Signal Routing
HDL Coder / Signal Routing

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

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

Version History

Introduced in R2017a

expand all