Problem with overlapping of S-functions in embedded program
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello to all,
I have a problem with my project of an autopilot for an UAV. I'm using a launchpad Tiva C and I'm making an embedded program.
The problem is that I'm using a GPS (by UART), Radio Link (by UART) and an IMU (by I2C) and in Simulink I made a s-function in C for each hardware to read the data.
When I tested each hardware separately all works fine, but when I tried to run all the blocks at the same time with these samples times:
-GPS every 1 sec
-IMU every 0.01sec
-Radio link every 3 sec
The program hangs in a few seconds, so I suppose that the problem is that the first S-functions initiate but the simulink program continue and initiate the second S-function so the S-function overlap and get blocked, so I decided to use subsystems with diferent triggers but the same occurs. I tried to use function caller with mux but the same.
The problem is because the diferent rate of calling for each s-functions in some moment the calling will be in the same time.
So I need to find the way to run one s-function and wait it to finish the process and then run the next, but I don't have idea of how do that.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155673/image.png)
Thanks Regards
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Block and Blockset Authoring 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!