필터 지우기
필터 지우기

How to transfer arrays in bus? Error is, destination block requires a bus signal with different structure than the signal connected to it

조회 수: 13 (최근 30일)

답변 (1개)

Githin George
Githin George 2023년 12월 15일
Hi Sumeet,
It is my understanding that you are using the legacy tool to integrate C function whose arguments are pointers to structures, and you are facing issues related to signal propagation.
You can make the following changes in your MATLAB script and Simulink model to resolve the issue:
  • Change line 13 in the script Test_Integ.m to
ad2.OutputFcnSpec = ['void myFcn(sigStructType u1[1], sigStructType y1[1])'];
% as the syntax `[1]` denotes that the argument is a pointer.
  • Delete the block “Bus Creator2” as the output of “Constant” block is already a 2x1 double vector.
  • Change the output data type of the block “Bus Creator1” to “Bus: sigStructType” in the block parameters and match the name of the 2 input signals to the corresponding names in “sigStructType” struct.
  • On simulation, you can see the outputs in the display block.
I hope the above steps help in resolving your issue.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by