MATLAB: How to change the name of the BlockIO or D-Work variable when generating code from the Simulink model in R2006b with Real-Time Workshop Embedded Coder

blockiocodecoderd_workembeddedEmbedded Codergenerationglobalreal timevariablesworkshop

I would like to be able to change the name of the BlockIO or D_Work variable in my generated code in order to avoid conflicts with global variables. I'm using Real-Time Workshop Embedded Coder 4.5 (R2006b).

Best Answer

You can change the name of global variables like BlockIO and D_Work by changing the parameters 'Global variables', 'Global types', 'Field names of global types' in the 'Real-TIme Workshop/Symbols' tab of the Configuration Parameters dialog. Alternatively you can access these properties with the SET_PARAM command:
set_param(gcs,'CustomSymbolStrGlobalVar','newname');
set_param(gcs,'CustomSymbolStrGlobalType','newname');
set_param(gcs,'CustomSymbolStrGlobalField','newname');