Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Simulink.Bus.createObject - Create bus objects for blocks

Syntax

busInfo = Simulink.Bus.createObject(modelName, blks)
busInfo = Simulink.Bus.createObject(modelName, blks, fileName)
busInfo = Simulink.Bus.createObject(modelName, blks, fileName, 'format')

Description

busInfo = Simulink.Bus.createObject(modelName, blks) creates bus objects (instances of Simulink.Bus class in the MATLAB base workspace) for specified blocks, and returns information about the objects that it created.

busInfo = Simulink.Bus.createObject(modelName, blks, fileName) saves the bus objects in an M-file that contains a cell array of cell arrays. Each subordinate array represents a bus object and contains the following data:

{BusName, HeaderFile, Description, BusElements}

The BusElements field is an array containing the following data for each element:

{ElementName, Dimensions, DataType, 
SampleTime, Complexity, SamplingMode}

busInfo = Simulink.Bus.createObject(modelName, blks, fileName, 'format') saves the bus objects in an M-file that contains either a cell array of bus information, or the bus objects themselves.

Inputs

modelName

Name or handle of a model

blks

List of subsystem-level Inport blocks, root-level or subsystem-level Outport blocks or Bus Creator blocks in the specified model. If only one block needs to be specified, this argument can be the full pathname of the block. Otherwise, this argument can be either a cell array containing block pathnames or a vector of block handles.

fileName

Name of the file in which to save the bus objects created by this function. If this argument is omitted, this function does not save the created bus objects in a file. By default, the function saves the objects in a cell array.

format

Format used to store the bus objects. The value can be 'cell' or 'object'. Use cell array format to save the objects in a compact form.

Default: 'cell'

Outputs

busInfo

A structure array containing bus information for the specified blocks. Each element of the structure array corresponds to one block and contains the following fields:

blockHandle of the block
busNameName of the bus object associated with the block

See Also

Bus Assignment | Bus Creator | Bus Selector | Bus to Vector | Simulink.Bus | Simulink.Bus.cellToObject | Simulink.Bus.objectToCell | Simulink.Bus.save | Simulink.BusElement

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS