MATLAB: Do I get the error ‘Input port cannot accept mixed data types’ in the Simulink model that has an Atomic Subsystem

atomicdataerrorinportmixedoutportsimulinksubsystemtypes

Why do I get the following error in my Simulink model that has an Atomic Subsystem?
--> Input port cannot accept mixed data types. Input port 1 of block 'mixed_signals_not_allowed/Atomic Subsystem' expects a signal with unique data type. However, it is driven by a signal with elements of differing data types.
--> An error occurred while propagating data type 'mixed' from block 'mixed_signals_not_allowed/Mux', output port 1.
This error occurs when the Outport block in an Atomic Subsystem is connected to a certain point within the Subsystem and I try to run or update the model. This error does not occur if the line that goes into the Outport block is deleted. The error does not occur if another sink is connected to the same point. It also does not occur if the Outport is moved to other locations.

Best Answer

Signal elements connected to a subsystem inport can be of differing numeric and data types except in the following circumstance:
- When a subsystem contains an Enable or Trigger block
- When the inport is connected directly to an outport, the input elements must be of the same type
For an example illustrating these situations, information on Simulink's support for mixed data types and the inport block in the help documentation, type the following at the MATLAB prompt:
web([docroot,'/toolbox/simulink/slref/inport.html'])