Delta DVP-ES3 — 6.22.2 Explanation of Ethernet Instructions

DVP-ES3 Series Programming Manual Symbol S 1 : Socket mode S 2 : Socket number Explanation 1. This instruction closes the TCP or UDP socked specified by S 1 . Set S 1 to 0 to close a TCP socket, and set S 1 to 1 to close a UDP socket. 2. S 2 is the socket number. It should correspond to the Ethernet socket number; up to 4 can be set. 3. The operand S 1 must be either 0 or 1 (default: 0); the operand S 2 must be between 1–4 (default: 1). If exceeding the 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 execution of the instruction is complete. After a TCP socket is closed, the corresponding flags are OFF. 6. After the instruction is executed to close a UDP socket, the corresponding flag is 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. 6-700 API Instruction code Operand Function 2203 SCLOSE P S1,S2 Closing a socket Device X Y M S T C HC D FR SM SR E K 16# “$” F S1        S2        BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1    S2    Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 - 6 _ TCP Socket Number Connection Closed Error Flag 1 SM1274 SM1277 2 SM1282 SM1285