Why do I receive a warning on bus-capable blocks + matlab function from r2017 and not before?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
deRicaud
el 8 de Jun. de 2021
Respondida: deRicaud
el 15 de Jun. de 2021
Hello,
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.
0 comentarios
Respuesta aceptada
Más respuestas (1)
Jonas
el 8 de Jun. de 2021
I get no warnings when running your model or searching objects.
Maybe it is related to the fact that you create the Bus object using a block callback function.
Why don't you create a Simulink.Bus object inside your Model Workspace or a linked Data Dictionary to define the structure and its elements there, and then use the Bus object as the data type for the output of the MATLAB function. I am guessing it will avoid the warning you get because the Bus object will be findable at any stage.
5 comentarios
Jonas
el 9 de Jun. de 2021
Wait, I do get the warning in the Command Window. The search itself is probably just working quickly because it is a small model.
Ver también
Categorías
Más información sobre Interactive Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!