MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guida Utente Pagina 161

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 386
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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.
Vedere la pagina 160
1 2 ... 156 157 158 159 160 161 162 163 164 165 166 ... 385 386

Commenti su questo manuale

Nessun commento