フィルターのクリア

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

22 ビュー (過去 30 日間)
APTX4869
APTX4869 2019 年 1 月 15 日
編集済み: APTX4869 2019 年 1 月 15 日
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 Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by