Loop through the bus output

3 ビュー (過去 30 日間)
Dimitri
Dimitri 2025 年 7 月 31 日
コメント済み: Jacob Mathew 2025 年 8 月 3 日
Hello!
I'm looking for solution (with Simulink, Stateflow, Embeeded coder) to iteratively send the signals to communication channel.
For example, I have a bus (non-virtual) with contains different messages to be send:
InfSystem.warrningMsg.problem1
InfSystem.warrningMsg.problem2
InfSystem.errorMsg.problem1
etc
I can send only one message per time, so I need to processing it iteratively (for-loop like).
The actual implementation uses a MATLAB function to convert bus to cells vector manually (as in the example: https://nl.mathworks.com/help/simulink/ug/attach-bus-signals-to-matlab-function-blocks.html)
I'm wondering if there is an example for use only Simulink (with Stateflow) blocks.
  1 件のコメント
Jacob Mathew
Jacob Mathew 2025 年 8 月 3 日
While not a complete solution, one suggestion on how to get a for loop iteration functionality in your model is to use the For Iterator block in Simulink. You can refer more about it in the documentation linked below:

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by