MATLAB: Simulink Real-Time: Target gets disconnected after some time

My model runs perfectly on the target. I am using UDP port to send data from target to Simulink. After 500-600 seconds, my target gets disconnect from slrt-explorer. I also have a separate port on which I do the same operation using a Python script which is listening in parallel. Even though the connection breaks with Simulink, the connection remains intact with the Python script. There is no error on target. There is this message on Diagonostic Viewer after the connection gets disconnected:
Streaming to SDI is not available: Could not connect to XCP slave: XCP Master internal error: Busy(0) or no timeout(2) for 255
 
Important: The connection gets re-established after a few minutes i.e. the Target shows connected on SLRT explorer but the receiving of data does not resume.
How can I maintain the connection to the SLRT?

Best Answer

This usually happens when the model primarily consists of Simscape blocks and when it is executing close to the CPU overload limit, which leaves no room for the host-target communication background thread to execute. In such cases, host-target connectivity is temporarily lost but the model should continue running on the target. Try the following things:
  1. Try enabling "Allow tasks to execute concurrently on target" in "Configuration Parameters" -> "Solver". Enabling concurrent execution allows the model to leverage the multiple CPU cores on the target, which in turn alleviates the computational burden.
  2. Remove graphics or any mask-images from the model