Cannot access the Code Generation tab for Simulink.Parameter in Model Workspace

9 views (last 30 days)
Hi.
I have the Simulink PLC Coder License and I have a problem with simulink parameters in the Model Workspace. The Code Generation tab is missing!
I have access to the Code Generation tab only if the parameter is in the Base Workspace!? See attchment, where I have created a Simulink.Parameter in the Base- and copied it to the Model Workspace. As you can see, the Code Generation tab disappears.
Do I need some additional license just to have access to that tab in the model workspace? I thought that the rather expensive PLC Coder would be able to do that?
I have tried to re-install matlab, both update 4 and 5..
List of my product licenses:
MATLAB
Simulink
Control System Toolbox
Curve Fitting Toolbox
Industrial Communication Toolbox
Parallel Computing Toolbox
Simscape
Simscape Electrical
Simulink Control Design
Simulink PLC Coder
Stateflow
Statistics and Machine Learning Toolbox
System Identification Toolbox

Accepted Answer

Shivani
Shivani on 20 Sep 2023
Hi @Steven,
The Code generation tab for the Simulink.Parameter variable might be missing in the model workspace because it requires license to the Simulink Coder App.
The Code Generation tab will look something like this, on purchasing the Simulink Coder App license. As seen in the picture, the Coder App is required for configuration which is potentially why that tab is currently missing in your Simulink’s interface.
Furthermore, Code Generation for model workspace variables makes use of the Code Mapping editor, which is a part of the Simulink Coder. You can read more about the Code Mappings Editor by accessing this link: https://www.mathworks.com/help/rtw/ref/codemappingseditorc.html
The Simulink PLC coder will not be able to solve this issue as it varies from the Simulink Coder, please look at the links below for more details regarding the same:
I hope this resolves your issue!
  1 Comment
Steven
Steven on 20 Sep 2023
Thanks for answering Shivani.
I have inquired further on this with a technical support case, and they basically said the same.
However, I have found the limitations list for the PLC Coder (https://se.mathworks.com/help/plccoder/ug/structured-text-code-generation-limitations.html). And from this, I have found that among others the PLC Coder basically does not support the use of the Model Workspace. So I have learned that I need to use the base workspace or a data dictionary.
Who knew? Now I do :)

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink PLC Coder in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!