MATLAB: Do I receive the errors “UDP: Invalid IP group 0 (312) Error: UDP 0 Bind Error 1 (204)”

I am using Real-Time UDP blocks in my Simulink model. My model complies well. But when I tried to start the simulation on the target computer, I received the following errors:
UDP: Invalid IP group 0 (312)
Error: UDP 0 Bind Error 1 (204)
Execution cannot be started.
How should I resolve the issue?

Best Answer

The errors are caused by the fact that the Real-Time UDP Configuration block is not executed before the UDP Send/Receive blocks. The customer can check the execution order by going to menu Display -> Blocks -> Sorted Execution Order.
The solution is to move the Real-Time UDP configuration blocks to the root level of the complete model. If the customer does not want to do that, he can also try adjusting subsystem priority to make sure that the Real-Time UDP configuration blocks are executed before other UDP blocks.