Chapter 6 Applied Instructions 6.22.2 Explanation of Ethernet Instructions Symbol S 1 : Socket mode S 2 : Socket number S 3 : Communication mode Explanation 1. This instruction opens a TCP or UDP socket. Set S 1 to 1 to open a TCP socket, and set S 1 to 0 to open 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 ES3 Series PLC functions as a client and sends a TCP connection request to the server if S 3 is 1, and the ES3 Series PLC functions as a sever and waits for a TCP connection request from the client if S 3 is 0. To start a UDP connection, set S 3 to 0 or 1. 4. The operand S 1 must be either 0 or 1 (default:
0); the operand S 2 must be between 1–4 (default: 1); the operand S 3 must be either 0 or 1 (default: 0). If exceeding the range, error code H’2003 shows on the PLC. 5. Before using the instruction, set the following setting in HWCONFIG in ISPSoft.
PLC Parameter Setting → Ethernet-Basic → Setting IP address and netmask address PLC Parameter Setting → Ethernet-Advanced → Socket → Enable Socket Function 6-689 API Instruction code Operand Function 2200 SOPEN P S1,S2,S3 Opening a socket Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 S3 BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 S3 Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 - 6 6 _