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

3 Ansichten (letzte 30 Tage)
Bob Gastineau
Bob Gastineau am 3 Jan. 2020
Beantwortet: Ganesh Regoti am 14 Jan. 2020
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.

Antworten (1)

Ganesh Regoti
Ganesh Regoti am 14 Jan. 2020
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!

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by