Why does acquiring the parameter BusStruct cause MATLAB to crash?

3 views (last 30 days)
In my model I have a block that tries to get the parameter 'BusStruct' during the 'InitFcn' callback.  However, when I try to update the model MATLAB crashes. Why does this occur?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 11 Dec 2020
Edited: MathWorks Support Team on 11 Dec 2020
The parameter 'BusStruct' is an undocumented parameter. In the past, with the property 'BusStruct', users were able to get the hierarchical structure of a bus signal from a BusSelector or BusCreator block in a Simulink model after model update diagram (Ctrl+D).
You would select, for instance, a BusSelector block in your model, and type in MATLAB command window. For testing you can open demo Simulink model busdemo.slx :
tmp = get_param(gcbh,'BusStruct') % Command is undocumented and can be deprecated in future releases!
ans = 
  2×1 struct array with fields:
    name
    src
    srcPort
    signals
Using 'BusStruct' property is not a recommended workflow. Instead, you could look at the 'SignalHierarchy' for the bus to obtain similar information. The example found under the section 'Bus Signal Example' in the link below demonstrates how to get this information.  

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2014b

Community Treasure Hunt

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

Start Hunting!