Effacer les filtres
Effacer les filtres

Anonymous (virtual?) composite entity creators

3 vues (au cours des 30 derniers jours)
Dan
Dan le 29 Nov 2017
Commenté : Dan le 7 Déc 2017
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.

Réponse acceptée

Mo Zhao
Mo Zhao le 7 Déc 2017
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 commentaire
Dan
Dan le 7 Déc 2017
I think that will work great, thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Messages dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by