Receive UDP messages
Configure the TCP/IP stack to receive UDP messages. This block reads one data packet at a time.
Use this block when the transmission speed is of higher priority than reliability or the order of messages. However, you can monitor the status port report to verify that the data is received successfully.
The Arduino Ethernet shield uses the following pins on different variants of Arduino boards.
If you set the Target hardware parameter to:
Arduino Mega 2560, pin numbers from 50 to 53 are used.
Arduino Uno, pin numbers from 10 to 13 are used.
You cannot use this block for Arduino Nano target hardware.
The UDP Receive block has two block outputs, Data and Status.
When data is available:
The Data block output emits data received from the UDP local port on the Arduino.
The Status block output emits 1.
When data is not available:
No data is available on the Data block output.
The Status block output emits 0.
The datatype of the Data block output is uint8.
The datatype of the Status block output is int.
If you run a simulation of a model that contains this block without the target hardware, this block outputs zeroes. See Block Produces Zeros or Does Nothing in Simulation
Enter the local port through which you want to receive the UDP messages. The local IP port numbers range from 0 to 65535.