Main Content

UDP Receive

Receive UDP packets over IP network

Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.

  • Raspberry Pi UDP Receive block

Simulink Support Package for Raspberry Pi Hardware / Network


The UDP Receive block receives UDP packets from a UDP host. Use the block for stateless and connectionless data exchange.


Your antivirus software or firewall might block UDP traffic. Configure the software to allow traffic from a specific IP port number.



expand all

At each sample time, the block outputs the contents of a packet received as a data vector of the size that you specify in the Data size (elements) parameter.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean

At each sample time, the block outputs the number of data bytes in the received message.

Data Types: uint8


expand all

Specify the port number of the application on which you want to receive the UDP message. Match the local port number with the remote port number of the sending host.

Select the data type in which the block receives data bytes from the sending host.

Specify the number of elements that you want to receive in each UDP packet.

Specify the frequency at which the scheduler calls the UDP Receive block, in seconds. Enter a value greater than zero. In real-time operation, setting this parameter to a smaller value reduces the likelihood of dropped UDP messages.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2013a