Main Content

Comunicación TCP/IP

Lea y escriba datos a través de la 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 redes más utilizados. La compatibilidad de MATLAB® para la comunicación con un cliente TCP/IP le permite utilizar la comunicación de socket de red para conectarse a hosts remotos desde MATLAB para la lectura y escritura de datos ASCII y binarios.

Utilice tcpclient para crear un cliente TCP/IP que se conecta a un servidor o hardware y realiza operaciones de lectura y escritura.

Funciones

expandir todo

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 (desde R2020b)
configureCallbackSet callback function and trigger condition for communication with remote host over TCP/IP (desde R2020b)
readRead data from remote host over TCP/IP
readlineRead line of ASCII string data from remote host over TCP/IP (desde R2020b)
writeWrite data to remote host over TCP/IP
writelineWrite line of ASCII data to remote host over TCP/IP (desde R2020b)
flushClear buffers for communication with remote host over TCP/IP (desde R2020b)

Apps

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

Temas

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.