C function calls and multiple calls from simulink

4 vues (au cours des 30 derniers jours)
Ben Griffiths
Ben Griffiths le 3 Mai 2023
I am trying to call multiple instances of the same c-library however only the first c caller block (alphabetically) executes properly the second issues an error (from the c library).
In example 1 only the first entity is found but if I rename the call function (example 2) only the second entity is found. I think this is a Simulink runtime issue where the function calls are clashing and only the first one (alphabetically) runs properly. Not sure how to resolve so that more than one entity can be read in as only the first function call executes properly.
This seems to happen regardless of the actual call issued to the C library my suspicion is that its something to do with Simulinks run time and having multiple calls to the same c dll library.

Réponses (1)

Jonas
Jonas le 3 Mai 2023
I do not deeply understand the issue, but I would like to propose the following. Create a Simulink Function block in your model and put your C-caller inside it. Use Inport and Outport argument blocks inside it to connect to the C caller block. Now replace the C-caller blocks you had in your Enabled Subsystems 'GetData' with Function Calller blocks to the Simulink Function. This way you are calling the Simulink Function block multiple times from different places, but you only have one C-caller block in your model.

Catégories

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

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by