Signal Names in BusSelector
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Ryan G
le 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 commentaires
Ryan G
le 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.
Voir également
Catégories
En savoir plus sur Interactive Model Editing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!