User`s guide
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.