Filter löschen
Filter löschen

Can you force Simulink Parameters and Signals to be declared in model_private.h when they're not used in the model during code generation?

3 Ansichten (letzte 30 Tage)
When I try to generate code for my Simulink model, any of the data dictionary items that aren't used inside the model do not get declared. Is there a way to force declarations of these Simulink Parameters and Signals?
In my particular application, I would like to generate declarations inside the generated model_private.h for all data dictionary items regardless if they're actually used in my model. The data dictionary items are set to a storage class of 'importedExtern'.

Antworten (1)

Mark McBroom
Mark McBroom am 4 Apr. 2018
I don't think this is possible. A possible workaround could be:
1. Write some MATLAB code to read the data dictionary and write out extern statements to a header file ( i.e. myHeader.h ) for all signals and parameters. You'll need to use the Simulink data dictionary APIs.
2. Modify the storage classes to be ImportFromFile for each signal and parameter.
3. Set the Storage Class Custom Attribute "HeaderFile" to be myHeader.h for each signal and parameter

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by