This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This is a bug in Simulink Performance Tool in the way that the Simulink Accelerator handles file names from the S-Function Builder block.
To work around this issue, try to specify all the S-Function modules prior to simulation.
Enter the following at the MATLAB command prompt:
set_param('$MODELNAME/S-Function Builder','SFunctionModules','<$SFUN_NAME>_wrapper $EXTERN_CODE')
where $MODELNAME is the model name.
where $SFUN_NAME is the S-function name
where $EXTERN_CODE is the library C-files, without the .c extension.
For example, I have a model named "test3", an S-function named "mysfun" and a library C-file named "afun", I would enter the following at the MATLAB command prompt:
set_param('test3/S-Function Builder','SFunctionModules','mysfun_wrapper afun')
Note that the S-Function Builder block always creates an S-function wrapper so we must specify both the wrapper and external C-files.
For more information about this, refer to the MATLAB documentation "Writing S-Functions for Real Time Workshop" by executing the following command at the MATLAB prompt:
web([docroot '/toolbox/rtw/rtw_ug/sfcn_rtw.html#67544'])
Best Answer