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

  • 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 157
5 Data Logging and Signal Monitoring
5-6
The model code file model.bio defines an array of BlockIOSignals structures,
for example:
#include "bio_sig.h"
/* Block output signal information */
const BlockIOSignals rtBIOSignals[] =
{
/* blockName,
signalName, portNumber, signalWidth, signalAddr,
dtName, dtSize */
{
"simple/Constant",
NULL, 0, 1, &rtB.Constant,
"double", sizeof(real_T)
},
{
"simple/Constant1",
NULL, 0, 1, &rtB.Constant1,
"double", sizeof(real_T)
},
{
"simple/Gain",
"accel", 0, 2, &rtB.accel[0],
"double", sizeof(real_T)
},
{
NULL, NULL, 0, 0, 0, NULL, 0
}
};
Each structure element describes one output port for a block. Thus, a given
block will have as many entries as it has output ports. In the above example,
the
simple/Gain structure has a signal named accel on block output port 0.
The width of the signal is 2.
Thearrayisaccessedviathename
rtBIOSignals by whatever code would like
to use it. To avoid overstepping array bounds, you can do either of the following:
Use the
SimStruct access macro ssGetNumBlockIO to determine the number
of elements in the array
Use the fact that last element has a
blockName of NULL.
Zobrazit stránku 157
1 2 ... 153 154 155 156 157 158 159 160 161 162 163 ... 385 386

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

Žádné komentáře