MATLAB: Do I get an error when building the model containing a Merge block with xPC Target 2.6 (R14)

handillegalmergerightrtw.makertw.make_rtwscopeside;Simulink Real-Timexpc

I have a model with a Scope block following a Merge block. When I try to build my model for the xPC Target, I get the following error messages:
Error using ==> RTW.makertw.make_rtw
Illegal right hand side in assignment. Too many elements.
Error building Real-Time Workshop target for block diagram 'TestSwitchCase_New'. MATLAB error message:
Error using ==> slbuild
Error using ==> RTW.makertw.make_rtw
Illegal right hand side in assignment. Too many elements
The model builds fine for the GRT.

Best Answer

We have verified that there is a bug in xPC Target 2.6 (R14) in the way that it handles a Merge block followed by a Scope block. To work around this issue, add a Gain block with a gain of 1 after the Merge block and before the Scope block.