Interfaz TCP/IP
El Protocolo de control de transmisión (TCP) es un protocolo de transporte superpuesto al Protocolo de Internet (IP) y es uno de los protocolos de red más utilizados. El soporte de Instrument Control Toolbox™ para la comunicación TCP/IP incluye la capacidad de crear clientes y servidores. La compatibilidad con clientes TCP/IP le permite utilizar la comunicación por socket de red para conectarse a hosts remotos desde MATLAB® para leer y escribir datos binarios y ASCII. La compatibilidad con servidor TCP/IP le permite crear un socket de red para la comunicación entre MATLAB y un solo cliente.
Utilice tcpclient
para crear un cliente TCP/IP que se conecte a un servidor o hardware y realice operaciones de lectura y escritura. Utilice tcpserver
para crear un servidor TCP/IP.
Funciones
Apps
TCP/IP Explorer | Connect to and communicate with TCP/IP server (desde R2021b) |
Bloques
TCP/IP Receive | Recibir datos a través de la red TCP/IP desde una máquina remota especificada |
TCP/IP Send | Send data over TCP/IP network to specified remote machine |
Temas
Comunicación 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
.
Servidor 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
.
Aplicación de exploración TCP/IP
- Configure Connection in TCP/IP Explorer
Specify the server to connect to in the TCP/IP Explorer app.
Solución de problemas
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.