simulink coder typedef struct naming related problem

5 Ansichten (letzte 30 Tage)
jamesjoana
jamesjoana am 27 Jun. 2013
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 Kommentar
Kaustubha Govind
Kaustubha Govind am 27 Jun. 2013
James: I would recommend that you contact MathWorks Tech Support about this if you don't get it resolved here.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by