■Control data
Device
Item
(s2)+0
System area
(s2)+1
Completion status
(d1)+0
Received data length
(d1)+1 to
Received data
(d1)+n
*1 The "Set by" column indicates the following.
System: The CPU module stores the execution result of the SP.SOCRCV instruction.
• When the SP.SOCRCV instruction is executed, data is read from socket communication receiving data area
at END processing. Therefore, executing the SP.SOCRCV instruction will increase the scan time.
• When odd-byte data is received, an invalid byte is stored to the higher byte of the device that stores the last
received data.
Processing details
This instruction reads received data of the connection specified in (s1) from the socket communication receive data area in
the END processing after execution of the SP.SOCRCV instruction.
Receive data
(d1)+0
length
Receive data
(d1)+1
(d1)+2
Receive data
Receive data
(d1)+n
The result of the SP.SOCRCV instruction can be checked with the completion device (d2)+0 and (d2)+1.
• Completion device (d2)+0: Turns on in the END processing of the scan after completion of the SP.SOCRCV instruction, and
turns off in the next END processing.
• Completion device (d2)+1: Turns on or off according to the status at the time of completion of the SP.SOCRCV instruction.
Status
When completed
When failed
7 SOCKET COMMUNICATION FUNCTION
92
7.4 Socket Communication Function Instructions
Description
Completion status is stored
0000H: Completed
Other than 0000H: Failed (Error code)
Refer to Page 150 Error Codes
The length of the data which was read from the Socket
communication receiving data area is stored. (in bytes)
The data which was read from the Socket communication
receiving data area is stored in order.
CPU module
Socket
communication
receive data area
Connection
number
specified in (s1)
SP.SOCRCV
(Reading
receive data)
Description
Remains off.
Turns on in the END processing of the scan after completion of the SP.SOCRCV instruction, and turns off in the next END
processing.
External device
Receiving
Setting range
Set by
System
0 to 2046
System
System
*1