Merge Message Connections for Architectures Using Adapter Block
This example shows how to use an Adapter block to merge multiple message connections in a System Composer™ architecture model.
Open the model.
systemcomposer.openModel('mSysArchMessageMerge');In this model, message-based communication is constructed between three components: two send components, SAC1 and SAC2, create messages and send them to a receive component, SAC3.
The
SAC1component linked to the Simulink® behavior modelmBottomupMsg1generates messages with a value of1in every0.1interval of sample time..The
SAC2component linked to the Simulink behavior modelmBottomupMsg2generates messages with a value of8in every0.2interval of sample time.The
SAC3component linked to the Simulink behavior modelmBottomupMsg3receives the merged messages using a rate-based Subsystem block in every0.5interval of sample time.
A first-in, first-out (FIFO) queue serves as a message buffer between the components.

You can double-click the Adapter block to view the Interface Adapter dialog box. Confirm that the interface conversion selection is Merge. Mappings are now disabled.

Simulate the model to merge the messages from the send components SAC1 and SAC2 produced by Simulink behaviors into a single destination, the receive component SAC3.
sim('mSysArchMessageMerge');Launch the Simulation Data Inspector to view the three messages together on the same diagram.
Simulink.sdi.view

See Also
Simulation Data Inspector | Adapter | Send | Receive