UDP Receive

Purpose

Receives data sent as UDP packets over the network.

Description

../../_images/udp_rx.svg

The block opens a UDP network port with the specified port number. If a packet with the required amount of data is received on the UDP port, the data is interpreted as the specified data type and made available on the d block output. The output v is 1 in each simulation step where new data is received, 0 otherwise.

The received data is interpreted as a contiguous block of data of the specified data type with no padding. Little endian byte order is assumed for integer data types. Packets that don’t have the required data size are discarded.

Parameters

Port

The UDP port to open. Ports below 1024 are reserved or system services and should not be used.

Width

The number of values that are expected in the UDP packet.

Data type

The data type of the data in the UDP packet.