Model Reference outport do not accept function-call from Stateflow Chart

3 ビュー (過去 30 日間)
Grzegorz Diaczek
Grzegorz Diaczek 2023 年 7 月 16 日
回答済み: Tushar 2023 年 9 月 8 日
Helllo,
I'm creating an advanved system than contains many subsystems within its design. All subsystems are created as Model Reference blocks. Some of subsystems are Stateflow Charts, thats send events that trigger states in other Stateflow Charts, that are indepentent models. The problem is that with this workflow convenction, the error occurs with Outport block, that do not accept the Function-call:
System structure:
Error:
Outport that generates error:
I tried to set the Execution order to Export Function Domain, also the Inport of event is set to Output function call. Does outport not accept the function call? It's a bit confusing behaviour that I'm not able to transmit events outside of the referenced model, as its the best idea to use that workflow to enhance models reusability.
Thanks for help.
  2 件のコメント
Ashutosh
Ashutosh 2023 年 8 月 14 日
Hi @Grzegorz Diaczek could you provide model and reproduction steps so that i can reproduce the issue at my end ?
Grzegorz Diaczek
Grzegorz Diaczek 2023 年 8 月 15 日
Hello @Ashutosh
Unfortunately not, I've rebuild my models to ommit described problem. What I've noticed is:
  • Output event from chart can be an input to other chart, whenever 2 charts are prepared directly in one Simulink Model and are not implicated in submodels or linked Simulink Models (outports are not used)
  • It is not possible to transmit an output as event from chart as input to other chart using outports - it is not possible to create single Simulink model with single chart and reuse it (linked model) in new Simulink model environment
Please, let me know if its understandable for you and you are able to create some simple models just to check this behaviour.

サインインしてコメントする。

回答 (1 件)

Tushar
Tushar 2023 年 9 月 8 日
Hi Grzegorz,
I understand that you are facing issues while transmitting an output event from a chart as an input to another chart.
Using the Stateflow example 'Moore Chart', I have tried simulating the following scenarios:
  • When both the charts are in the same Simulink model.
  • When one of the charts are put inside a subsystem, the output of that chart gets converted into an 'outport'. The 'outport' can then be used as an input to the other chart.
I have observed that it is possible to transmit an output as event from chart as input to other chart using "outports" in these scenarios. Please refer to the following example:
Overview of the two charts
Creating subsystems for each chart
Subsystem 1
Subsystem 2
For linking/referencing a Simulink model, I suggest using 'inports' and 'outports' for a subsystem which you want to link. You can then use the 'Subsystem Reference' block to link/refer to your Simulink subsystem.
Attaching resources for further help: Model References

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by