157
Using Socket Services with CMND(490) Section 6-3
Programming Example
If the Port Enabled Flag (A20200) turns ON and the Clos-
ing Flag (CIO 150103) turns OFF while the UDP Closing
Flag (CIO 000201) is OFF, checks are made and if any of
the following are true, the UDP Close Error Flag (CIO
000101) is turned ON.
The Results Storage Error Flag (CIO 150114) is ON.
The contents of the Response Storage Area set in the
command code (D01050) is not 0000 Hex (normal end).
The Network Communications Error Flag (A21900) is ON.
After the execution results have been checked, the UDP
Close Bit (CIO 000001) is turned OFF.
When the UDP Closing Flag (CIO 000201) turns ON, the
status of the Port Enabled Flag (A20200) is checked to
be sure it is ON and a UDP CLOSE REQUEST command
is sent using CMND(490).
D01030: First command word
D01040: First response word
D00010: First control data word
The UDP Closing Flag (CIO 000201) is also turned OFF.
UDP Close
When the UDP Close Bit (CIO 000001) turns ON, the
UDP Close Error Flag (CIO 000101) is turned OFF and
the UDP Closing Flag (CIO 000201) is turned ON to ini-
tialize processing.
If the Port Enabled Flag (A20200) turns ON and the Open-
ing Flag (CIO 150100) turns OFF while the UDP Opening
Flag (CIO 000200) is OFF, checks are made and if any of
the following are true, the UDP Open Error Flag (CIO
000100) is turned ON.
The Results Storage Error Flag (CIO 150114) is ON.
The contents of the Response Storage Area set in the
command code (D01020) is not 0000 Hex (normal end).
The Network Communications Error Flag (A21900) is ON.
After the execution results have been checked, the UDP
Open Bit (CIO 000000) is turned OFF.
When the UDP Opening Flag (CIO 000200) turns ON,
the status of the Port Enabled Flag (A20200) is checked
to be sure it is ON and a UDP OPEN REQUEST com-
mand is sent using CMND(490).
D01000: First command word
D01010: First response word
D00000: First control data word
The UDP Opening Flag (CIO 000200) is also turned
OFF.
UDP Open
When the UDP Open Bit (CIO 000000) turns ON, the
UDP Open Error Flag (CIO 000100) is turned OFF and
the UDP Opening Flag (CIO 000200) is turned ON to
initialize processing.
Continued on next page.
000200
CMND(490)
@RSET
000000
@SET
000000 000200 A20200
RSET
SET
000000 A020200 150100 150114
<>(305)
A021900
000200
RSET
000000 A020200 150100
000201
CMND(490)
@RSET
000001
@SET
000001 000201 A20200
RSET
SET
000001 A020200 150103 150114
<>(305)
A021900
000201
RSET
000001 A020200 150103
000100
000200
D01000
D01010
D00000
000200
000100
D01020
#0000
000000
000101
000201
D01030
D01040
D00010
000201
000101
D01050
#0000
000001