Main Content

Communication TCP/IP

Lire et écrire des données via une interface TCP/IP

Le protocole TCP (Transmission Control Protocol) est un protocole de transport qui se superpose au protocole IP (Internet Protocol). Il s’agit de l’un des protocoles réseau les plus utilisés. Le support MATLAB® pour la communication avec des clients TCP/IP vous permet d’utiliser la communication par sockets réseau pour vous connecter à des hôtes distants depuis MATLAB afin de lire et d’écrire des données binaires et ASCII.

Utilisez tcpclient pour créer un client TCP/IP qui se connecte à un serveur ou à du hardware et exécuter des opérations de lecture et d’écriture.

Fonctions

développer tout

tcpclientCreate TCP/IP client connection with TCP/IP server
tcpclientfindFind TCP/IP client connections (depuis R2024a)
echotcpipStart or stop TCP/IP echo server
configureTerminatorSet terminator for ASCII string communication with remote host over TCP/IP (depuis R2020b)
configureCallbackSet callback function and trigger condition for communication with remote host over TCP/IP (depuis R2020b)
readRead data from remote host over TCP/IP
readlineRead line of ASCII string data from remote host over TCP/IP (depuis R2020b)
writeWrite data to remote host over TCP/IP
writelineWrite line of ASCII data to remote host over TCP/IP (depuis R2020b)
flushClear buffers for communication with remote host over TCP/IP (depuis R2020b)

Applications

TCP/IP ExplorerConnect to and communicate with TCP/IP server (depuis R2021b)
Hardware ManagerDiscover and get started with your hardware (depuis R2022a)

Rubriques

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.