Contenu principal

Cette page a été traduite par traduction automatique. Cliquez ici pour voir la dernière version en anglais.

Interface TCP/IP

Communication via les clients et serveurs 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

développer tout

Connecter et configurer

tcpclientCreate TCP/IP client connection with TCP/IP server
configureTerminatorSet terminator for ASCII string communication with remote host over TCP/IP
configureCallbackSet callback function and trigger condition for communication with remote host over TCP/IP
tcpclientfindFind TCP/IP client connections (depuis R2024a)

Lire et écrire

readRead data from remote host over TCP/IP
readlineRead line of ASCII string data from remote host over TCP/IP
readbinblockRead one binblock of data from remote host over TCP/IP
writeWrite data to remote host over TCP/IP
writelineWrite line of ASCII data to remote host over TCP/IP
writebinblockWrite one binblock of data to remote host over TCP/IP
writereadWrite command to remote host over TCP/IP and read response
flushClear buffers for communication with remote host over TCP/IP

Connecter et configurer

tcpserverCreate TCP/IP server (depuis R2021a)
configureTerminatorSet terminator for ASCII string communication (depuis R2021a)
configureCallbackSet callback function and trigger condition for communication (depuis R2021a)
tcpserverfindFind TCP/IP servers (depuis R2024a)

Lire et écrire

readRead data sent to TCP/IP server (depuis R2021a)
readlineRead line of ASCII string data sent to TCP/IP server (depuis R2021a)
readbinblockRead one binblock of data sent to TCP/IP server (depuis R2021a)
writeWrite data from TCP/IP server (depuis R2021a)
writelineWrite line of ASCII data from TCP/IP server (depuis R2021a)
writebinblockWrite one binblock of data from TCP/IP server (depuis R2021a)
flushClear buffers for communication using TCP/IP server (depuis R2021a)
resolvehostResolve network host name or IP address
echotcpipStart or stop TCP/IP echo server

Applications

TCP/IP ExplorerConnect to and communicate with TCP/IP server (depuis R2021b)

Blocs

TCP/IP ReceiveRecevoir des données sur le réseau TCP/IP à partir d'une machine distante spécifiée
TCP/IP SendSend data over TCP/IP network to specified remote machine

Rubriques

Communication TCP/IP

Client TCP/IP

Serveur TCP/IP

Application TCP/IP Explorer

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.

Sélection d՚exemples