MATLAB Answers

CA
0

How can I find a Stateflow junction by its number?

CA
さんによって質問されました 2017 年 7 月 11 日
最新アクティビティ Arunkumar M さんによって 回答されました 2018 年 11 月 9 日
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 件のコメント

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?
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.

サインイン to comment.

1 件の回答

Answer by Arunkumar M on 9 Nov 2018

Try running MAAB guidelines. That should point such missing default transitions with hyperlink.

  0 件のコメント

サインイン to comment.



Translated by