Receive UDP message
Receive UDP messages on a local port. This block reads one data packet at a time.
Use this block when the transmission speed is of higher priority than the transmission reliability or the order of messages.
You can monitor the Status block output to verify that the data is received successfully.
The Arduino Ethernet Shield uses the following pins on different Arduino board variants.
Arduino Mega 2560 – pins 50 to 53.
Arduino Uno – pins 10 to 13.
The UDP Receive block has two outputs, Data and Status.
When data is available:
The Data block output emits data received from the UDP local port on the Arduino board.
The Status block output emits 1.
When data is not available:
The Data block output emits the last received value.
The Status block output emits 0.
The Data block output emits uint8 values.
The Status block output emits int values.
During simulations without the hardware, this block emits 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.
Specify how often this block reads the UDP messages, in seconds. Enter a value greater than zero. This value defaults to a sample time of 1 second. The minimum value is 0.000001 second.
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.