How can I find a Stateflow junction by its number?

11 views (last 30 days)
I'm developing an embedded system in MATLAB Simulink which contains some Stateflow charts. I successfully generate correct C-code out of it. Unfortunately, building the model throws up some warnings. One of them is:
Warning: Junction #395 does not have an unconditional path
to a state or a terminal junction AND it has multiple paths
leading to it. This might lead to confusing run-time behavior
because of the backtracking semantics of Stateflow.
This warning has no other link or information how to find that junction inside my model than its number. The model is quite big, so searching manually is not very handy. I also couldn't find it in the model explorer by using the filter to only display junctions and then looking at the IDs.
Is there a way to find/highlight that junction by its number? Or is there another way to debug that warning?
>> sObj = sfroot;
>> myObj = sObj.find('Id',1277);
>> myObj.view
as suggested on StackOverflow doesn't manage to find it either.
The weird thing is that the numbers change each time I start a rtwbuild...
Thanks for your help!
Srinath Avadhanula
Srinath Avadhanula on 14 Jul 2017
Using the link in the diagnostic viewer is actually the recommended way of navigating to the junction in question after you press "Build Model" from the Simulink UI. The number used in the warning message is an "object ID" which is session dependent and therefore changes from session to session. However, the method with "myObj.view" should have worked as long as the model is still open after the build (even from the command line). What error does it give?
For your reference, this error is referring to the following incorrect (or confusing) modeling pattern. Within MATLAB, you can also open the shipping model sf_backup_undesirable to see other examples of how to avoid this modeling pattern.

Sign in to comment.

Answers (1)

Arunkumar M
Arunkumar M on 9 Nov 2018
Try running MAAB guidelines. That should point such missing default transitions with hyperlink.


Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!