Workaround to Goto problems in Enabled Subsystems

Hello MATLAB Community,
I'm currently working on a Simulink model that includes a Powergui block set to EquivalentMode2 and a Current Measurement block. I need to use an Enabled Subsystem to manage part of my model, but I'm encountering issues with dynamically created Goto blocks when converting the subsystem.
Problem Description:
  1. Setup:
  • My model includes a Controlled Voltage Source (in AC mode) and a Current Measurement block.
  • These blocks are part of a larger subsystem that needs to be enabled and disabled based on specific conditions.
  1. Issue:
  • When I convert the subsystem to an Enabled Subsystem, Simulink dynamically creates Goto blocks within the Powergui's EquivalentMode2 block, specifically inside the Current Measurement block.
  • This results in an error: Goto/From connections cannot cross nonvirtual subsystem boundaries.
Steps I’ve Taken:
  • I tried to manage the Current Measurement using standard Simulink blocks and physical signal converters but encountered issues with solver requirements.In other words, I cant add more complexity to an already fairly complex model, it would take forever.
  • I also attempted to create custom measurement logic but faced difficulties with integrating it seamlessly into the existing physical simulation. Again, here whatever I do requires a Solver and it turns it unfeasible to run (takes forever).
  • I took the AC Source, Current Measurement and even the Diode out... but the problem still persist...
Error message I got:
Multiple Gotos found with tag named 'DOC'
Component:Simulink | Category:Model error
First offending Goto 'integrated_bat_fuel_2/powergui/EquivalentModel2/Yout/Goto2'
Component:Simulink | Category:Model error
Second offending Goto 'integrated_bat_fuel_2/FuelCell Subsystem/FuelCell 1 kW 24V DC/Fuel Cell Stack/Current Measurement1/source'
Component:Simulink | Category:Model error
Additional Context:
  • I'm using Simulink with a combination of Simscape Electrical components.
  • The model involves a mix of physical and Simulink signals, making it critical to maintain compatibility across different simulation domains.
Any guidance or recommendations would be greatly appreciated!
Thank you, [Your Name]
Feel free to modify the draft as needed to better fit your situation or to add any other relevant details.
4o
Any ideas? Please advice , I already ran out of ideas and I have no clue on how to solve this, any guidance or recommendations would be greatly appreciated!
Thank you,
Raul

2 commentaires

tom
tom le 12 Juil 2024
Steps to Resolve Goto Problems in Enabled Subsystems
  1. Scope Verification
  • Ensure the Goto block’s tag visibility includes the From block. Adjust scope settings if necessary.
  1. Use Data Store Memory
  • Replace Goto/From blocks with Data Store Memory, Data Store Read, and Data Store Write blocks to manage signal access across the model.
  1. Enable Port Configuration
  • Verify the enable port settings to ensure the subsystem executes correctly.
  1. Model Advisor and Diagnostics
  • Run Model Advisor checks and enable signal resolution diagnostics in Configuration Parameters.
  1. Simplify Model Structure
  • Break down complex enabled subsystems into smaller parts for easier troubleshooting.
Example with Data Store Memory:
  1. Add a Data Store Memory block named "mySignal".
  2. Use Data Store Read within the enabled subsystem to access "mySignal".
  3. Use Data Store Write elsewhere to update "mySignal".
Raul
Raul le 13 Juil 2024
Hi Tom, many thanks, I will have a try to your strategy , however it looks that the Matlab itself creates all these Goto statements so whatever I write gets replaced by dynamic code every time I hit "Run"....
Thanks anyway,

Connectez-vous pour commenter.

Réponses (0)

Catégories

Produits

Version

R2024a

Question posée :

le 12 Juil 2024

Commenté :

le 13 Juil 2024

Community Treasure Hunt

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

Start Hunting!

Translated by