필터 지우기
필터 지우기

How to call a Library Functions void XXX (void) generated by Simulink/ert_shrlib.tlc using M script

조회 수: 22 (최근 30일)
I convert a simulink model to a shared library function by Simulink/ert_shrlib.tlc.
The model hava four input, Add1,Add2,Sub1,Sub2, and two output, AddOut, SubOut.
The functions definition in the generated header file is
void dllTest_initialize(void), void dllTest_step(void), void dllTest_terminate(void).
All the ports are defined as structure:
/* External inputs
typedef struct {
XXX
} ExtU_dllTest_T;
/* External outputs
typedef struct {
XX
} ExtY_dllTest_T
The .c file defines the external ports
ExtU_dllTest_T dllTest_U;
ExtY_dllTest_T dllTest_Y;
The dllTest_initialize is
void dllTest_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(dllTest_M, (NULL));
/* external inputs */
(void)memset((void *)&dllTest_U, 0, sizeof(ExtU_dllTest_T));
/* external outputs */
(void) memset((void *)&dllTest_Y, 0,
sizeof(ExtY_dllTest_T));
}
I want know to how to pass a value before calling the dllTest_initialize and dllTest_step.
I can creat a C structure and Pointer using
InputStruc=libstruct('ExtU_dllTest_T',Input);
InputPtr=libpointer('ExtU_dllTest_TPtr',InputStruc);
BUT don't know how to pass it to input ExtU_dllTest_T dllTest_U.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by