Simulink Coder + Referenced Models with arguments

13 views (last 30 days)
Hello,
I have a model with severel instances of a referenced model and all the parameters of these instances shall tunable indiviually. I did this by setting the check box "argument" in the referenced model.
As referenced models are in there, these models also need a Simulink configuration. Therefore I linked the referenced model to the Simulink data dictionary of the main model and refered to the the configuration of the main model.
Now I want to generate code from the main model including the instances of the referenced model, but I get the follwoing error messages:
The code interface packaging option 'C++ class' cannot be selected for model 'Model' because it does not combine its output and update functions when generating code for model reference targets
or
Invalid setting in 'Model/Transfer Fcn' for parameter 'Denominator'.
Caused by:
  • Model arguments can not be used in non-tunable expressions. The expression '[T 1]' in parameter 'Denominator' of 'Model/Transfer Fcn' can not be tuned but it refers to variables (T (model argument)). For more information about non-tunable expressions, see the documentation.
  • The generated code will inline the numeric value of the expression '[T 1]' (used in parameter 'Denominator' of 'Model/Transfer Fcn') because the expression has one or more unsupported operators (see the documentation). The code for this block will not use the tunable variables (T (model argument)).
I figured out that it got something to do with the code interface packaging option. Therefore I tried to use different configurations for this. But this part of the configuration can't be override for some reasons, so I can't refere to the main configuration and have to do setup an own configuration for the referenced models. Is this right way? I somehow think that there must be a better solution for this.
I hope someone can help!
Best regards and thanks in advance!

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!