Clear Filters
Clear Filters

tlc undefined identifier param

11 views (last 30 days)
Brandon Phelps
Brandon Phelps on 1 Sep 2016
Edited: Govind on 12 Jan 2023
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 Comment
Baris Bitik
Baris Bitik on 31 Aug 2022
Can you help me with this? I am having the same problem.

Sign in to comment.

Answers (1)

Govind
Govind on 12 Jan 2023
Edited: Govind on 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

Community Treasure Hunt

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

Start Hunting!