Tip #19: MBD Toolbox - How to generate meaningful names for variables in Code Generation
Have you ever wanted to scope or record a variable with FreeMASTER or simply wanted to read the MATLAB generated code but found no meaningful symbol names in C-source or ELF ?
By default, MATLAB/Simulink code generation is going to optimize the program and most of the time the variables might be optimized out or simply defined as locals.
Here is a Simulink model and the associated code generation snippet:

{
SWLIBS_3Syst_FLT Out;
SWLIBS_2Syst_FLT In;
In.fltArg1 = rtb_GMCLIB_ParkInv_SF_o1;
In.fltArg2 = rtb_GMCLIB_ParkInv_SF_o2;
rtb_GMCLIB_SvmStd_SF_o4 = GMCLIB_SvmStd_FLT(&Out, &In);
rtb_GMCLIB_SvmStd_SF_o1 = Out.fltArg1;
rtb_GMCLIB_SvmStd_SF_o2 = Out.fltArg2;
rtb_GMCLIB_SvmStd_SF_o3 = Out.fltArg3;
}
In this case, the inputs and outputs are local variables and can't be visible to FreeMASTER therefore you cannot plot them in real time nor reading/understanding the code faster.
void PWM_control_S32K_step(void)
{
real32_T rtb_GMCLIB_SvmStd_SF_o1;
real32_T rtb_GMCLIB_SvmStd_SF_o2;
real32_T rtb_GMCLIB_SvmStd_SF_o3;
real32_T rtb_GMCLIB_ParkInv_SF_o1;
real32_T rtb_GMCLIB_ParkInv_SF_o2;
uint32_T rtb_GMCLIB_SvmStd_SF_o4;
Wouldn't be nice to have the symbols like U_ALPHA, U_BETA, PWM_A, PWM_B, PWM_C and SECTOR instead of generic Simulink naming convention ?
Good news! that is possible with a single click.
Just right click on the signal, select Signal Properties and then enable "Test Point"

Do this for all the signals you wish to visualize in FreeMASTER and Simulink is going to highlight all these signal and use them during code generation

Now the generated code should look like this.
{
SWLIBS_3Syst_FLT Out;
SWLIBS_2Syst_FLT In;
In.fltArg1 = PWM_control_S32K_B.U_ALPHA;
In.fltArg2 = PWM_control_S32K_B.U_BETA;
PWM_control_S32K_B.SECTOR = GMCLIB_SvmStd_FLT(&Out, &In);
PWM_control_S32K_B.PWM_A = Out.fltArg1;
PWM_control_S32K_B.PWM_B = Out.fltArg2;
PWM_control_S32K_B.PWM_C = Out.fltArg3;
}
Now, it is easier to read the code and the even more important the Simulink is going to generate a global structure that could be easily visualized in FreeMASTER in real-time.
typedef struct {
real32_T U_ALPHA;
real32_T U_BETA;
real32_T PWM_A;
real32_T PWM_B;
real32_T PWM_C;
uint32_T SECTOR;
} B_PWM_control_S32K_T;