Mitsubishi Electric MELSEC-L Special Instructions Manual page 260

Melsec-q/l structured programming manual
Hide thumbs Also See for MELSEC-L:
Table of Contents

Advertisement

Setting data
Device
Item
(s2)[0]
System area
(s2)[1]
Completion status
Device
Item
(d1)+0
Receive data length
(d1)+1 to
Receive data
(d1)+n
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.
[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;
7 SOCKET COMMUNICATION FUNCTION INSTRUCTION
258
7.2 SOCRCV Instruction
Setting data
The instruction completion status is stored.
0: Normal completion
Other than 0: Error completion (error code)
Setting data
Data length of the data read from the socket communication
receive data area is stored.
(number of bytes)
Data read from the socket communication receive data area
are stored in ascending address order.
Setting range
Setting side
System
Setting range
Setting side
0 to 2046
System
System
Reads data from
the connection
number 1
Turns normal
completion flag ON
Turns error
completion flag OFF

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q

Table of Contents