MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guide de l'utilisateur Page 161

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 386
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 160
Using BlockIOSignals to Obtain Block Outputs
5-9
Below is an excerpt from an example routine that collects signals taken from
the main simulation loop:
/*******************************************
* Step the model for the base sample time *
*******************************************/
MdlOutputs(FIRST_TID);
#ifdef MAT_FILE
if (rt_UpdateTXYLogVars(S) != NULL) {
fprintf(stderr,"rt_UpdateTXYLogVars() failed\n");
return(1);
}
#endif
#ifdef STETHOSCOPE
ScopeCollectSignals(0);
#endif
MdlUpdate(FIRST_TID);
<code continues ...>
The Real-Time Workshop provides a mechanism that allows your application
program to monitor block outputs during program execution.
All block output data is written to the
SimStruct at each step through the
model code. However, to access the output of any given block in the
SimStruct,
you must know the index into the
BlockIO vector where the data is stored, as
well as how many output ports the block has and the width of each output. All
of this information is contained in the
ModelBlockInfo data structure.
The
ModelBlockInfo data structure is created by the generated code only if you
define the flag
USE_MDLBLOCKINFO when you build your program. Otherwise,
ModelBlockInfo is not created.
Note that, depending on the size of your model,
ModelBlockInfo can consume
a considerable amount of memory.
Vue de la page 160
1 2 ... 156 157 158 159 160 161 162 163 164 165 166 ... 385 386

Commentaires sur ces manuels

Pas de commentaire