Main Content

TCP Client

Configure TCP client

  • Library:
  • Simulink Real-Time / IP

  • TCP Client block

Description

The TCP Client block configures a TCP client.

Ports

Input

expand all

If Enable is greater than zero, the block connects to the Ethernet device. Otherwise, the block does not connect to the Ethernet device.

Output

expand all

The status value is one of:

  • 0 — Not connected

  • 1 — Connected

As a best practice, connect the Status output of a TCP configure block to the Enable input of the associated TCP Send and TCP Receive blocks.

Parameters

expand all

Dependency

When you select this parameter, it deactivates the Client IP address parameter and excludes the ports 1 through 1023 and 5500 through 5560 from use by TCP.

Programmatic Use

Block Parameter: useHostTargetConn

If you are using a dedicated Ethernet card, this value must match the Local IP Address parameter in the IP Config block for the network interface.

Programmatic Use

Block Parameter: clientAdd

The combination of Client IP address and Client local port must be unique.

Ports 1 through 1023 and 5500 through 5560 are reserved for Simulink Real-Time communications.

Programmatic Use

Block Parameter: clientPort

Enter the IP address of the server to which you want to connect the client.

Programmatic Use

Block Parameter: remoteAdd

Enter the port number of the server to which you want to connect the client.

Ports 1 through 1023 and 5500 through 5560 are reserved for Simulink Real-Time communications.

Programmatic Use

Block Parameter: remotePort

See Also

Introduced in R2020b