Receive data over UDP network on a dedicated network interface


Simulink® Real-Time™ for Real-Time UDP


The Receive block receives UDP data on the specified local (destination) port. To receive all data sent to this port, set Source IP address to, otherwise set Source IP address to a valid IP address.

IP fragmentation is not supported in Simulink Real-Time UDP blocks. The packet payload is limited to 1472 bytes (1500 bytes UDP packet size − 28 bytes combined packet header size).

Block Outputs



Vector of uint8 containing data received


Number of new bytes received, and otherwise 0

The default block behavior is to keep the previous output when there is no new data.

Block Parameters

Device ID

From the list, select a unique number to identify the Ethernet board. Select the same Device ID as the one you selected for the Real-Time UDP Configuration block.

Source IP address

Enter a valid IP address as a dotted decimal string, for example, You can also use a MATLAB® expression that returns a valid IP address as a string. With Local (destination) port, this parameter defines the source address.

The default address,, causes the block to accept UDP packets from any accessible computer. If set to a specific IP address, packets arriving from only that IP address are received.

Local (destination) port

Specify the port of the computer or device from which to receive the UDP packets. With Source IP address, this parameter defines the source address.

Output port width

Enter the output port width.

Sample time

Enter the base sample time or a multiple of the base sample time (-1 means sample time is inherited).

Was this topic helpful?