Main Content

TCP Server

Configure TCP server

Since R2020b

  • TCP Server block

Libraries:
Simulink Real-Time / IP

Description

The TCP Server block configures a TCP server.

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 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

Version History

Introduced in R2020b

See Also