Defining bus type when using Bus Element In / Bus Element Out blocks
11 次查看(过去 30 天)
显示 更早的评论
Hello,
I am converting subsystem that currently use Bus Select / Bus Assign blocks to using Bus Element In / Bus Element Out blocks.
In my original model, I have an Input port with data type = Some_Bus (defined in the global workspace using the bus editor), and then a Bus Selector. This enforces that bus definitions match whenever I reuse my subsystem (I am using subsystem reference, don't know if that matters).
Now when using In Bus Element, if I set the data type of the bus to Some_Bus, I get the error
Input bus type mismatch on Signal Specification block. The bus signal at the input of '<hidden_signal_specification_block> inserted for "InBus.a" (untitled/Subsystem/In Bus Element)' is a 'nonvirtual bus', however the block expects a 'virtual bus' as per the setting specified for 'Require nonvirtual bus' in the dialog of the signal specification block. This message is related to a hidden SignalSpecification block. This block is added to lock down the specification as defined by the parameters of 'untitled/Subsystem/In Bus Element' for individual elements in the input bus signal.'
The documentation of Bus Element In mentions 'Do not specify a bus object as the expression', but I do not know whether this applies to the individual signal or to the top-level input.
So, is it possible to somehow specify the bus type of the input/output ports of a subsystem when using Bus Element In/Out blocks?
A minimal example is attached. The .mat file contains the bus definition used in this example.
Regards,
Rob
0 个评论
回答(1 个)
Ganesh Regoti
2019-11-7
Hi,
I have gone through the model, even when we set the bus to ‘some_bus’ we can make it work if we convert nonvirtual bus to virtual bus. You can refer the following link for that
I’m also attaching the model.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!