The blocks that control RS-232 communication with the xPC Target are implemented with S-functions. S-functions are a feature of Simulink that allow you to incorporate code in several different programming languages, such as C, M, and Fortran.
When you use Real-Time Workshop to generate code from a block diagram with S-functions, you can inline them. This incorporates the C source of the S-function with the C source generated by Real-Time Workshop. This eliminates the need to refer to an external C source file for the S-function. This inlining process is controlled by the Target Language Compiler (TLC) files.
The Model Reference functionality has a limitation in that it only supports S-functions that can be inlined, or those that have TLC files. The xPC Target RS-232 communication blocks do not currently support inlining.
To work around this, keep all the communication blocks in the top model and add additional ports to your referenced model to allow it to pass communications to these blocks.
Best Answer