Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
What is the best way to call hardware driver function only on signal change in Simulink?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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!