15-37
15 Ethernet
CP2E CPU Unit Software User’s Manual(W614)
15-5 Soc
ket Ser
vic
es
15
15-5-
3
Soc
k
et Ser
v
ices a
nd Soc
k
et Status
Precautions for Correct Use
Precautions for Correct Use
A Socket Service Parameter Area cannot be used for other sockets once open processing has
been successfully completed for it. Check the socket status before attempting to open a socket.
TCP socket status is provided in words m+4 to m+6 in the DM Area for sockets 1 to
3
.
When a send or receive request is made, the data will be automatically sent or received accord-
ing to the send/receive data address in the Socket Service Parameter Area. When processing
has been completed, a response code will be automatically stored in the Socket Service Param-
eters.
When using socket services, it is important to consider the timing of the status changes in the Socket
Status Area. The diagram below shows a flowchart for opening UDP. The flow is similar for other socket
services. Replace the names of the appropriate flags in the flowchart to adapt it to other socket ser-
vices.
Note
For details about timing charts, refer to
SECTION 6 Socket Service
s
in the
Ethernet Unit
s
Con
s
truction of
Application
s
Operation Manual
(Cat. No. W421).
Socket services cannot support CMND command.
15-5-3 Socket Services and Socket Status
Check TCP Connection/UDP Open Flag.
The specified UDP socket is
already open.
T
u
rn O
N
UDP Open Re
qu
est S
w
itch.
Start UDP Open.
OFF?
Program Flow
Is Bit 15 (Open Flag) in the socket stat
u
s
w
ord for
the socket
b
eing
u
sed OFF?
(Checks to see if the socket is open
b
efore com-
m
u
nications and close processing.)
YES
Error Evaluation
UDP socket opened.
N
O
This Socket Ser
v
ice Re
qu
est S
w
itch is
u
sed to re
qu
est
opening of a UDP socket to the Ethernet Unit.
Confirm end of processing.
0000?
YES
N
O
O
N
/OFF?
OFF
This Socket Ser
v
ice Re
qu
est S
w
itch that
w
as t
u
rned
O
N
w
ill
b
e t
u
rned OFF
b
y the Ethernet Unit
w
hen
processing has
b
een completed.
Check response code.
Is the response code 0000, indicating a normal end?
An error occ
u
rred. The specified
socket co
u
ld not
b
e opened.
Summary of Contents for SYSMAC CP Series
Page 3: ......
Page 32: ...1 Overview 1 4 CP2E CPU Unit Software User s Manual W614 ...
Page 44: ...3 CPU Unit Operation 3 8 CP2E CPU Unit Software User s Manual W614 ...
Page 116: ...6 I O Allocation 6 8 CP2E CPU Unit Software User s Manual W614 ...
Page 144: ...7 PLC Setup 7 28 CP2E CPU Unit Software User s Manual W614 ...
Page 170: ...10 Interrupts 10 14 CP2E CPU Unit Software User s Manual W614 ...
Page 200: ...11 High speed Counters 11 30 CP2E CPU Unit Software User s Manual W614 ...
Page 272: ...12 Pulse Outputs 12 72 CP2E CPU Unit Software User s Manual W614 ...
Page 278: ...13 PWM Outputs 13 6 CP2E CPU Unit Software User s Manual W614 ...
Page 460: ...18 Programming Device Operations 18 28 CP2E CPU Unit Software User s Manual W614 ...
Page 576: ...Revision 2 CP2E CPU Unit Software User s Manual W614 ...
Page 577: ......