MATLAB: Is it possible to use a Multiport Switch to select between several buses in Simulink 6.1 (R14SP1)

busdifferentlimitationmultiportsignalssimulinkswitch

I am using a Multiport Switch to select between bus signals in my model Example.mdl. It works only if both of the busses into the Multiport Switch contain an identical set of signal names. If a unique signal name is added to one of the busses (as shown) then I receive the following error:
example/Bus Selector' must be connected to a Bus Creator, Bus Selector or a block that outputs a bus using a bus object. It can also be connected to bus capable blocks that meet the conditions for supporting buses provided the bus entering the block has been created by using a bus creator
In example2.mdl, if I changed the signal size for one of the named signals
in bus one, then I receive the following error: ERROR: Incoming buses to block 'example2/Multiport Switch' have a dimension mismatch. The signal at input port 1 of 'example2/Bus Creator' is of width 2, while its corresponding signal at input port 1 of 'example2/Bus Creator1' is of width 1

Best Answer

It is possible to use a Multiport Switch to select between several bus
signals in Simulink 6.1(R14SP1) but there are some limitations as described below:
1. The busses can pass through Switch blocks when the signal names on both busses are the same. This is because downstream of the Switch block, bus selectors will reference signals out of the bus by name. In order to be able to switch between busses upstream, the names need to be the same such that the signal selections are still valid.
2. Different signals can have the same name as long as the signals are using Auto Storage Class.
3. The mixed signals for the Switch block in Simulink are not supported.
There are currently no known workarounds.