107

6 F 3 B 0 3 6 2
f. TCP reception processing example (Socket status monitoring type)
Ladder program flowchart Error result
TCP reception processing start
Socket status read/verify
Are bits B and F both 1?
(Is a connection established?)
Yes
Is bit 9 set to 0?
(In the state other than RCLOSE?)
Yes
Is bit A set to 1?
(Reception text present.)
Yes
Execute a TCP receive request
(CMD = 0038H).
Hold the input of function block in the
on state until the RECV instruction
completes.
Instruction
completion
Verify the status
Normal complete?
Yes
Terminate TCP reception processing
The processing in this section can be
performed at this stage or at the point the
instruction terminates abnormally.
No
No
No
A connection has not been established with
the specified TCP socket. (Open processing
is required.)
The specified TCP socket is:
Closed by the remote port
(The socket must be closed by the local
port.)
The specified TCP socket has not received
data.
No
An error occurred in reception processing.
The specified socket coule not receive the
data.
Handle the error according to the
completion and socket status.