How do I stop Simulink pausing every quarter second?

1 Ansicht (letzte 30 Tage)
Sean Kavanagh
Sean Kavanagh am 23 Feb. 2022
Beantwortet: Sean Kavanagh am 28 Nov. 2023
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?

Akzeptierte Antwort

Sean Kavanagh
Sean Kavanagh am 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.

Weitere Antworten (0)

Kategorien

Mehr zu Multicore Processor Targets finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by