tlc undefined identifier param
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to use the SParameter of a S-Function level 2 on a inline S-Function to obtain a value passed from the mask of a block in my tlc file. I run into the error message.
Error: File: \rtw\c\tlc\lib\paramlib.tlc Line: 22 Column: 24 Undefined identifier param.
Thus indicating I'm not correctly defining the Parameter.
My tlc file look something like.
%function Outputs(block, system) Output
%assign y = LibBlockOutputSignal(0, "", "", 0)
%assign out = LibBlockParameter(out, "", "", 0)
%<y> = %<out>;
%endfunction %%Outputs
Thus I get the error on the line 3rd line.
I opened the mask for the block and added an edit parameter and named it out. After this I was able to double click the block and add a value to the textbox shown. So I believe the number is being entered however I'm missing the step to get the value to the tlc part.
Thoughts?
1 commentaire
Réponses (1)
Govind
le 12 Jan 2023
Modifié(e) : Govind
le 12 Jan 2023
For level 2 M-S functions you need to use LibBlockParameter(MSFcnParameter, ucv, lcv, sigIdx). You get this error because "Out" is not part of CompiledModel.ModelParameters.
Some more points to be noted
1) make dialog parameters tunable block.DialogPrmsTunable = {'Tunable'};
2) Register all tunable parameters as runtime parameters --> block.AutoRegRuntimePrms;
for detailed example look into sldemo_msfcn_lms
0 commentaires
Voir également
Catégories
En savoir plus sur Target Language Compiler dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!