MATLAB: How to specify a different header file name for each Simulink data object when using the ExportToFile custom storage class with a FlatStructure type in Real-Time Workshop Embedded Coder 4.0 (R14)

cscEmbedded Codersimulinktlc

I am using the ExportToFile custom storage class found in the Simulink package and changed the type of the storage class to FlatStructure. However, whenever I use objects with this custom storage classes in different models, the generated header files have the same name.
I would like to specify the header file name as an instance specific property of each of my objects.

Best Answer

The ability to specify the header file name as an instance specific parameter is not available when using the ExportToFile custom storage class with a FlatStructure type in Real-Time Workshop Embedded Coder.
To workaround this issue, create a Custom Storage Class with a storage class type of Other and define the storage class using the Target Language Compiler. Note you will need to use the advanced mode of the CSCDESIGNER:
cscdesigner -advanced
Please navigate to the following location within the Real-Time Workshop Embedded Coder documentation for more information:
Real-Time Workshop Embedded Coder > Custom Storage Classes