Receive data over UDP network on a dedicated network interface

  • Library:
  • IEEE 1588 / PTP 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.

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

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


Output Arguments

expand all

Vector of uint8 containing data received.

Number of new bytes received, and otherwise 0.


expand all

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.

Enter a valid IP address as a dotted decimal character vector, for example, You can also use a MATLAB® expression that returns a valid IP address as a character vector. 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 Source IP address is set to a specific IP address, packets arriving from only that IP address are received.

The address is an invalid IP address.

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

Determines the width of the Data output vector. If this value is less than the number of bytes in the received packet, the excess bytes are discarded.

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

See Also


External Websites

Introduced in R2011a

Was this topic helpful?