MATLAB: Is the Real-Time Workshop generated code of the subsystem erroneous when working with frame-based inputs/outputs

buildframe-basedrtwsimulink codersubsystem

When using the RTW option, 'Build Subsystem', for a subsytem that has frame-based input, the code for the generated subsystem treats the input as sample-based.
My model contains an 'Integer Delay' from the DSP Blockset. In the generated code, it behaves as if defined for sample-based signals, but my model uses frame-based signals.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This is a bug in the Real-Time Workshop in the way that code is generated for subsytems with frame-based input.
A possible workaround is to use the 'Frame Status Conversion' block from the DSP library 'Signal Management' - 'Signal Attributes':
1. Change the input to the subsystem to sample-based signals (outside the subsystem).
2. Within the subsystem change the status back again - if desired
This also works (and is required) as a workaround for the frame-based output ports.