Borrar filtros
Borrar filtros

Reset a simulink function does not work

6 visualizaciones (últimos 30 días)
User_in_Gim
User_in_Gim el 15 de Mzo. de 2017
Respondida: User_in_Gim el 16 de Mzo. de 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 !

Respuesta aceptada

User_in_Gim
User_in_Gim el 16 de Mzo. de 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.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by