User`s guide

6 Program Architecture
6-16
that have a task identifier of 0. This results in differences in the logged values
between singletasking and multitasking logging. Specifically, consider a model
with two sample times, the faster sample time having a period of 1.0 second
and the slower sample time having a period of 10.0 seconds. At time t = k*10,
k=0,1,2... both the fast (tid=0) and slow (tid=1) blocks have a hit. When
executing in multitasking mode, when LogTXY is called, the slow blocks will
have a hit, but the previous value will be logged, whereas in singletasking the
current value will be logged.
Another difference occurs when logging data in an enabled subsystem.
Consider an enabled subsystem that has a slow signal driving the enable port
and fast blocks within the enabled subsystem. In this case, the evaluation of
the enable signal occurs in a slow task and the fast blocks will see a delay of
onesampleperiod,thustheloggedvalueswillshowthesedifferences.
To summarize differences in logged data between singletasking and
multitasking, differences will be seen when:
Any root outport block that has a sample time that is slower than the fastest
sample time
Any block with states that has a sample time that is slower than the fastest
sample time
Any block in an enabled subsystem where the signal driving the enable port
is slower than the rate of the blocks in the enabled subsystem
For the first two cases, even though the logged values are different between
singletasking and multitasking, the model results are not different. The only
real differences is where (at what point in time) the logging is done. The third
(enabled subsystem) case results in a delay that can be seen in a real-time
environment.
Differences Between Rapid Prototyping
and Embedded Model Execution
The rapid prototyping program framework provides a common application
programming interface (API) that does not change between model definitions.
The embedded program framework, in contrast, provides a optimized API that
is tailored to your model. It is intended that when you use the embedded style
of generated code that you are modeling how you would like your code to
execute in your embedded system. Therefore, the definitions defined in your
model should be specific to your embedded targets. Items such as the model