Main Content

TCP Server

Configure TCP server

  • Library:
  • Simulink Real-Time / IP

  • TCP Server block


The TCP Server block configures a TCP server.



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.


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.


expand all


When you select this parameter, it deactivates the Server 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 IP address configured for the Ethernet card on the target computer.

Programmatic Use

Block Parameter: serverAddress

The combination of Server IP address and Server port must be unique.

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

Programmatic Use

Block Parameter: serverPort

See Also

Introduced in R2020b