Delta AS Series Programming Manual page 1094

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

API
Instruction code
2203
SCLOSE
Device
X
Y
M
S
1
S
2
Data
type
S
1
S
2
Symbol
Explanation
1.
This instruction closes the socket specified by S
2.
S
is the socket number. It should correspond to the Ethernet socket number; up to 4 can be set.
2
3.
The operand S
must be either 0 or 1 (default: 0); the operand S
1
range, error code H'2003 shows on the PLC.
4.
Before closing the socket, make sure that the socket is connected or else the instruction is not executed.
5.
If the client closes a TCP socket, the server continues to be connected to the local communication port (the flag for
successful connection is ON). If the server closes a TCP socket, the server is no longer connected to the local
communication port after the instruction is executed. When a TCP socket is closed, the corresponding flags are OFF.
6.
After the instruction is executed to close a UDP socket, the corresponding flags are OFF.
7.
If a TCP socket is closed, and no error occurs after the instruction is executed, the connection with the remote device
starts to close and the flag for closing connection is ON. If the connection is closed successfully, the flag for closing
connection is OFF. If an error occurs, the error flag is ON.
TCP Socket Number
1
2
3
4
Operand
,S
P
S
1
2
S
T
C
HC
Pulse instruction
AS
. Set S
1
1
Connection Closed
SM1274
SM1282
SM1290
SM1298
Ch ap te r 6 Ap pl ie d Instruc ti ons
D
FR
SM
SR
16-bit instruction
AS
: Socket mode
S
1
: Socket number
S
2
to 0 to close TCP socket, and set S
must be between 1–4 (default: 1). If exceeding the
2
Function
Closing a socket
E
K
16#
"$"
F
32-bit instruction
-
to 1 to close UDP socket.
1
Error Flag
SM1277
SM1285
SM1293
SM1301
6 - 8 1 5
6_
6

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents