Find name of MPT signal of input line
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a large Simulink model which includes many signals associated with mpt.Signal objects in the base workspace (so that these lines auto code to simple, non-structured variables). To create some ancillary information for this model, I need my script to find which mpt signals are used as inputs to some of my custom subsystem blocks.
Looking at one of these blocks, I can use "get_param" to get its inport "Port" and "Line" object handles, but I cannot find a way to retrieve the name of the associated MPT signal.
Alternatively, my script has a list of these signals available. If I could generate a list of every subsystem inport which uses a given MPT signal, then I could search that list for the subsystems which intrest me, and complete my script from there.
So is there any way for a script to find the uses of an MPT signal, even after it is routed through multiple subsystem levels of a complex madel? I could use a solution which either examines an inport and determinies the signal or finds all inports which use a given signal.
0 commentaires
Réponses (2)
Kaustubha Govind
le 27 Août 2012
This might help:
>> signals = find_system('modelname', 'FindAll', 'on', 'RegExp', 'on', 'Type', 'line', 'Name', '\w')
This should give you the list of all signals with a non-empty name.
Alternately, if you have the line handle, you should just have to call GET_PARAM to ask for the "Name" parameter:
>> get_param(signals(1), 'Name')
You can also use "get" instead of get_param. The following command will query for all public properties of the line:
>> get(signals(1))
0 commentaires
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!