CTI 2572-B / 2500C-2572-B Installation and Operation Manual 48
9.6. Application Examples
TCP Client Example
This example creates a TCP connection to another module and writes data from the local PLC V memory to V
memory in a remote PLC.
Create Socket Command Block
This command block creates a TCP socket that is associated with another 2572-B on the network at IP address
192.168.177.01 (hex C0.A8.B1.01) and TCP port 1505. The TCP protocol is selected.
Command Code (Create Socket)
Connection Number (19221 - 19228)
Type of Service (1 = TCP, 2 = UDP)
Remote Device - High 16 bits of IP Address
Remote Device - Low 16 bits of IP Address
Depending on your application requirements, you may wish to create the socket(s) immediately after the
network server is started and leave the socket active all the time. If you do not need to free up a socket for
another use, you will probably select this option. Alternately, you could create the socket, send the data, and
then close the socket.
NOTE:
You should use Coupled Mode logic since you want to execute this command only once per trigger.
See Appendix D for additional information on command modes.