Why doesn't referenced model have proper tcl files?

6 views (last 30 days)
Jay
Jay on 25 Oct 2014
Answered: Sandip Kumar on 28 Oct 2014
I have a simulation that runs just fine without a referenced model. When I change one of the blocks to a referenced model, it passes all of the checks and builds the model just fine. But when I then run the simulation with the referenced model replacing the original block, I get the following error: (in response to command SimOut=sim(mdl))
Error reported by S-function 'PV_Inv_Ctrls0_msf' in 'AvgAndSW_141017/3PH INV/TmpSFcnForModelReference_PV Inv Ctrls': S-function discreteVariableTransportDelay does not have a tlc file. It cannot use macros that access regDataType field in simstruct.

Answers (1)

Sandip Kumar
Sandip Kumar on 28 Oct 2014
Model reference, with S-functions have limitations and in Accelerator mode need to take care of few things in the S-function. The details are mentioned here: http://www.mathworks.com/help/simulink/ug/model-referencing-limitations.html#brazo0s-1_1
Also are you running Model Reference in Normal mode or Accelerator mode?
The following document covers usages of S-functions inside a Model reference: http://www.mathworks.com/help/simulink/ug/using-s-functions-with-model-referencing.html
Furthermore, for the S-function, do you have a TLC file? If so, use the SS_OPTION_USE_TLC_WITH_ACCELERATOR as mentioned in the above links.
Furthermore, for Normal Mode Model Reference and usage of S-functions, please read this section: http://www.mathworks.com/help/simulink/ug/using-s-functions-with-model-referencing.html#bsp24qn-6
Thanks, Sandip

Community Treasure Hunt

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

Start Hunting!