필터 지우기
필터 지우기

Problem with overlapping of S-functions in embedded program

조회 수: 2 (최근 30일)
Alberto Prudhomme
Alberto Prudhomme 2016년 8월 12일
편집: Alberto Prudhomme 2016년 8월 12일
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.
Thanks Regards

답변 (0개)

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by