MATLAB: How to build the model that contains S-Function block built with multiple C source files if the source files are not published using Real-Time Workshop

simulink coder

I would like to know How to build my model that contains S-Function block built with multiple C source files if the source files are not published using Real-Time Workshop.
 

Best Answer

1. The user who created the model performs the following steps:
1-1. At the part of the "S-Function modules" in S-Function block, write Names of C source files used when doing MEX compile.
1-2. Build the model which contains the S-Function using Real-Time Workshop.
1-3. Copy S-FunctionName.obj and all C-SourceName.obj files from RTW folder(**),
     ans send them with model file and MEX-file of S-Function.
2. At the receiver’s end, once you have these files, follow the steps below: 
2-1. Save the model file and MEX-file on the same folder.
2-2. In the above folder, create modelname_targetname_rtw folder, and save S-FunctionName.obj and all C-SourceName.obj files into the folder.
2-3. Build the model.
) RTW folder means the folder that is displayed with the modelname_targetname_rtw. 
For example, if the model name is GRT target in mymodel.mdl, will mymodel_grt_rtw.