MATLAB: What is the meaning of the ssSetRTWGeneratedSFcn parameter within Real-Time Workshop 6.5 (R2006b)

simulink coder

I generate an S-function using the S-function Target. The Subsystem_sf.c file contains the following line of code:
ssSetRTWGeneratedSFcn(S, 1);
I cannot find any documentation that discusses this feature.

Best Answer

The expectation is that customers will use the \Subsystem_sfcn_grt_rtw folder in the new location when they want to use the S-function with Real-Time Workshop.
So if the S-function is generated using the S-function Target, this flag is turned on:
ssSetRTWGeneratedSFcn(S, 1);
in the S-function .mexw32 file. Then, when Real-Time Workshop is used to build the model containing the S-function, it will automatically search for the source files in the Subsystem_sfcn_grt_rtw folder. However, if you want to change the location of the source files, then that flag must be turned off:
ssSetRTWGeneratedSFcn(S, 0);