xil_interface.c build error during SIL simulation of custom interface Simulink Model

6 ビュー (過去 30 日間)
Nicolas Salazar
Nicolas Salazar 2020 年 4 月 7 日
コメント済み: azeddine 2024 年 7 月 4 日
Hi,
I have a Simulink model that generates code with the following Code interfaces settings:
  • Code interface packaging: Reusable function
  • Pass root-level I/O as: Individual arguments
I have also customized the prototype of the model step function to look like this:
arg_d = testmodel_step(*self, cntrl_t arg_x, cntrl_t arg_y)
where arg_x and arg_y are arguments passed by value. These arguments are of type cntrl_t, which as a custom struct type imported from an external header file.
I am able to simulate the model in normal mode and build the generated code without problems. However, when I try to run a SIL simulation of my model as a SIL model block with Top model interface within a test harness model I get this error:
C:/Repos/testmodel/testmodel_ert_rtw/sil/xil_interface.c:327:7: error: invalid type argument of unary '*' (have 'cntrl_t {aka struct <anonymous>}')
*(arg_x), *(arg_y));
^~~~~~~~~~~~~~~~~~~~
C:/Repos/testmodel/testmodel_ert_rtw/sil/xil_interface.c:327:29: error: invalid type argument of unary '*' (have 'cntrl_t {aka struct <anonymous>}')
*(arg_x), *(arg_y));
^~~~~~~~~~~~~~~~
My toolchain is MinGW64 gmake (64-bit Windows).
Why does the code generator for the SIL interface try to dereference the step function arguments if they are not pointers?
I checked the xil_interface.c file and the interface data are actually declared correctly as variables and not pointers.
Do I need to configure my model code generation in a special way to fix this error?
Thank you,
Nicolas.
  3 件のコメント
Maddi
Maddi 2023 年 8 月 4 日
hello, do yo fix the error?
azeddine
azeddine 2024 年 7 月 4 日
hi, i have the same error can u give the solution

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by