How to Access Enum Bus Signal in Variant Subsystem within Referenced Model?

4 views (last 30 days)
Hello everyone,
I'm facing an issue with a Simulink model where I'm using an enum bus signal to switch between two models configured as variant subsystems. These variant subsystems are part of a referenced model.
The problem is that the models in the referenced subsystem don't seem to have access to the enum bus signal or even to the base workspace variables.
I need the enum bus signal to be available in the referenced models so that it can control the variant conditions. Does anyone have suggestions on how to pass this enum bus signal to the referenced model or how to make it accessible within these models?
Any help or insight would be greatly appreciated!
Thanks in advance!

Answers (1)

Jatin
Jatin on 20 Aug 2024
Edited: Jatin on 20 Aug 2024
Hi @Achraf,
As per my understanding you are working with a variant subsystem in your base model, and you have an enumerated bus signal which is inaccessible in the reference model.
These are few ways you can try to help you solve the issue:
  1. Make sure the bus signal is properly routed from the base model to the reference model, ensure that the input ports of the reference model are configured to accept the bus signal. Because the variable in the base workspace may not be directly accessible in the reference model unless they are explicitly passed.
  2. You can also consider using data dictionary to manage your workspace variables and bus objects. This ensures all the necessary variables are available to both your base model and reference models.
You can refer the following MathWorks documentation for more details on data dictionary in Simulink.
  2 Comments
Achraf
Achraf on 20 Aug 2024
Edited: Achraf on 20 Aug 2024
Thank you @Jatin Singh for your suggestions. However, I want to clarify that the variant subsystem is actually inside a referenced model, not the base model. I did route the bus signal properly within the referenced model, ensuring that all input ports are configured to accept the bus signal. However, the variant subsystem still throws an error, indicating that it cannot find the switching variable, which is part of the bus.
Additionally, the link you provided to the MathWorks documentation for data dictionaries seems to be broken. Any further guidance on resolving this issue would be greatly appreciated.

Sign in to comment.

Categories

Find more on Component-Based Modeling in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!