How to run Matlab Function in a triggered subsystem in Simulink
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alberto Bolzoni
el 3 de Ag. de 2017
Respondida: Sindhu Yerragunta
el 7 de Ag. de 2017
Good evening.
I am running a simulation in Simulink/Simscape with a fundamental sample time (set in the Powergui block) equal to 5e-6 seconds.
Then in the model I need to run a certain code each 5e-3 seconds; I tryed to make it with a triggered subsystem containing the MATLAB Function block where the code is written, but I get an error message. I also tried to latch the inputs but still it does not work.
The main model is this one
while the triggered subsystem is this one
Finally, this is the error message
.
Thank you for your kind help.
Alberto
0 comentarios
Respuesta aceptada
Sindhu Yerragunta
el 7 de Ag. de 2017
Hi Alberto,
From the error message I understand that the issue is due to having different sample times for 'Boost_Converter2/Subsystem/Out1' and 'Boost_Converter2/DC-DC Boost/Sum1'. This can be resolved by keeping a Rate Trasition Block between these two ports.
For further information on Rate Trasition Block please refer the following link,
If you do not want to change your model, you can change the 'Multitask rate trasition' option in 'Configuration Parameters--> Diagnostics--> Sample Time' to warning.
Hope this resolves the issue.
-Sindhu
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Subsystems 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!