TCP/IP-Schnittstelle
Das Transmission Control Protocol (TCP) ist ein Transportprotokoll, das auf dem Internet Protocol (IP) aufsetzt und zu den am häufigsten verwendeten Netzwerkprotokollen zählt. Die Unterstützung von Instrument Control Toolbox™ für die TCP/IP-Kommunikation umfasst die Möglichkeit, Clients und Server zu erstellen. Die TCP/IP-Client-Unterstützung ermöglicht es Ihnen, über Netzwerk-Socket-Kommunikation von MATLAB® aus eine Verbindung zu entfernten Hosts herzustellen, um sowohl Binär- als auch ASCII-Daten zu lesen und zu schreiben. Die TCP/IP-Serverunterstützung ermöglicht es Ihnen, einen Netzwerk-Socket für die Kommunikation zwischen MATLAB und einem einzelnen Client zu erstellen.
Verwenden Sie tcpclient, um einen TCP/IP-Client zu erstellen, der eine Verbindung zu einem Server oder einer Hardware herstellt und Lese- und Schreibvorgänge durchführt. Verwenden Sie tcpserver, um einen TCP/IP-Server zu erstellen.
Funktionen
Apps
| TCP/IP Explorer | Connect to and communicate with TCP/IP server (Seit R2021b) |
Blöcke
| TCP/IP Receive | Daten über das TCP/IP-Netzwerk von einem angegebenen Remote-Rechner empfangen |
| TCP/IP Send | Send data over TCP/IP network to specified remote machine |
Themen
TCP/IP-Kommunikation
- TCP/IP Communication Overview
Use network socket communication to connect to remote hosts from MATLAB for reading and writing data over TCP/IP. - TCP/IP and UDP Comparison
Compare the TCP/IP and UDP protocols to determine which to use.
TCP/IP-Client
- Create TCP/IP Client and Configure Settings
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 thetcpclientobject. - Use Callbacks for TCP/IP Communication
Enhance TCP/IP communication by executing a callback function when a specified event occurs. - Transition Your Code to tcpclient Interface
Create TCP/IP client connections usingtcpclientinstead oftcpip.
TCP/IP-Server
- Communicate Using TCP/IP Server Sockets
Communicate between a client and MATLAB, or between two instances of MATLAB. - Transition Your Code to tcpserver Interface
Create TCP/IP server connections usingtcpserverinstead oftcpip.
TCP/IP Explorer-App
- Configure Connection in TCP/IP Explorer
Specify the server to connect to in the TCP/IP Explorer app.
Fehlersuche
Troubleshooting TCP/IP Client Interface
Troubleshoot the TCP/IP client interface.
Resolve TCP/IP Client Connection Errors
Troubleshoot creating a TCP/IP client.
Resolve TCP/IP Client Warning: Unable to Read Any Data
Troubleshoot when you receive no data and you get the warning message: 'tcpclient' unable to read any data.
Troubleshooting TCP/IP Server Interface
Troubleshoot the TCP/IP server interface.
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.






