How does the time step work when using Simulink external mode?

7 views (last 30 days)
I am creating a Simulink model which I will run using external mode. I would like to know how the time step on external mode works.
Does Simulink send a signal to the target on every time step?
How small can the time step be?
What happens if I set the time step too small?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Apr 2024 at 0:00
Edited: MathWorks Support Team on 17 Apr 2024 at 17:32
When you run a model in external mode, the code for the model is generated and deployed to the target. On the target, the output calls are configured to send data back to Simulink which is why you can see the output in the Simulink canvas/scopes. The target manages its own time step and does not receive any information from Simulink other than packaged messages if a variable has been changed or if a command is given on the Simulink side.
The minimum time step mostly depends on the hardware being used. If you set the time step too small, there may not be enough time for the data output in which case either the data will get cut off or the simulation will lag (depending on overrun settings).
There are a few useful links in the MATLAB Documentation which may be able to provide more detail than my explanation above:
1) Here is a description of external mode that describes how time steps are calculated:
2) This page discusses the various communication protocols associated with external mode
3) Page on multitasking which might help speed up external mode execution:

More Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!