Contenido principal

Esta página se ha traducido mediante traducción automática. Haga clic aquí para ver la versión original en inglés.

Interfaz TCP/IP

Comunicación mediante clientes y servidores TCP/IP

El Protocolo de Control de Transmisión (TCP) es un protocolo de transporte que se ejecuta sobre el Protocolo de Internet (IP) y es uno de los protocolos de red más utilizados. La compatibilidad de Instrument Control Toolbox™ con la comunicación TCP/IP incluye la capacidad de crear clientes y servidores. La compatibilidad con clientes TCP/IP permite utilizar la comunicación mediante sockets de red para conectarse a hosts remotos desde MATLAB® para leer y escribir datos binarios y ASCII. La compatibilidad con servidores TCP/IP permite crear un socket de red para la comunicación entre MATLAB y un único 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

expandir todo

Conectar y configurar

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 (Desde R2024a)

Leer y escribir

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

Conectar y configurar

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

Leer y escribir

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

Apps

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

Bloques

TCP/IP ReceiveRecibir datos a través de la red TCP/IP desde una máquina remota específica.
TCP/IP SendSend data over TCP/IP network to specified remote machine

Temas

Comunicación TCP/IP

Cliente TCP/IP

Servidor TCP/IP

App TCP/IP Explorer

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.

Ejemplos destacados