I have an issue regarding the use of Bus combined with Matlab function.
What I want to do is the following:
- use a matlab function block to treat a signal.
- This matlab function outputs a bus (not a mux, because signals can be of differents data types)
- this Bus is send to other buses in the model
The issue is the following: when I use the serach function (ctrl+f), I get the following warning in the command window:
Warning: 'untitled/test/Bus Selector Frame_1' must be connected to a Bus Creator, Bus Selector or a bus capable block.
A possible cause of this error is the use of a bus-capable block (such as Merge or Unit Delay) that in this current situation is
unable to propagate the bus downstream to the block reported in this error. Please see Simulink documentation for further
information on composite (i.e. bus) signals and their proper usage.
I did defined the bus in the properties of the subsystem (InitFcn and LoadFcn), and I did assigned the definition in the bus properties:
The bus signal is effectively defined in the workspace, and the model runs properly (also runs properly after code generation).
(FYI, I do have the same behaviour if I define the bus externally, from the command window, before model opening)
This warning is a big problem for me because I use this a lot of times in my model, and the search function takes 1 day because of this warnings instead of 15min... This behaviour is also observed with the used of function looking for backpropagation properties ending on this matlab function. Therefore using code generation tools, I get the same warning.
The temporary workaround I found is the deactivation of the warning, but I would like to solve the issue once and for all..
What I don't understand is that it is matlab version related: I do not have this issue in r2016b, but I have it using r2017a and r2020b.
You can find attached a model producing this issue.
Thanks for your anwers.