258
7 SOCKET COMMUNICATION FUNCTION INSTRUCTION
7.2 SOCRCV Instruction
Setting data
Precautions
• Use the Built-in Ethernet port QCPU of which the function version is B or later and the first five digits of the serial number
are '11012' or higher.
• Use the LCPU other than L02SCPU and L02SCPU-P.
Program example
• The following program reads data received from the external device.
Device
Item
Setting data
Setting range
Setting side
(s2)[0]
System area
(s2)[1]
Completion status
The instruction completion status is stored.
0: Normal completion
Other than 0: Error completion (error code)
System
Device
Item
Setting data
Setting range
Setting side
(d1)+0
Receive data length
Data length of the data read from the socket communication
receive data area is stored.
(number of bytes)
0 to 2046
System
(d1)+1 to
(d1)+n
Receive data
Data read from the socket communication receive data area
are stored in ascending address order.
System
[Structured ladder/FBD]
[ST]
IF((Var_Flag_Inst=TRUE) &(SD1282.0=TRUE) &(SD1286.0=TRUE) &(Var_Result[0]=FALSE))THEN
SP_SOCRCV ( TRUE, "U0", 1, Var_ControlData, D500, Var_Result ); (* Reads data from the connection number 1 *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
SET(TRUE, Var_Flag_Normal); (* Turns normal completion flag ON *)
ELSE (* Error completion *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag ON *)
END_IF;
END_IF;
Reads data from
the connection
number 1
Turns normal
completion flag ON
Turns error
completion flag OFF
Содержание MELSEC System Q
Страница 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Страница 2: ......
Страница 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Страница 309: ...I 307 MEMO ...
Страница 315: ......