MATLAB: Model Reference Target Update Error

errorreal time workshoprtws-functionsimulink

I'm trying to build a simulink model with real-time workshop, but I've not been able to troubleshoot one error I get. The parent model in simulink references another model with an s-function and the error reads:
Error: Real-Time Workshop Error:
Model reference RTWTarget does not support non-inlined s-functions.
I'm using 2010a and am building with ert.tlc if that helps.

Best Answer

If you are using s-function for code generation, then s-function should be supported with inlining TLC file. TLC file tells RTW, how to generate code for perticular s-function and inilining a s-function is always recommended for production code generation.
If you still want to generate code from non-inlined s-function (not recommended) set Support for 'non-inlined S-functions' option ON in the Interface pane of Real-Time Workshop setting.
If you are using model referencing in Accelerator Mode see here limitation for s-function in this mode.