Message Send Block Sample Interval
1 回表示 (過去 30 日間)
古いコメントを表示
When using a Message Send block to generate a SimEvents entity, why does a constant input with inf sample time generate a message every 0.1 timesteps? How can I prevent this behaviour and only generate a message when the input signal updates?
If I put the message send inside a Simulink function, then it only sends when the function is called. But I can't port the message into an atomic subsystem: I want to use the signal to cross the subsystem boundary and trigger entity generation inside it.
0 件のコメント
回答 (1 件)
Vidip
2024 年 1 月 17 日
In Simulink and SimEvents, the behaviour you're observing with the Message Send block generating an entity every 0.1 timesteps despite having an input with inf sample time is likely due to the default discrete event simulation settings in SimEvents.
To prevent this behaviour and ensure that a message is only generated when the input signal updates, you can use an Event-Based trigger which means instead of relying on the sample time of the input signal, use an event-based mechanism to trigger the Message Send block. For example, you can use a "Function-Call Generator" block to generate an event when your conditions are met.
If you want to use the signal to cross the subsystem boundary and trigger entity generation inside it, consider using a "Function-Call Subsystem" with the enable signal tied to the condition that indicates when the input signal updates. This way, the subsystem will only execute when the condition is true.
For further information, refer to the documentation links below:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Discrete-Event Simulation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!