Clear Filters
Clear Filters

Signal Names in BusSelector

6 views (last 30 days)
Deepak
Deepak on 18 Sep 2012
Hello All, I wanted to know the names of the Signals in a Busselector. I can do this using get_param(busselector,'OutputSignals'). However I need only the signals which are unconnected. Simulink displays these as ??. Obviously as these are missing my Update Diagram will also not work.. Another query but unrelated will it be possible to read these signals from the Update Diagram error messages.. Is it possible to access these messages.. I am using Matlab 2009b SP1.. However I have access to the latest releases also if that will help.. Any assistance will be greatly appreciated.. Thanks

Answers (1)

Ryan G
Ryan G on 18 Sep 2012
To find the error message this should work in 9b:
try
sim('mymodel')
catch me
errData = me.message
%parse the string for signal somehow
end
I don't fully understand the other question. If I have a signal connected to the bus selector, all of the signals available would be present in the bus selector dialog. If I leave the output unconnected I still get the signal name, maybe this ?? is unique to 9b. Can you upload an image of what you're talking about?
  2 Comments
Deepak
Deepak on 18 Sep 2012
Hi Ryan, Thanks a ton for your answer. Well actually let me be more clear.. I am working with libraries and I have bus selectors in the library blocks. Being library blocks they obviously are not connected to a bus and hence Simulink shows the unconnected buses with a ?? inside the library block.. I have uploaded a screen shot of the same. I am trying to write a function which will identify all the busselectors in the library block which have an external bus signal. A library by itself cannot be simulated and here I am running into difficulties. image here: http://postimage.org/image/tsl514hrt/ Maybe i am doing it wrong.. Any advice would be helpful.
Ryan G
Ryan G on 18 Sep 2012
Check out this blog post on bus objects. You can save the bus object in a mat-file or write a script that creates it and put it in the pre-load function of the library or possibly store it in the libraries model workspace (this would get weird once you start using the library in a model)
The main issue I see here is you would likely have to connect the bus object with your model that uses the library. I would try this out and see where things go.

Sign in to comment.

Categories

Find more on Interactive Model Editing 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!