Main Content

UDP Interface

Communication using the UDP protocol

User Datagram Protocol (UDP) is a transport protocol layered on top of the Internet Protocol (IP). Use the UDP interface for reading and writing both binary data and ASCII data. You can read and write to servers, computers, instruments, and use applications such as streaming video and audio, point-of-sale systems, and other business applications.

Functions

expand all

udpportConnect to UDP socket (Since R2020b)
echoudpStart or stop echo UDP server
configureTerminatorSet terminator for ASCII string communication with UDP socket (Since R2020b)
configureCallbackSet callback function and trigger condition for communication with UDP socket (Since R2020b)
configureMulticastSet multicast properties for communication with UDP socket (Since R2020b)
readRead data from UDP socket (Since R2020b)
readlineRead line of ASCII string data from UDP socket (Since R2020b)
writeWrite data to UDP socket (Since R2020b)
writelineWrite line of ASCII data to UDP socket (Since R2020b)
flushClear UDP socket buffers (Since R2020b)

Apps

UDP ExplorerCreate UDP socket and communicate over networks using UDP (Since R2022a)

Blocks

UDP ReceiveReceive data over UDP network from specified remote machine
UDP SendSend data over UDP network to specified remote machine

Topics

Troubleshooting

Troubleshooting UDP Interface

Troubleshoot the UDP interface.

Resolve UDP Port Connection Errors

Troubleshoot connecting to a UDP socket.

Resolve UDP Port Warning: Unable to Read Any Data

Troubleshoot when you receive no data and you get the warning message: 'udpport' unable to read any data.

Resolve UDP Port Warning: Unable to Read All Data

Troubleshoot when you receive some data and you get the warning message: 'udpport' unable to read all requested data.