MATLAB: Do I receive an error when I run SIL simulation of a model, which includes a Model block of a Stateflow chart with custom code in Simulink 7.8 (R2011b)

ccodecustomexternalreferencereferencedset_paramsilsimulinkstateflowsymbol [~]unresolved

I have a Simulink model that contains a Model block. The referenced model has a Stateflow chart which calls a custom C function. When I run simulation in SIL mode, I receive the following error:
fatal error LNK1120: 1 unresolved externals
C:\MATLAB32\R2011B\BIN\MEX.PL: Error: Link of '..\..\..\mySfModelRef_customC_msf.mexw32' failed.

Best Answer

The ability to simulate a model that contains Model blocks with custom code in SIL mode has been incorporated in R2010a. For this, you will need to enable the option 'SupportModelReferenceSimTargetCustomCode' for the referenced models by executing the following command on the MATLAB Command Window:
set_param(gcs, 'SupportModelReferenceSimTargetCustomCode', 'on');