Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Bob Gastineau
Bob Gastineau le 3 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.

Réponses (1)

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


En savoir plus sur Simulink Functions dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by