UDP Receive
Receive UDP message from UDP host
Add-On Required: This feature requires the Simulink Support Package for Parrot Minidrones add-on.
Libraries:
Simulink Support Package for Parrot Minidrones
Description
The UDP Receive block receives UDP message from a UDP host.
The block output, Data, emits UDP packet data as a one-dimensional vector of a specified data type. The block output, Size, emits the size of the data in the UDP buffer. With each sample, the block outputs the bytes of a UDP message as a data vector of the size specified by the Data size (N) parameter.
The data type of the block output, Data
, depends on the
Data type parameter. The data type of the block output,
Size
, is uint16
. Size
represents the total bytes. For example, if the Data Type
is double
and the number of elements (mentioned using the Data size (N)
parameter) is 5, then the value of Size
is 40, that is, 8*5
bytes.
The block receives the message on the port number specified in the Local IP port parameter. Match the port number specified in the Local IP port parameter with the remote port number of the sending host.
Parrot® minidrone is a little-endian device. The UDP Receive block expects the byte order of the received UDP data to be little-endian.
Note
If you are having trouble using UDP to communicate with a computer, the antivirus or firewall software might be blocking UDP traffic. If so, configure the software to allow the traffic for a specific IP port number.
Examples
Ports
Output
Parameters
Version History
Introduced in R2018a