Code Generation for Model Reference containing noninlined S-Function
7 次查看(过去 30 天)
显示 更早的评论
I have a Simulink model that contains a hand written level 2 C S-Function (for which I have an associated mex file).
This model is included as a model reference in a top level model.
I can generate code at the sub model level containing the S-Function.
When I attempt to generate code at the top model level, I receive an error as below where it attempts to load an empty string as a file, but I cannot see where this empty string is coming from or if I can set it somewhere.
Is it possible to generate code at the top level without inlining the s-function?
Note that the simulation executes from the top level correctly, I just cannot build.
Error using loadTMF
File I/O error on file ''
Operation that caused an error: open
The error that occurred was:
Cannot open file. Existence? Permissions? Memory? . . .
Error in rtwprivate (line 16)
[varargout{1:nargout}] = feval(function_name, varargin{1:end});
Error in coder.internal.processSFunctions
Error in coder.internal.processSFunctions
Error in coder.internal.processSFunctions
Error in coder.internal.ModelBuilder/locNewCodePostCodeGen (line 1616)
coder.internal.processSFunctions( h.ModelName, ...
Error in coder.internal.ModelBuilder/buildProcedure (line 694)
[lCodeGenerationId, rpt_generated_flag] = obj.locNewCodePostCodeGen...
Error in coder.internal.ModelBuilder/make_rtw (line 176)
buildResult = buildProcedure(obj, h, modelName, cs, isSimBuild, lReportInfo);
Error in coder.internal.ModelCodegenMgr/make_rtw (line 8)
buildResult = obj.make_rtw(varargin);
Error in make_rtw (line 18)
buildResult = h.make_rtw(varargin{:});
Error in build_target
Error in build_target
Error in build_model_reference_target
Error in update_model_reference_targets
Error in update_model_reference_targets
Error in update_model_reference_targets
Error in update_model_reference_targets
Error in update_model_reference_targets
Error in build_standalone_rtw_target
Error in slbuild_private
Error in slbuild_private
Error in sl (line 15)
[varargout{1:nargout}]=feval(varargin{:});
Error in slbuild (line 61)
sl('slbuild_private', mdl, varargin{:});
Error in build (line 26)
slbuild('Tata_LPO_1512TC', 'StandaloneRTWTarget','ForceTopModelBuild',true);
0 个评论
采纳的回答
Prashant Arora
2017-4-27
Hi Chris,
The function loadTMF seems to be related to template make file. Which System target file are you using in your top model? Are you using a toolchain approach or template make file approach?
It is possible to generate code from a referenced model containing a C-mex S function. However, there are a few things which Simulink may ask you to do like setting the "Total Number of Instances of Referenced model allow in top model" to be One and enabling "Support non-inlined S-functions".
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!