Filter löschen
Filter löschen

Reset a simulink function does not work

6 Ansichten (letzte 30 Tage)
User_in_Gim
User_in_Gim am 15 Mär. 2017
Beantwortet: User_in_Gim am 16 Mär. 2017
Hi everyone,
I experience difficulties when I try to use some Simulink Function in my stateflow. Actually, I have encountered some problem to reset the function I have called in my chart.
For the exemple, I will use a simple counter as my Simulink function. To be more specific, I am calling the Simulink function at two differents times in my chart. But when I call the function for the second time (in state " Neutral_Speed" on the picture), I want that the value of my counter starts from 0 again (like the first time the function was called).
However, even if I set in the block parameter, the option " State when enabling" to reset, the value of my counter does not reset. I success to do this thing with a enabled subsystem but I need to do this in a Simulink Function.
The result I obtained (in red) vs the result I want (in green).
Do you have any idea on how to reset my signal each time I called the Simulink function ?
Please find enclosed a picture to have a better understanding.
Thanks for your help and have a good day !

Akzeptierte Antwort

User_in_Gim
User_in_Gim am 16 Mär. 2017
Hi,
I have found a way to solve my problem which is related to the scope of the Simulink function-call.
I have to duplicate the bloc and put it in the subchart (or state) where I want to call my function. It's a bit tedious but the job is done.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by