The following figure shows the timing of reception processing with the SP.SOCRCV instruction.
Open completion signal
OFF
(SD10680.n)
Sequence program
ON
ON
Receive state signal
OFF
OFF
(SD10682.n)
SP.SOCRCV instruction
Completion device (d2)+0
OFF
Completion device (d2)+1
OFF
Operation error
Error code
Description
(SD0/SD8067)
3405H
The connection number specified by (s1) is other than 1 to 8.
2820H
The size of the receive data exceeds the size of the receive data storage device.
The device number specified by (s2), (d1) or (d2) is outside the range of the number of device points.
2822H
Device that cannot be specified is specified.
3582H
When an instruction which cannot be used in interruption routine program is used.
Program example
When M5000 is turned on, data received from the connected device is read.
• Devices used
Device No.
SD10680
SD10682
D5000
D500
M500
• Program
M5000
SD10680.0 SD10682.0
M500
M500
M501
M501
Consecutively sent data can be consecutively read by connecting the completion device of the SP.SOCRCV
instruction to the execution command as a normally closed contact.
Open
Send
processing
data
ON
END processing
ON
ON
Data
reception
(Only TCP)
Application
Open completion signal
Receive state signal
SP.SOCRCV instruction control data
Received data length and received data storage location
SP.SOCRCV instruction completion device
SP.SOCRCV
"U0"
Data reading
processing
END processing
END processing END processing
Execute SP.SOCRCV instruction
1 scan
When failed
Data
reading
processing
ACK
K1
D5000
D500
SET
SET
7 SOCKET COMMUNICATION FUNCTION
7.4 Socket Communication Function Instructions
Execute reading received data of
M500
connection No.1
M502
Normal completion indication
M503
Abnormal completion indication
END
7
93