Azzera filtri
Azzera filtri

How can a Script Read a resolved Data Type String?

1 visualizzazione (ultimi 30 giorni)
Jeremy
Jeremy il 11 Ott 2013
Risposto: Aditya il 27 Lug 2016
I need to have my m-script read the data types of several blocks and labeled signals in a Simulink model, immediately after the model has been run. Many of these data types are not available in the "OutDataTypeStr" property. For example, I see one inport whose "OutDataTypeStr" value is set to "inherit: auto", but because I selected "Format - Port/Signal Displays - Port Data Types", when I run the model I see the correct name of the custom data type apear above the inport block's output signal. I can see it on my screen, but I cannot figure out how to read it in an M-script. Any suggestions?

Risposte (1)

Aditya
Aditya il 27 Lug 2016
You need to be in compiled mode for this.
Say your full block path is stored in the variable blockPath Note: The full block path can be obtained using the command gcb after a block is selected in the Simulink model.
>> blockObject = get_param(blockPath, 'Object');
>> blockObject.CompiledPortDataTypes % will give you what you want

Categorie

Scopri di più su Interactive Model Editing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by