External Mode vs. Normal Mode
In external mode, Simulink Coder is used to dynamically link generated algorithm code with generated hardware driver code. The resulting executable runs in Windows kernel mode and communicates with Simulink via External Mode.
In normal mode, the algorithm runs in Simulink and the I/O drivers run in a separate Windows kernel mode process that maintains the real-time clock.
The following diagram illustrates the difference between these two modes:
Advantages of Normal Mode
As you can guess based on the above diagram, normal mode offers lower performance when compared to external mode. On the other hand, normal mode offers interesting advantages:
- Support for variable step solvers
- No need for Simulink Coder
You can also use Normal Mode on Windows 64-bit, where External Mode is only supported in Windows 32-bit as of R2012a.
How does that work?
Most blocks in the Real-Time Windows Target library have at least 2 parameters: Sample Time and Maximum missed ticks.
Since, in normal mode, only the I/O drivers are synchronized with the real-time clock, it is possible for the simulation to miss clock ticks. When this happens, the Maximum missed ticks parameter determines how your model should behave. Set it to a value of zero if you want your model to error out at the first missed tick. Use a larger value if your application can deal with a few missed ticks. Note that, if the model misses a few ticks, it will resynchronize with the real-time clock as soon as possible.
Now it's your turn
Do you think Real-Time Windows Target normal mode will be useful for you? Leave a comment here.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.