Main Content

La traduzione di questa pagina non è aggiornata. Fai clic qui per vedere l'ultima versione in inglese.

Comunicazione TCP/IP

Leggere e scrivere dati su interfaccia TCP/IP

Il Transmission Control Protocol (TCP) è un protocollo di trasporto sovrapposto all'Internet Protocol (IP) ed è uno dei protocolli di rete più utilizzati. Il supporto di MATLAB® per la comunicazione client TCP/IP consente di utilizzare la comunicazione socket di rete per connettersi a host remoti da MATLAB per leggere e scrivere dati binari e ASCII.

Utilizzare tcpclient per creare un client TCP/IP che si connetta a un server o a un hardware ed esegua operazioni di lettura e scrittura.

Funzioni

espandi tutto

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

App

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

Argomenti

Risoluzione dei problemi

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.