Array of buses, with bus having different data types, Simulink 2012a

4 views (last 30 days)
Hi,
I am trying to create an array of buses in Simulink 2012a, following the documentation given at: http://www.mathworks.se/help/releases/R2010b/toolbox/simulink/ug/bsocrb0.html
I want to make an array of a bus which is defined to have 3 elements of different data types: boolean, double and uint8. Is this not possible?
I noticed that the demo sldemo_bus_arrays combines buses with all elements of the same data type, so it looks kind of trivial and perhaps not so useful in many cases. It really doesn't correspond to an array of structures in this case.
Thanks in advance for replies.
Rey

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 16 Nov 2012
You can follow the same methodology, except that the Bus object in the workspace (called sldemo_bus_arrays_busobject in this example) must have its elements set to different datatypes, and the appropriate signals types must be generated in the model.

More Answers (1)

Rey
Rey on 16 Nov 2012
Hi!
I just noticed the important thing here is that the created bus must be non-virtual, otherwise Simulink won't allow concatenation. Then I infer that in Simulink non-virtual bus is the concept corresponding to struct in hand-coding. And actually it is mentioned here:
"Such a bus is represented by a structure in generated code, which can be helpful when tracing the correspondence between the model and the code."
Thanks for your reply.

Categories

Find more on Composite Interfaces in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!