simulink coder typedef struct naming related problem
조회 수: 9 (최근 30일)
이전 댓글 표시
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
Kaustubha Govind
2013년 6월 27일
James: I would recommend that you contact MathWorks Tech Support about this if you don't get it resolved here.
답변 (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!