主要内容

TCP/IP接口

使用TCP/IP客户端和服务器进行通信

Transmission Control Protocol (TCP) is a transport protocol layered on top of the Internet Protocol (IP) and is one of the most used networking protocols. Instrument Control Toolbox™ support for TCP/IP communication includes the ability to create clients and servers. TCP/IP client support enables you to use network socket communication to connect to remote hosts from MATLAB®用于读取和编写二进制和ASCII数据。TCP/IP服务器支持使您可金宝app以创建一个网络套接字,以用于MATLAB和单个客户端之间的通信。

利用tcpclient创建连接到服务器或硬件的TCP/IP客户端并执行读写操作。利用tcpserver创建TCP/IP服务器。

Functions

expand all

Connect and Configure

tcpclient Create TCP/IP client connection with TCP/IP server
configureTerminator 设置用于ASCII字符串通信与远程主机通过TCP/IP设置终结器
configurecallback 设置回调功能和触发条件,以通过TCP/IP与远程主机进行通信

读和写

通过TCP/IP读取远程主机的数据
读line 通过TCP/IP读取从远程主机的ASCII字符串数据行
读binblock Read one binblock of data from remote host over TCP/IP
write Write data to remote host over TCP/IP
writeline 通过TCP/IP将ASCII数据的行写入远程主机
writebinblock Write one binblock of data to remote host over TCP/IP
写读 通过TCP/IP写入远程主机并阅读响应
flush Clear buffers for communication with remote host over TCP/IP

Connect and Configure

tcpserver Create TCP/IP server
configureTerminator 设置ASCII字符串通信的终结器
configurecallback Set callback function and trigger condition for communication

读和写

读取发送到TCP/IP服务器的数据
读line Read line of ASCII string data sent to TCP/IP server
读binblock Read one binblock of data sent to TCP/IP server
write Write data from TCP/IP server
writeline Write line of ASCII data from TCP/IP server
writebinblock 从TCP/IP服务器编写一个数据嵌段
flush Clear buffers for communication using TCP/IP server
Resolve Host Resolve network host name or IP address
echotcpip 启动或停止TCP/IP Echo服务器

Apps

TCP/IP Explorer Connect to and communicate with TCP/IP server

TCP/IP Receive Receive data over TCP/IP network from specified remote machine
TCP/IP Send Send data over TCP/IP network to specified remote machine

Topics

TCP/IP Communication

TCP/IP Client

TCP/IP Server

TCP/IP Explorer应用程序

Troubleshooting

Troubleshooting TCP/IP Client Interface

Troubleshoot the TCP/IP client interface.

Resolve TCP/IP Client Connection Errors

故障排除创建TCP/IP客户端。

解决TCP/IP客户端警告:无法读取任何数据

当您没有收到数据时进行故障排除,并且收到警告消息:“ TCPCLIENT”无法读取任何数据。

Troubleshooting TCP/IP Server Interface

故障排除TCP/IP服务器接口。

Resolve TCP/IP Server Connection Errors

Troubleshoot creating a TCP/IP server.

Resolve TCP/IP Server Warning: Unable to Read Any Data

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

Resolve TCP/IP Server Warning: Unable to Read All Data

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