The Problem Of Multiple Gotos?
15 views (last 30 days)
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!
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.
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.