EasyManua.ls Logo

CTI 2572-B - Application Examples

Default Icon
119 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.
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.

Table of Contents