Call a simulink function from an s-function

1 visualización (últimos 30 días)
Mario Weyrich
Mario Weyrich el 3 de Mzo. de 2025
Editada: Mario Weyrich el 14 de Mzo. de 2025
How can I call a simulink function from within an own s-function block?
(There are examples of how to output a function call triggering a function call subsystem. But that's not intended.)
Basically I want to rebuild the existing "Function Caller" block with an own s-function. How does s-function code look like for such an approach?
And will it be linked/ shown by function connectors if simulink function is provided?
Thanks.

Respuesta aceptada

Sivsankar
Sivsankar el 6 de Mzo. de 2025
It is indeed possible to call a Simulink function from an S-function. For a comprehensive understanding of the various methods to call a Simulink function, please refer to the following MathWorks documentation:
To learn about declaring a call from an S-function, you can consult the documentation on 'ssDeclareFunctionCaller':
For information on making the actual call at runtime using 'ssCallSimulinkFunction' (which should be implemented in either the mdlUpdate or mdlOutput methods), please see the following resource:
  1 comentario
Mario Weyrich
Mario Weyrich el 13 de Mzo. de 2025
Editada: Mario Weyrich el 14 de Mzo. de 2025
:) Thank you very much, that helped a lot!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by