Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
What is the best way to call hardware driver function only on signal change in Simulink?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Madhu Govindarajan
am 10 Dez. 2015
Have you tried triggered subsystems? In this everything inside the subsystem will work only after receiving the trigger.
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!