主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

UDP 接口

使用 UDP 协议进行通信

用户数据报协议 (UDP) 是位于互联网协议 (IP) 顶层的传输协议。使用 UDP 接口读取和写入二进制数据和 ASCII 数据。您可以向服务器、计算机和仪器读取和写入数据,并使用流视频和音频、销售点系统和其他业务应用程序。

函数

全部展开

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

App

UDP 通信管理器Create UDP socket and communicate over networks using UDP (自 R2022a 起)

模块

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

主题

疑难解答

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.

精选示例