How to correctly specify Stateflow Custom Target in Stateflow Ver.7.7 (R2011a)

2 views (last 30 days)
With Stateflow Version 7.7, I try to reproduce the results of a tutorial–Automatic Code Generation from Stateflow™ for Palm OS™ handhelds http://www.mathworks.com/company/newsletters/digest/december00/codegen.html. Yet, it never succeeds.
Two Parse Errors popped up while I was executing Build Actions in Stateflow Custom Target: sfdemo/palm in Model Explorer, saying,
"Unresolved function 'WinDrawChars' in transition {WinEraseChars("State 1",7,30,50);
WinDrawChars("State 2",7,100,50);} (#149)," and
"Unresolved function 'WinEraseChars' in transition {WinEraseChars("State 1",7,30,50);
WinDrawChars("State 2",7,100,50);} (#149)."
The same errors are never fixed even if I include their function declarations copied from the include folder of Palm OS SDK, which is Garnet OS Development Suite. They are
void WinDrawChars (const Char *chars, Int16 len, Coord x, Coord y);
void WinEraseChars (const Char *chars, Int16 len, Coord x, Coord y);
On the other hand, I do have Stateflow Ver.4.1 (R12.1), which is very similar to the Stateflow Ver.4 applied in the tutorial; almost every step runs well in Stateflow Ver.4.1, except that a data type, uint8_T, in the generated C code has to be corrected into int8_T.
Is there any difference among Stateflow Custom Target in Stateflow Ver.7.7 and Stateflow Ver.4.1? Why cannot I reproduce the results, using the newer version?

Answers (1)

Kaustubha Govind
Kaustubha Govind on 31 Oct 2011
I am not familiar with the demo you pointed to, but when custom code is called from Stateflow, the corresponding header and library files must be included in the build process. See Integrating Custom C Code for Nonlibrary Charts for Simulation to see how you can configure the Simulation Target>Custom Code pane of the Configuration Parameters window - this is required for model compilation and simulation. For the same build rules to be used for code generation, select Use the same custom code settings as Simulation Target in the Code Generation pane.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!