simulink real time task excution time

why the maximum task execution time is very importante vs avrage task execut time in simulink real time? what is happened in this case to take all this time to excute the same task?.

Risposte (1)

Fangjun Jiang
Fangjun Jiang il 7 Ago 2019
In your task, you might have some conditional statements. If the condition is met, certain codes or blocks are executed thus take longer time to finish than when the condition is not met. To ensure your task is able to execute in "real time" continuesly, you need to make sure the maximum task execution time is smaller than the step time of the task. In other words, you can only slow down (by puasing or inserting delay), but you can't speed up to make "real time".

6 Commenti

Thank you for your answer
I have do the test by using very small model "2 number addition"; 1+1
In Theory no conditional statements: but I got 0.094us as minimum TET, 0.226uS as average TET and maximum is more than 89us (394 time vs average).
So you mean that, i can only use a sampling time about 100us (10ksps) to run task (1+1) on CPU 10core 2.2 GHz (old 8bit microprocessor can execute this task fast than 10ksps).
slrt.png
As much as it sounds unbelieveable, it is true. A dedicated microprocessor with a real-time operating system can perform better for this task than a high power CPU running on a non-real time operating system. The critical part here is the operating system.
In this case, the "conditional" execution (or max/worst execution) is not the content in your Simulink model. But rather, they are the other tasks that your computer/CPU needs to take care of. You must be aware that there are tons of processes/tasks running on your computer CPU (e.g. Windows processes). Simulink Real-time Toolbox is trying to give you a "real-time" effect using the non-realtime operation system (such as Windows). This simulation task can't be put on a high-up enough priority based on the Windows operationg system. Thus, it needs to give margin to try to guarantee that it can run at a once-per-100us rate, but not faster.
hello
simulink real time target no have any Operating system (no windows or other) only a reat time simulink kernel and my application so no windows processes.
other strange problem a 100us rate in XEON 10 core 2.2ghz CPU and only 20us rate in ATOM 2 core 1.8ghz.
Are you using "Simulink Desktop Real-Time" or "Simulink Real-Time"?
Simulink Desktop Real-Time supports real-time performance up to 1 kHz sample rates with Simulink, and up to 20 kHz with Simulink Coder™.
simulink real-time
Contact the Mathworks tech support

Accedi per commentare.

Tag

Richiesto:

il 7 Ago 2019

Commentato:

il 16 Ago 2019

Community Treasure Hunt

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

Start Hunting!

Translated by