Interfaccia TCP/IP
Il Transmission Control Protocol (TCP) è un protocollo di trasporto sovrapposto al protocollo Internet (IP) ed è uno dei protocolli di rete più utilizzati. Il supporto Instrument Control Toolbox™ per la comunicazione TCP/IP include la possibilità di creare client e server. Il supporto client TCP/IP consente di utilizzare la comunicazione socket di rete per connettersi a host remoti da MATLAB® per la lettura e la scrittura di dati sia binari che ASCII. Il supporto del server TCP/IP consente di creare un socket di rete per la comunicazione tra MATLAB e un singolo client.
Utilizzare tcpclient
per creare un client TCP/IP che si connette a un server o hardware ed esegue operazioni di lettura e scrittura. Utilizzare tcpserver
per creare un server TCP/IP.
Funzioni
App
TCP/IP Explorer | Connect to and communicate with TCP/IP server (Da R2021b) |
Blocchi
TCP/IP Receive | Ricevere dati tramite rete TCP/IP dalla macchina remota specificata |
TCP/IP Send | Send data over TCP/IP network to specified remote machine |
Argomenti
Comunicazione 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.
Cliente 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
.
Server 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
.
Applicazione di esplorazione TCP/IP
- Configure Connection in TCP/IP Explorer
Specify the server to connect to in the TCP/IP Explorer app.
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.
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.