simulink coder typedef struct naming related problem
5 views (last 30 days)
Show older comments
Hi,
I have a Simulink generated code like below:
33 /* Macros for accessing real-time model data structure */
34
35 /* Block signals (auto storage) */
36 typedef struct {
37 int8_T inputevents[6]; /* '<S1>/Chart' */
38 } BlockIO;
39
40 /* Block states (auto storage) for system '<Root>' */
41 typedef struct {
42 int32_T sfEvent; /* '<S1>/Chart' */
43 uint8_T is_c1_Subsystem; /* '<S1>/Chart' */
44 } D_Work;
45
46 /* Zero-crossing (trigger) state */
47 typedef struct {
48 ZCSigState Chart_Trig_ZCE[6]; /* '<S1>/Chart' */
49 }
And I got an error when I try to compile it with a cross compiler(8051 microcontroller based) about struct size expectation thats related to naming. The compiler does not have any option to fix this error.
So, I have to change the generated code like this: (Naming is not important)
33 /* Macros for accessing real-time model data structure */
34
35 /* Block signals (auto storage) */
36 typedef struct BlockIO_tag{
37 int8_T inputevents[6]; /* '<S1>/Chart' */
38 } BlockIO;
39
40 /* Block states (auto storage) for system '<Root>' */
41 typedef struct D_Work_tag{
42 int32_T sfEvent; /* '<S1>/Chart' */
43 uint8_T is_c1_Subsystem; /* '<S1>/Chart' */
44 } D_Work;
45
46 /* Zero-crossing (trigger) state */
47 typedef struct ZCSigState_struct{
48 ZCSigState Chart_Trig_ZCE[6]; /* '<S1>/Chart' */
49 } ZCSigState_type;
How can I generate the code with the format like upper? (typedef struct's fully named)
I think older versions of Simulink(2002 - 2003) was generated the global types like this but not the newer versions(2008 or upper).
Regards, James
1 Comment
Kaustubha Govind
on 27 Jun 2013
James: I would recommend that you contact MathWorks Tech Support about this if you don't get it resolved here.
Answers (0)
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!