フィルターのクリア

Reset a simulink function does not work

6 ビュー (過去 30 日間)
User_in_Gim
User_in_Gim 2017 年 3 月 15 日
回答済み: User_in_Gim 2017 年 3 月 16 日
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 !

採用された回答

User_in_Gim
User_in_Gim 2017 年 3 月 16 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by