User`s guide

1 Introduction to the Real-Time Workshop
1-20
assigning buffers to each input and output. Compare this to the MdlOutputs
function generated with buffer optimizations turned off.
void MdlOutputs(int_T tid)
{
/* Sin Block: <Root>/Sine Wave */
rtB.sin_out = rtP.Sine_Wave_Amp *
sin(rtP.Sine_Wave_Freq * ssGetT(rtS) + rtP.Sine_Wave_Phase);
/* Gain Block: <Root>/Gain */
rtB.gain_out = rtB.sin_out * rtP.Gain_Gain;
/* Outport Block: <Root>/Out1 */
rtY.Out1 = rtB.gain_out;
}
Note that the labels sin_out and gain_out that were placed in the model
depicted in Figure 1-4 appear in the code of
MdlOutputs when no optimizations
take place. For further information on the contents of
model.c files, refer to
Chapter 3, “Code Generation and the Build Process.”
Bundled Target Systems
The Real-Time Workshop provides sample implementations that illustrate the
development of real-time programs under DOS and Tornado, as well as generic
real-time programs under Windows95, Windows 98, Windows NT, and UNIX.
These sample implementations are located in
matlabroot/rtw/c/grt Generic real-time examples
matlabroot/rtw/c/dos — DOS examples
matlabroot/rtw/c/tornado — Tornado examples
In addition to bundled systems provided by The MathWorks, third party
vendors such as dSPACE provide real-time targets for a wide variety of rapid
prototyping environments. For an example of a dSPACE implementation, see
“Building a Real-Time Executable with dSPACE’s RTI” on page 2–30.