MATLAB: Do I get an error when I build the linked subsystem in Real-Time Workshop 5.1 (R13SP1)

buslinkedrtwsimulink codersubsystemtreatasatomicunit

I have a model that includes a linked subsystem. The linked subsystem uses bus I/O. When I try to build the subsystem, I get the following error:
Error generating S-function for block
'fullvehicle/EMS/EMS_app_sw/Mode_Logic' in block diagram 'fullvehicle'.
MATLAB error message:
Error using ==> set_param
Cannot change param 'TreatAsAtomicUnit' of block 'Mode_Logic/Mode_Logic' because this block is a linked block. The parameter can only be changed on the master block in the library
However, when I build the system again, it works correctly.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
We have verified that there is a bug in Real-Time Workshop 5.1 (R13SP1) in the way that it handles building a linked subsystem that uses bus I/O. To work around this issue, you can disable the link for the subsystem or build the subsystem twice.