MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Uživatelská příručka Strana 182

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 386
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 181
6 Program Architecture
6-20
The general content of the rapid prototyping style of code for C is shown in the
following figure.
Figure 6-3: Content of Model.c for the Rapid Prototyping Code Style
/*
* Version, Model options, TLC options,
* and code generation information are placed here.
*/
<includes>
void MdlStart(void)
{
/*
* State initialization code.
* Model start-up code - one time initialization code.
* Execute any block enable methods.
* Initialize output of any blocks with constant sample times.
*/
}
void MdlOutputs(int_T tid)
{
/* Compute: y = f0(t,xc,xd,u) for each block as needed. */
}
void MdlUpdate(int_T tid)
{
/* Compute: xd+1 = fu(t,xd,u) for each block as needed. */
}
void MdlDerivatives(void)
{
/* Compute: dxc = fd(t,xc,u) for each block as needed. */
}
void MdlTerminate(void)
{
/* Perform shutdown code for any blocks that
have a termination action */
}
/* Model registration */
#include "model.reg"
Zobrazit stránku 181
1 2 ... 177 178 179 180 181 182 183 184 185 186 187 ... 385 386

Komentáře k této Příručce

Žádné komentáře