8 BUILT-IN ETHERNET FUNCTION INSTRUCTIONS
8.1 Open/Close Processing Instructions
1089
8
■Control data
• This instruction performs close processing for the connection specified by (s1). The setting value used for open processing
is selected by (s2)+0.
• The execution status and the completion status of the SP.SOCCLOSE instruction can be checked with the completion
device (d) and the completion status indication device (d)+1.
• The following figure shows the execution timing of the SP.SOCCLOSE instruction.
Upon completion with an error, the completion status indication device (d)+1 is turned on and an error code is stored in the
completion status (s2)+1.
For the error code stored in the completion status (s2)+1, refer to the following.
MELSEC iQ-R Ethernet User's Manual (Application)
When a connection waiting for opening the SP.SOCCLOSE instruction is specified in TCP Passive mode, a
successful completion occurs when the SP.SOCOPEN or SP.SOCCLOSE instruction is issued and the
connection is closed.
Operand: (s2)
Device Item Description Setting range Set by
+0 System area
+1 Completion status The completion status is stored upon completion of the instruction.
• 0000H: Completed successfully
• Other than 0000H: Completed with an error (error code)
System
• Completion device (d)
This device turns on during END processing of the scan where the SP.SOCCLOSE instruction completes, and turns off during the next END processing.
• Completion status indication device (d)+1
This device turns on or off depending on the completion status of the SP.SOCCLOSE instruction.
When completed successfully: The device remains off.
When completed with an error: The device turns on during END processing of the scan where the SP.SOCCLOSE instruction completes, and turns off during
the next END processing.
Error code
(SD0)
Description
3405H The connection number specified by (s1) is a value other than 1 to 16.
END0 END0END0END0
OFF
OFF
OFF
OFF
ON
ON
Sequence scan
SP.SOCCLOSE
instruction
Completion device (d)
Completion status
indication device (d)+1
Completed successfully
1 scan
Closing a connection
Execution of the instruction
Completed with an error