How do I create an output port for a C caller block?

조회 수: 3 (최근 30일)
Bob Gastineau
Bob Gastineau 2020년 1월 3일
답변: Ganesh Regoti 2020년 1월 14일
I have having issue when adding a point variable to a function that is used in c caller.
If I set this variable as an output using the block paramers dialog block, I get a compiler error that it does not know the size of the data type.
If I try to set the size = 1, it always reverts the size back to -1.
I need to get resolution on this issue ASAP.
thanks.

답변 (1개)

Ganesh Regoti
Ganesh Regoti 2020년 1월 14일
Hi,
As per my understanding, you are creating a point variable in the function and trying to return it. But it is not possible as of now. Instead you can do the following
  1. Send the point variable as a argument to the function.
  2. In block parameters of Caller block, change the scope of the variable to InputOutput format.
CCaller block -> block parameters -> Port Specification -> Scope
  1. Refresh the caller block, the input and output ports get updated.
Hope this helps!

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by