TCP Send
Send data over TCP/IP network to remote host
Libraries:
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32H7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F2xx Based Boards
Description
The TCP Send block sends data to a remote host or another hardware
board over a TCP/IP network. You can set the Connection mode of the
block to Server
or Client
. When you set
Connection mode to Client
, you must provide
the Server IP Address and the Server IP Port
on the server to which you want to send data. When you set Connection
mode to Server
, you must provide the Local
IP Port. This Local IP Port acts as a listening port
on the TCP/IP server. The server must be up and running before deploying the model that
contains the TCP Send block to the target.
The block sends data either in blocking mode or in non-blocking mode. In blocking mode, the model blocks the execution while it waits for the data to be sent completely. In non-blocking mode, the model runs continuously. To set the block in blocking mode, select the Wait until data received option.
Note
When DHCP is enabled with TCP/IP or UDP blocks in the model, the code waits in an infinite loop until IP is assigned to the board. Hence, user must ensure board is connected to router, if their model has any UDP/TCP block in their model with DHCP enabled.
Examples
Ports
Input
Parameters
Version History
Introduced in R2017a