6 F 3 B 0 3 6 2

g.UDP reception processing example (Socket status monitoring type)

Ladder program flowchart

UDP reception processing start

Socket status read/verify

Are bits C and E both 1?

No

(Opened state?)

 

Yes

 

Is bit A set to 1?

No

(Reception text present.)

 

Yes

 

Execute a UDP receive request

(CMD = 0033H).

Hold the input of function block in the on state until the RECV instruction completes.

Instruction completion

Error result

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

The specified UDP socket is in the closed state. (Open processing is required.)

The specified UDP socket has not received data.

Verify the status

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 UDP reception processing

93

Page 94
Image 94
Toshiba T2N instruction manual ⎯ 93 ⎯