6 F 3 B 0 3 6 2

g.TCP reception processing example (Receive request issued first type)

Ladder program flowchart

TCP reception processing start

Socket status read/verify

 

 

No

Are bits B and F both 1?

(Is a connection established?)

 

Yes

 

Is bit 9 set to 0?

No

(In the state other than RCLOSE?)

 

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

Did

the operationNo complete before being

Error result

The processing in this section can be performed at this stage or at the point the instruction terminates abnormally.

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.)

Text was not received within the time limit.

timed out?

Yes

Normal complete?

No

An error occurred in reception processing. The specified socket could not receive the data.

Handle the error according to the completion and socket status.

Yes

Terminate TCP reception processing

108

Page 109
Image 109
Toshiba T2N instruction manual ⎯ 108 ⎯