TCP Server Configure

Configure TCP server application that uses the specified Ethernet interface

  • Library:
  • Simulink Real-Time / TCP

Description

Configure a TCP server application and initialize a network interface for the application.

The combination of Server IP Address and Subnet mask must be unique across all Ethernet cards in the target computer, including the card for communicating between the development and target computers. Distinguish cards by specifying a different subnet for each. The subnet is the IP address masked by the subnet mask.

The Simulink® Real-Time™ TCP blocks function only when executed on the target computer. When simulated on the development computer, they do nothing.

Ports

Input

expand all

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

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

Selecting the Use host-target connection parameter disables the Server IP address, Subnet mask, PCI bus, and PCI slot parameters and excludes the ports 22222 and 22223 from use by TCP.

Programmatic Use

Block Parameter: useHostTargetConn

The addresses 0.0.0.0 and 255.255.255.255 are invalid IP addresses.

To enable this parameter, clear the Use host-target connection parameter.

Programmatic Use

Block Parameter: serverAddress

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

When you select the Use host-target connection parameter in the TCP configure blocks, you cannot use ports 22222 and 22223. Simulink Simulink Real-Time reserves these ports for its own use.

Programmatic Use

Block Parameter: serverPort

Mask that designates a logical subdivision of a network.

To activate this parameter, clear the Use host-target connection parameter.

Programmatic Use

Block Parameter: SubnetMask

Enter the PCI bus number for the dedicated Ethernet card.

To activate this parameter, clear the Use host-target connection parameter.

Programmatic Use

Block Parameter: PciBus

Enter the PCI slot number for the dedicated Ethernet card.

To activate this parameter, clear the Use host-target connection parameter.

Programmatic Use

Block Parameter: PciSlot

Enter the PCI function number for the Ethernet card.

Programmatic Use

Block Parameter: PciFunction

Introduced in R2017a