MATLAB: Do I receive an error when simulating a model with a Stateflow chart inside a triggered subsystem in R2015b

simulink

In the attached model, the Outport block is driven by a Stateflow chart with a Bus Creator in between. Without the bus, there is no error shown below:
An explicit copy of the bus signal driving the Outport block 'Repro/Test/Out1' is needed to ensure correct initialization of the corresponding subsystem's output signal. Insert a Signal Conversion block with the 'Output' option set to 'Signal copy' before this Outport block. An additional signal copy may be required for the following reasons: (1) Outport is driven by a block with non-overwritable output such as a Ground, Constant, or Stateflow block; (2) Outport shares the same signal source with another Outport in the same subsystem or one nested within the current subsystem but having a different initial output value; (3) Outport is connected to an input of a Merge block or (4) A Simulink.Signal object with explicit initial value is being specified on one of Outport's input signals

Best Answer

The issue was seen in R2015b because, as the error message says, we need to insert a hidden buffer if driven by Stateflow Charts. In the case where the input is not a bus, the buffer insertion happens silently and Simulink takes care of everything. However, when the input is a virtual bus, Simulink is unable to insert a buffer (because we need to carry out Bus Expansion, and the place where we do buffer insertion is too late). Therefore, we error out letting the user know that a buffer was needed here but Simulink could not insert it, so please insert one to remove the error.
Starting from R2016a, Simulink is able to insert buffers even in cases of virtual buses.