Using Socket Services By Manipulating Dedicated Control Bits - Omron CS CJ1W-ETN21 Operation Manual

Sysmac cs and cj series ethernet units construction of applications
Hide thumbs Also See for CS CJ1W-ETN21:
Table of Contents

Advertisement

Using Socket Services by Manipulating Dedicated Control Bits

Programming Example
000000
000000
000200
000000
000200
000000 000200
151901
000000 000200
151901
000001
000001
000201
000001
000201
Continued on next page.
@RSET
@SET
MOV(21)
MOV(21)
MOV(21)
MOV(21)
MOV(21)
MOV(21)
SET
RSET
SET
<>(305)
D30027
#0000
RSET
@RSET
@SET
MOV(21)
SET
RSET
After the execution results have been checked, the TCP Close Bit (CIO 000001) is turned OFF.
TCP Passive Open
When the TCP Open Bit (CIO 000000) turns ON, the TCP
000100
Open Error Flag (CIO 000100) is turned OFF and the TCP
Opening Flag (CIO 000200) is turned ON to initialize pro-
cessing.
000200
When the TCP Opening Flag (CIO 000200) turns ON, the
following parameters are written to the parameter area for
#0001
socket number 1.
D30018
D30018: 0001 Hex = UDP/TCP socket No. 1
D30019: 1000 Hex = Local UDP/TCP port No. 4096
D30020 and D30021:
C424 2037 Hex =
#1000
Remote IP address 196.36.32.55
D30019
D30022: 0000 Hex = Any remote UDP/TCP port No.
D30026: 0000 Hex = No timeout time
#C424
D30020
#2037
D30021
#0000
D30022
#0000
D30026
After the parameters have been set, the TCP Passive
Open Request Switch (CIO 151901) is turned ON and
151901
the TCP Opening Flag (CIO 000200) is turned OFF.
000200
If the TCP Passive Open Request Switch (CIO 151901)
turns OFF while the TCP Opening Flag (CIO 000200) is
OFF, the contents of the response code (D30027) in the
000100
Socket Service Parameter Area is checked, and if it is not
0000 Hex (normal end), the TCP Open Error Flag (CIO
000100) is turned ON.
After the execution results have been checked, the TCP
000000
Open Bit (CIO 000000) is turned OFF.
TCP Close
When the TCP Close Bit (CIO 000001) turns ON, the TCP
000101
Close Error Flag (CIO 000101) is turned OFF and the TCP
Closing Flag (CIO 000201) is turned ON to initialize proces-
sing.
000201
When the TCP Closing Flag (CIO 000201) turns ON, the
following parameter is written to the parameter area for
#0001
socket number 1.
D30018: 0001 Hex = UDP/TCP socket No. 1
D30018
After the parameter has been set, the Close Request
Switch (CIO 151905) is turned ON and the TCP Closing
Flag (CIO 000201) is turned OFF.
151905
If the Close Request Switch (CIO 151905) turns OFF while
the TCP Opening Flag (CIO 000201) is OFF, the contents
of the response code (D30027) in the Socket Service
000201
Parameter Area is checked, and if it is not 0000 Hex (normal
end), the TCP Close Error Flag (CIO 000101) is turned ON.
Section 6-7
129

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs cs1w-etn21Sysmac cs1w-etn21Sysmac cj1w-etn21

Table of Contents