Interface TCP/IP
Le protocole de contrôle de transmission (TCP) est un protocole de transport superposé au protocole Internet (IP) et est l'un des protocoles réseau les plus utilisés. La prise en charge de Instrument Control Toolbox™ pour la communication TCP/IP inclut la possibilité de créer des clients et des serveurs. La prise en charge du client TCP/IP vous permet d'utiliser la communication par socket réseau pour vous connecter à des hôtes distants depuis MATLAB® pour lire et écrire des données binaires et ASCII. La prise en charge du serveur TCP/IP vous permet de créer un socket réseau pour la communication entre MATLAB et un seul client.
Utilisez tcpclient
pour créer un client TCP/IP qui se connecte à un serveur ou à du matériel et effectue des opérations de lecture et d'écriture. Utilisez tcpserver
pour créer un serveur TCP/IP.
Fonctions
Applications
TCP/IP Explorer | Connect to and communicate with TCP/IP server (depuis R2021b) |
Blocs
TCP/IP Receive | Recevoir des données sur le réseau TCP/IP à partir d'une machine distante spécifiée |
TCP/IP Send | Send data over TCP/IP network to specified remote machine |
Rubriques
Communication TCP/IP
- 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.
Client TCP/IP
- 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 thetcpclient
object. - 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 usingtcpclient
instead oftcpip
.
Serveur TCP/IP
- 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 usingtcpserver
instead oftcpip
.
Application TCP/IP Explorer
- Configure Connection in TCP/IP Explorer
Specify the server to connect to in the TCP/IP Explorer app.
Résolution des problèmes
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.