The signal names do not appear in the "rtBlockSignals" structure of the model_capi.c file generated by Real-Time Workshop 6.0 (R14) because SIMULINK cannot propagate signal labels back across virtual subsystem boundaries.
To work around this issue, label the source of the signal within the virtual subsystem boundary. SIMULINK can propagate signal labels forward across virtual subsystem boundaries, such that the output of a Subsystem block shares the same label as the output of the signal source. For example, labeling the output of a Gain block as "my_output" within the Subsystem and appropriately setting its storage class will generate code similar to the following:
/* Block output signal information */
static const rtwCAPI_Signals rtBlockSignals[] = {
/* addrMapIndex, sysNum, blockPath,
* signalLabel, portNumber, dataTypeIndex, dimIndex, fxpIndex,
sampTimeIndex
*/
{0, 0, "testme/Subsystem/Gain",
"my_output", 0, 0, 0, 0, 0},
{
0, 0, NULL, NULL, 0, 0, 0, 0, 0
}
};
Best Answer