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

조회 수: 6 (최근 30일)
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
azeddine
azeddine 2024년 7월 4일
hi, i have the same error can u give the solution

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile 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!

Translated by