MATLAB: Random delays in Stream Input block in Simulink Real-Time

Simulink Real-Timestream inputudp

Hello all,
I'm using Simulink Real-Time in external mode on the development PC. When I receive data in my Stream Input blocks via UDP, I have random delays as it can be seen in the plot of the data ready output.
The pc receives the data every 4 ms what can be confirmed by wireshark. A sample time of 0.5 ms should be sufficient. As the execution time is less than 0.2 ms there are also no missed ticks in the Stream Input blocks.
What could be the reason for these delays?

Best Answer

Apparently, this can be solved by upgrading to Matlab 2020a from 2018a.