The Problem Of Multiple Gotos?

15 views (last 30 days)
Viren
Viren on 9 Dec 2013
Commented: Fangjun Jiang on 1 Aug 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 Comments
Fangjun Jiang
Fangjun Jiang on 1 Aug 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).

Sign in to comment.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 1 Aug 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 Comments
Fangjun Jiang
Fangjun Jiang on 1 Aug 2022
??
@Muhammad Amin, I deleted your answer as it is completely unrelated to the Original Poster's question.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by