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
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 Communication Overview
使用网络套接字通信连接到MATLAB的远程主机,以通过TCP/IP读取和编写数据。 - TCP/IP和UDP比较
Compare the TCP/IP and UDP protocols to determine which to use.
TCP/IP Client
- 创建TCP/IP客户端并配置设置
Connect to remote hosts or hardware from MATLAB for reading and writing data over TCP/IP. - Write and Read Data over TCP/IP Interface
Write and read data to and from the remote host connected to thetcpclient
目的。 - 利用Callbacks for TCP/IP Communication
在指定事件发生时,通过执行回调函数来增强TCP/IP通信。 - 将代码转换为TCPCLIENT接口
创建使用TCP / IP客户端连接tcpclient
instead oftcpip
.
TCP/IP Server
- 使用TCP/IP服务器插座进行通信
Communicate between a client and MATLAB, or between two instances of MATLAB. - 将代码转换为TCPSERVER接口
使用使用TCP/IP服务器连接tcpserver
instead oftcpip
.
TCP/IP Explorer应用程序
- Configure Connection in TCP/IP Explorer
Specify the server to connect to in the TCP/IP Explorer app.
Troubleshooting
Troubleshooting TCP/IP Client Interface
Troubleshoot the TCP/IP client interface.
Resolve TCP/IP Client Connection Errors
故障排除创建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.