MATLAB: Do I receive errors “Invalid IP Group” and “Bind Error” while using Real-time UDP blocks of Simulink Real-time Library

I have a Simulink model which includes Real-time UDP configuration, send and receive blocks from Simulink Real-time Library. I can build and download the model to the target successfully. But when I start execution, I receive the following errors:
UDP: Invalid IP group 0 (312)
Error: UDP 0 Bind Error 1 (204)
Execution cannot be started.
Could you tell me how to solve this 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. You 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. Alternatively, adjust subsystem priority to make sure that the Real-time UDP configuration blocks are executed before other UDP blocks.