I've a model.slx which has 2 inports with 2 datatypes of equivalent child busses. These child buses are fed into a subsystem, for further processing.
I want the feed bus be switching from source inport 1 to inport 2, based on a certain condition. I'm using switch block for this.
To exlempify this:
- Bus1 and Bus2 at in1 and in2, whose child busses are selected using a busSelector.
- Bus1_child1 and Bus2_child1 are to be fed to a certain subsystem, and are inputs of a switch block (at inport 1 and 3).
- Swicth block has a condition making it switch between both busses.
- But it gives an error:
Data type mismatch. Input port 3 of 'switch_demo/Switch1' expects a signal of data type 'Bus2_child1'. However, it is driven by a signal of data type 'Bus1_child1'.
Data type mismatch. Output port 1 of 'switch_demo/From1' is a signal of data type 'Bus1_child1'. However, it is driving a signal of data type 'Bus2_child1'.
Component:Simulink | Category:Modelerror
NOTE1: This error is seen to be noticed when a non Virtual bus is being fed to swicth, if it helps identify the issue.
NOTE2: Both child busses (Bus1_child1 and Bus2_child1) have equivalent structure, except for names of child busses. Although, there is change in datatypes but i changed to while trying to resolve the error, but no luck.
So, my question will be that if the documentation says switch block can handle signals with bus DTs, then it should right ?
If the approach I've chosen to go is somewhat wrong or doesn't align with the modelling guidelines, do let me know.
Any better suggestions for switching between two equivalent busses will be more than appreciated.