
Problem with function callback with using stateflow chart in 2019b Simulink version
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have two models in Simulink. Master (A) and slave (B) with is linked by Referenced Model block to model A. In the future i want to refer more models in A. Model B has two function-call subsystems (Init and Periodic). I want to call them from model A with different order and number of times. To do this I prepared stateflow chart with suitable logic. I have two versions of Simulink, 2021b and 2019b. In 2021b everything works properly. The problem is when I want to run this simulation in 2019b version. For example model prepared in 2019b not work in it but if I want to use the same file in 2021b I don't have any issues. I tired to resolve this problem by couple of days without any resulst. For now I have no idea. I have to use version 2019b and there is no possibility to change. Below are screenshots from the simulink and a description of the error. Maybe it is possible to ignore this error by turnig off some diagnostic option, but which? I will be greatuful for any help. Thank you.


0 comentarios
Respuestas (1)
Marcos
el 8 de Dic. de 2023
Hello Pawel,
If I understood your intent correctly, I presume you want to dictate when the functions Init and Periodic (defined in Subsystem and Subsystem1 respectively) are executed by using the Stateflow Chart. Having said that, in order to avoid this error in 2019b, you can change the "Sample time type" parameter in the Block Parameter dialog of both of these functions (see screenshot below for where to change it in the "Periodic" function).

In other words, change it from "periodic" to "triggered" and the problem should be resolved. If you attach a scope to the signals being produced inside of these functions, you will see the result is the same as the one in 2021b.
0 comentarios
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!