필터 지우기
필터 지우기

Anonymous (virtual?) composite entity creators

조회 수: 3 (최근 30일)
Dan
Dan 2017년 11월 29일
댓글: Dan 2017년 12월 7일
I'm trying to create a common library block that accepts and routes messages (using SimEvents messages) of a type that is unknown until they're placed in their usage location. In the process of performing this routing, I'm using the Composite Entity Creator and Composite Entity Splitter to combine and then split those unknown message types on their way into and out of the block.
But, I'm running into an error "Block [Composite Entity Creator inside the common block] is redefining the entity type named [the name that I've entered into the common Composite Entity Creator] using different data properties for attributes. This entity type has already been defined by another block in the model...". It's true, because I've instantiated that common block 4 times, and they all share the same name but have different types going into them for each instance. However, it shouldn't really matter--all I'm doing is combining and then splitting those Composite Entities without actually worrying about them inside of the common block.
So, what I'm looking for is a way to have anonymous Composite Entity Creators which I can later split--like a mux and demux, or maybe virtual bus creator/splitter. Does anything like this exist, or is there some way to simulate this behavior? The best I can come up with right now is to get rid of Composite Entity Creators from my common library block and do all of the entity creation/splitting before it reaches the common block.

채택된 답변

Mo Zhao
Mo Zhao 2017년 12월 7일
The error is because that the two subsystems linked to the same library block create two distinguished composite entity types with the same name "Combined";. If we break the link and change the composite entity name in the second subsystem to "Combined2", the model can work. Thus, you can create a mask for the library block with a promote parameter of the combined entity type name for each instance.
  댓글 수: 1
Dan
Dan 2017년 12월 7일
I think that will work great, thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Messages에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by