How do I stop Simulink pausing every quarter second?

1 vue (au cours des 30 derniers jours)
Sean Kavanagh
Sean Kavanagh le 23 Fév 2022
I have a Simulink model that receives a UDP packet, does some calculations and transmits a reply packet. This works extremely well, for the most part, but approximately every 0.25 seconds the model stops running for about 10ms before resuming. This introduces a 4Hz artifact at the input to the program receiving and displaying the packets from Simulink.
The model runs with a 1ms fixed time step, and processes UDP packets in the same time step as they come in (at ~1kHz in real-time). Reducing the model rate to a 2ms time step and sending out UDP packets at that rate has no effect on the frequcny of the pauses in real time. Running in Accelerator mode also had no effect on the pauses. However, stripping out some of the Simulink model doing the processing reduces most of the real time delay, but doesn't remove it completely.
Is there a known cause for a Simulink model to pause calculation like this, or is it an unavoidable feature of running on a non real-time operating system?

Réponse acceptée

Sean Kavanagh
Sean Kavanagh le 28 Nov 2023
In case anyone else has the same problem:
This turned out to be a result of Display blocks in the model. They seem to update at this rate, and that takes time.
Commenting out (or removing) all the Display blocks in the model resolved the situation.

Plus de réponses (0)

Catégories

En savoir plus sur Multicore Processor Targets dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by