Why 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)?

6 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 May 2020
Edited: MathWorks Support Team on 22 May 2020
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');

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products


Release

R2011a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!