How to change the number of Input / output ports of a referenced subsystem in simulink?

45 次查看(过去 30 天)
I'm working on powertrain blockset and vehicle dynamics blockset in simulink, and I'm trying to combine some features from both of them, to do so, I need to add/remove some inputs and outputs ports from some of the referenced subsystems in theses models. However, the error message I'm getting says that I cannot change the number of ports of the referenced subsystem, Like the following:
is there anyway to fix this issue, or how to de-reference the subsystem ?
Thank you.
  2 个评论
Ashish Azad
Ashish Azad 2020-6-25
Why don't you copy paste the old subsytem and create a new subsystem modifying the number of inputs and outputs?
Tamim Boubou
Tamim Boubou 2020-6-25
I was trying to avoid this because there are many subsystems and doing so everytime I want to adjust some input/output would take some amount of time since I'll have to adjust the variables, etc...
Thank you for the suggestion.

请先登录,再进行评论。

采纳的回答

Mike Sasena
Mike Sasena 2020-6-30
Hi Tamim,
As far as I can tell, the issue is that you're trying to modify the I/O for one of the variants in a variant subsystem. That means each variant in that subsystem must use a subset of the signals from the parent. For example, if the variant subsystem has inputs A, B and C, then each of the variants must use only those signals. If you want to add a 4th input (D), then you've created an incompatible variant. This is what your error message is telling you.
You have 2 options:
  1. Update the variant subsystem to include the new signals you want in your individual variant. This will require you updating the model level above this to feed in the new signal.
  2. Get rid of the variant subsystem and just put in a new subsystem like Ashish recommended. Think of it like hard coding your subsystem I/O. It's simpler, but more rigid in its design.
For more info on variant subsystems, check out this example.
Cheers,
Mike

更多回答(1 个)

Tamim Boubou
Tamim Boubou 2020-7-1
That was exactly my problem, I noticed this after few hours of asking the questions, but forgot to answer my own question.
Thank you very much for the answer.

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by