C function calls and multiple calls from simulink

11 Ansichten (letzte 30 Tage)
Ben Griffiths
Ben Griffiths am 3 Mai 2023
Beantwortet: Jonas am 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.

Antworten (1)

Jonas
Jonas am 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.

Kategorien

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

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by