CTI 2572-A Installation and Operation Guide
42
5.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-A on the network at
IP address 192.168.177.01 (hex C0.A8.B1.01) and TCP port 1505. The TCP protocol is selected.
Offset
Description
Hex
Decimal
0 Error
Word
0000
0
1
Command Code (Create Socket)
0003
03
2
Connection Number (19221 - 19228)
4B15
19221
3
Protocol Manager Number
0024
36
4
Startup Option Bits
0000
0
5
Type of Service (1 = TCP, 2 = UDP)
0001
1
6
Remote Device - High 16 bits of IP Address
C0A8
49320
7
Remote Device - Low 16 bits of IP Address
B101
45313
8
Unused (Set to 0)
0000
0
9
TCP/UDP Port Number
05E1
1505
10-15
Unused (Set to 0)
0000
0
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.
Summary of Contents for 2572-A
Page 8: ......
Page 16: ......
Page 28: ......
Page 32: ......
Page 60: ......
Page 84: ......
Page 96: ......
Page 104: ...CTI 2572 A Installation and Operation Guide 96 WX WY Quick Reference...
Page 112: ......
Page 116: ......
Page 126: ......
Page 130: ...CTI 2572 A Installation and Operation Guide 122 WX WY Quick Reference...