How can I find a Stateflow junction by its number?

5 visualizzazioni (ultimi 30 giorni)
CA
CA il 11 Lug 2017
Risposto: Arunkumar M il 9 Nov 2018
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?
Using
>> 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!
  2 Commenti
CA
CA il 11 Lug 2017
The only way I could find, is to start the build process in Simulink by pressing the "Build Model" button and then use the output of the diagnostic viewer. Is there no way to do it from the Matlab command line?
Srinath Avadhanula
Srinath Avadhanula il 14 Lug 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.

Accedi per commentare.

Risposte (1)

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

Categorie

Scopri di più su Deployment, Integration, and Supported Hardware in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by