Why do I get a warning referring to user data types when building a model with an S-function generated from Real-Time Workshop 6.5 (R2006b)?

2 views (last 30 days)
I receive a strange warning when building a model generated from right-click>Build subsystem. The files are attached.
1. Right-click>Build subsystem on start_stop_engine in EngineLogic_Stateflow.mdl
2. In the dialog, choose Build (do not check anything).
3. The S-function gets generated without error into untitled.mdl.
4. Now do a ctrl+B on the generated untitled model. The following warning is shown during the build process:
<snip>
### Caching model source code
...
Warning: Real-Time Workshop -- In block "untitled/start_stop_engine/start_stop_engine_sfcn", block type "S-Function": User-defined data type CSc1_start_stop_engine_ChartStr is required for DWork 0, but the information needed to define this data type is unknown. The generated code that normally specifies the data type of this DWork is being omitted. If additional custom code does not register this user-define data type and set the data type of this DWork, then the generated code will be incomplete.
................
<snip>
I do not understand why this error is appearing. It does not seem to affect the build process at all.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been incorporated in Release 2007a (R2007a). For previous product releases, read below for any possible workarounds:
This warning message occurs in Real-Time Workshop 6.5 (R2006b).
When you generate the S-function, RTW creates "start_stop_engine_sf" as the S-fun. Along with the MEX-file "start_stop_engine_sf.mexw32", you get the generated folder "start_stop_engine_sfcn_rtw" and a couple of wrapper files, "start_stop_engine_sf.c" and "start_stop_engine_sf.h".
Notice "start_stop_engine_sf.h" includes "start_stop_engine_sfcn_rtw/start_stop_engine_sf.h", which in turn includes "start_stop_engine_sfcn_rtw/start_stop_engine_sf_types.h" on line 46. The structure type "CSc1_start_stop_engine_ChartStr" is declared on lines 16-20 in "start_stop_engine_sfcn_rtw/start_stop_engine_sf_types.h".
When you generate code from a model, say "untitled.mdl", that contains the generated S-function, "untitled.h" includes "start_stop_engine_sf.h" on line 33. This makes sure the type is well-defined.
The warning is benign, and occurs because the type is defined in a header outside the build directory of the model and the standard directories where the libraries live. The warning indicates that there may be a build issue if the user-defined data type is not defined somewhere as part of the code being compiled. In this example, the user-defined datatype in DWORK is defined by Stateflow and exists as part of RTW build process, but in general this may not be the case, so the warning is issued.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2006b

Community Treasure Hunt

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

Start Hunting!