フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

What is the best way to call hardware driver function only on signal change in Simulink?

2 ビュー (過去 30 日間)
Artyom
Artyom 2014 年 1 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi. We are using Simulink Coder and Embedded coder to deploy simulink stateflow models in our control systems. The problem there is that in stateflow controller model we have several boolean signals, which are just commands to switch on and off some control relays or lamps and changed accidentally from state to state. Normally such signals have to be passed to some hardware specific function, which generates message on field bus, so this function has to be called not every time step, but only if appropriate signal is changed. In the model the signals are routed in to top ports- of controller model in order to connect them to plant simulation.
So my question is - what is the best way to implement this in Simulink/stateflow. Currently I see following possibilities: 1. Integrate hardware function call into Stateflow Charts and call it every time on entrance to state or transition. Easy and simple, but I can not eliminate signals itself as they are used to connect to plant model. 2. Use of events? 3. Use of s-functions
  1 件のコメント
Madhu Govindarajan
Madhu Govindarajan 2015 年 12 月 10 日
Have you tried triggered subsystems? In this everything inside the subsystem will work only after receiving the trigger.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by