User`s guide

8 Targeting Tornado for Real-Time Applications
8-10
Multitasking. Optionally, the model can run as multiple tasks, one for each
sample rate in the model.
tBaseRate This task executes the components of the model code run at the
base (highest) sample rate. By default, it runs at a relatively high priority
(30), which allows it to execute without interruption from background
system activity.
tRaten The program also spawns a separate task for each additional
sample rate in the system. These additional tasks are named
tRate1,
tRate2,…,tRaten,wherenis slowest sample rate in the system. The
priority of each additional task is one lower than its predecessor (
tRate1 has
a lower priority than
tBaseRate).
Supporting Tasks. If you select external mode and/or StethoScope during the
build process, these tasks will also be created:
tExtern — This task implements the server side of a socket stream
connection that accepts data transferred from Simulink to the real-time
program. In this implementation,
tExtern waits for a message to arrive from
Simulink. When a message arrives,
tExtern retrieves it and modifies the
specified parameters accordingly.
tExtern runs at a lower priority than tRaten, the lowest priority model task.
The source code for
tExtern is located in matlabroot/rtw/c/src/ext_svr.c.
tScopeDaemon and tScopeLink — StethoScope provides its own VxWorks
tasks to enable real-time data collection and display. In singletasking mode,
tSingleRate collects signals; in multitasking mode, tBaseRate collects them.
Both perform the collection on every base time step. The StethoScope tasks
then send the data to the host for display when there is idle time, that is,
when the model is waiting for the next time step to occur.
rt_main.c starts
these tasks if they are not already running.