This is the expected behavior. Because you manually entered the name of the S-function in prov2.mdl, the model does not know that the S-function is using a wrapper. You need to set the SFunctionModules parameter of the S-function block. For the prov2.mdl model, you should use the following commands at MATLAB command prompt;
set_param('prov2/S-Function', 'SFunctionModules', 'prova1_wrapper');
PLEASE NOTE: The model needs to be open when you use SET_PARAM.
For more information on S-Function modules for Real-Time Workshop builds, please refer to the documentation which can be found by typing the following in the MATLAB command line:
web([docroot '/toolbox/simulink/sfg/sfcn_rtw6.html'])
An alternate way to do this is to add the TLC macro - LibAddToModelSources to the prova1.tlc file. However, we recommend using the SFunctionModules block parameter instead of this function.
For more information see, TLC macro function in matlabroot/rtw/c/tlc/lib/utillib.tlc and also see the information on the TLC macro that can be found in the documentation by typing the following in the MATLAB command line:
web([docroot '\toolbox\rtw\tlc_ref\cp_fcnl9.html#12983'])
Best Answer