Delta AH500 — 6.22.2 Explanation of Ethernet Instructions

AH500 Programming Manual Symbol: S 1 : Socket mode Word S 2 : Socket number Word Explanation: 1. S 1 is 1 if users want to close the TCP socket, and S 1 is 0 if users want to close the UDP socket. S 2 is the socket number. 2. The operand S 1 should be either 0 or 1, and the operand S 2 should be within the range between 1 and 8. 3. Before closing the socket, users need to make sure that the socket has been connected. Otherwise, the instruction is not executed. 4. If the TCP socket is closed by the server, the client continues to be connected to the local communication port. If the TCP socket is closed is by the client, the client is not connected to the local communication port.

After the instruction is executed to close the TCP socket, the corresponding flag is OFF. 5. After the instruction is executed to close the UDP socket, the corresponding flag is OFF. 6. If the TCP socket is closed, and no error occurs after the instruction is executed, the PLC is not connected to the remote device, and the flag related to the connection’s being closed is ON. If the connection is closed successfully, the flag related to the connection’s being closed is OFF. If an error occurs, the error flag is ON. 7. If the UDP socket is close, and no error occurs after the instruction is executed, the flag related to the connection’s having been started is OFF.

If an error occurs, the error flag is ON. 6-516 API Instruction code Operand Function 2203 SCLOSE P S , S 1 2 Closing the socket Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1           S 2           Pulse instruction 16-bit instruction (5 Steps) 32-bit instruction AH500 AH500 - Socket number Being closing the Error flag connection 1 SM1274 SM1277 2 SM1282 SM1285 3 SM1290 SM1293 4 SM1298 SM1301 5 SM1306 SM1309 6 SM1314 SM1317 7 SM1322 SM1325 8 SM1330 SM1333 Socket number Error flag 1 SM1338 2 SM1343 3 SM1348 4 SM1353 5 SM1358