hello all,
here is the thing (model in attchments & screenshot below)
- subsystem test_priorities_R2020b/doThis produces variable C (top right of the screenshot)
- subsystem test_priorities_R2020b/doThat consumes variable C (bottom right of the screenshot)
- both subsystems are atomic
- I want to compute doThis before doThat to avoid a dividsion by 0 in doThat at the first computation step so I set the priorities doThis=105, doThat=110.
- result : we can see that doThis is indeed executed before doThat thanks to the sorted order (1 vs 2), I'm happy.
now, I duplicate the same subsytems test_priorities_R2020b/SS2/doThis2 and test_priorities_R2020b/SS1/doThat2, the only differences are
- those subsystems have different parent (SS1 & SS2)
- doThis2 produces variable A instead of C and doThat2 consumes A
- priorities are doThis2=5, doThat2=10 (doThis2 is still supposed to be executed before doThat2)
- result : doThis2 is executed AFTER doThat2 ({4} vs {3} indicated by the sorted order), there's a division by 0 at the first step, I'm NOT happy.
why does simulink respect the priorities when the subSystems share the same parent while it's not the case when they're in separate subsystems ? the structure of the model is not so complicated, I'm surprised to see that simulink overrides the sequensing I specified.
some precisions:
- the subystems are atomic so I can't use goto/from instead of memories
- I want ot organize my model functionnaly, hence not having all subsystem them at the same level
- I'll have more than 1000 subsystem in my model (eventually will be subsystem references) so not putting all of them in a subsystem makes sense
thanks for any ideas you could have.
Laurent