Bus communication between charts in Stateflow

5 ビュー (過去 30 日間)
Tim Hilt
Tim Hilt 2020 年 6 月 4 日
回答済み: Mark McBroom 2020 年 6 月 7 日
Hi there!
In one of our laboratories our professor asked us to implement the lighting of a car in Stateflow using two Stateflow-Charts to keep things modular. One chart should receive all inputs and communicate with the second chart via a bus.
We weren't given any information on how to actually achieve the bus-communication, hence this question.
The closest matching information i could find was in this page of the docs, where they talk about "messages" and i think that this ultimately leads to the solution to my issue. However, i can't seem to figure out how to actually set this up myself.
Do i have to define a Simulink bus object? How can i link the two charts together via a bus (this is what i imagine the figure to represent)?
Once the connection/ the bus is set up, how can i send information via this connection?
Thank you all very much in advance!

回答 (1 件)

Mark McBroom
Mark McBroom 2020 年 6 月 7 日
Simulink buses become structures in Stateflow. This link expains how a bus in a Simulink model becomes a structure in stateflow. If your professor truly wants you to have a bus between the two, you will need to create 2 separate Stateflow chart blocks in your SImulink model and then connect them with a Simulink Bus.

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by