The Problem Of Multiple Gotos?

65 vues (au cours des 30 derniers jours)
Viren
Viren le 9 Déc 2013
Commenté : Fangjun Jiang le 1 Août 2022
Hi all
I have a conceptual difficulty. I have a library of components for heat transfer analysis. The output values from these components (for example, the Pressures in components) are sent to a centralized "Output Data" block. This allows the user to handle all of his outputs from all of his components from one centralized location.
The trouble with this is that it precludes the possibility of having multiple instances of these components within a simulink model because then I get the error: Multiple Gotos found with tag named 'x_pipe'
I do not want to manually rename the tags every time because: a) there are a lot of them, and b) this completely kills flexibility and scalability of my library.
Has anyone faced this trouble before? How did you solve it? Thanks in advance!
  5 commentaires
Walter Roberson
Walter Roberson le 1 Août 2022
If "library" means "subsystem" then having two copies of the same subsystem is a potential problem for conflicts of the GoTo tags, that Simulink could potentially be confused between the same apparent tag in the two copies .
However if tag visibility is not set to global then the tag scope will not extend to the other copy of the subsystem and there should not be a problem.
If, though, "library" is not implying subsystem, then Yes, there would be a problem.
Fangjun Jiang
Fangjun Jiang le 1 Août 2022
In this case, the library component must be a sbusystem block which contains the Goto block and other blocks.
Even if the tag visibility is not "global" (e.g, could be "scoped"), as long as the Goto blocks with the same tag name intend to be connected to the same centralized location, then there would be a problem (multiple sourcing "Goto" blocks for a single "From" block).

Connectez-vous pour commenter.

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 1 Août 2022
This is a bad practice or even incorrectr practice to put a "Goto" block inside a library component, which you know will be used in multiple instances.
The reason is clear. That is the error message you encounted. You have to remove the "Goto" block from your library component.
If the "centralized Output Data block" is for signal logging or observation, consider other ways of sigal logging, such as Simulink Data Inspector.
web(fullfile(docroot, 'simulink/slref/simulationdatainspector.html'))
If the "centralized Output Data block" is used by modeling elements, then you have no choice but to route those signals to the centralized place. If Goto/From blocks are still needed to avoid many layers of routing, then you have to put the "Goto" blocks outside of the library components and name each tag differently.
  3 commentaires
Muhammad Amin
Muhammad Amin le 1 Août 2022
thanks for your time and concern. I have changed the name to rectify this issue. it worked thanks. Now, I am working on fuzzy logic portio to mitigate error (change in error). getting value trigonometery membership funtion but getting -ve value as output (I) but current -ve means of discharging but values dosenot matched.
Fangjun Jiang
Fangjun Jiang le 1 Août 2022
??
@Muhammad Amin, I deleted your answer as it is completely unrelated to the Original Poster's question.

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by