TCP Server
Libraries:
Simulink Real-Time /
IP
Description
The TCP Server block configures a TCP server.
Examples
Target to Development Computer Communication by Using TCP
Use TCP blocks to send data from the target computer to MATLAB running on the development computer.
Ports
Input
Enable — Connect block to remote Ethernet device
integer
If Enable
is greater than zero, the block connects to the Ethernet
device. Otherwise, the block does not
connect to the Ethernet device.
Output
Status — Device returns a status of not connected or connected
0
| 1
The status value is one of:
0
— Not connected1
— 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
Use host-target connection — Use Ethernet connection between the development computer and target computers
'off'
(default) | 'on'
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 |
Server IP address — IP address of the server device that is being
configured
x.x.x.x
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 |
Server port — IP port of the server device that is being configured
1–65535
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)