Wiki source code of 14 Ethernet communication

Version 1.1 by Leo Wei on 2022/06/08 12:57

Hide last authors
Leo Wei 1.1 1 = **Ethernet overview** =
2
3 == **{{id name="_Toc3979"/}}{{id name="_Toc14022"/}}{{id name="_Toc10482"/}}{{id name="_Toc7863"/}}IP address** ==
4
5 IP address consists of network address and host address, and distinguished by subnet mask. If programming device (such as PC) use network card to connect to LAN, the programming device and PLC must be in the same subnet. You can specify the subnet of a device by combining an IP address with a subnet mask.
6
7 The network address could be calculated by performing logic and operation between IP address and subnet mask. If the addresses are in the same network, it means that communication is possible.
8
9 (% class="table-bordered" %)
10 |(% rowspan="2" %)**Number**|(% colspan="3" %)**Network device 1**|(% colspan="3" %)**Network device 2**|(% rowspan="2" %)**Network connection**
11 |**IP**|**Subnet mask**|**Network address**|**IP**|**Subnet mask**|**Network address**
12 |1|192.168.0.1|255.255.255.0|192.168.0.0|192.168.0.10|255.255.255.0|192.168.0.0|Yes
13 |2|192.168.0.1|255.255.255.0|192.168.0.0|192.168.1.10|255.255.255.0|192.168.1.0|No
14 |3|192.168.0.1|255.255.255.1|192.168.0.1|192.168.0.10|255.255.255.1|192.168.0.0|No
15
16 == **{{id name="_Toc16835"/}}{{id name="_Toc518"/}}{{id name="_Toc4567"/}}{{id name="_Toc24276"/}}Set PC network address** ==
17
18 (1) Click “Control panel”→”Network and Internet”→”Network and sharing center”.
19
20 (% style="text-align:center" %)
21 [[image:14_html_c2a8809528586e62.png||class="img-thumbnail"]]
22
23 (2) Click “Ethernet”→”Properties”→”Internet protocol version 4”.
24
25 (3) Set the IP address and subnet mask on the same network address as the PLC. The IP address that has been used in LAN could not be set. If the IP of PLC is 192.168.8.8, and the subnet mask is 255.255.255.0. The IP address as shown below could be set to connect PC to PLC.
26
27 (% style="text-align:center" %)
28 [[image:14_html_a9fe3141424b96c7.png||class="img-thumbnail"]]
29
30 == **{{id name="_Toc27521"/}}{{id name="_Toc29278"/}}{{id name="_Toc9496"/}}{{id name="_Toc10920"/}}Test the network connection status** ==
31
32 Test the connection status between PC and PLC by ping command.
33
34 (1) Press “WIN” and “R” keys, and input “cmd”.
35
36 (% style="text-align:center" %)
37 [[image:14_html_dabf04cdadd8a3d8.png||class="img-thumbnail"]]
38
39 (2) If the IP address of PLC is 192.168.8.8.
40
41 1) Input “ping 192.168.8.8 ”, and enter. If it display ”100% loss”, it means that PLC could be connected.
42
43 (% style="text-align:center" %)
44 [[image:14_html_7aa7f1c9b25ffe38.png||class="img-thumbnail"]]
45
46 2) Input “ping 192.168.8.8 ”, and enter. If it display ”0% loss”, it means that it could be connected to PLC.
47
48 (% style="text-align:center" %)
49 [[image:14_html_62b05ca96148a3f1.png||class="img-thumbnail"]]
50
51 3) The command “ping network device IP” could only be use four times. To ping network devices continuously, run “ping network device ip-t” command, it is shown as below.
52
53 (% style="text-align:center" %)
54 [[image:14_html_d69739e24edf0b2d.png||class="img-thumbnail"]]
55
56 == **PLC Editor2 connect to PLC with Ethernet** ==
57
58 (1) Transfer settings →Ethernet configuration → Input IP address.(**✎Note:** The address of NIC must be on the same network segment as that of the PLC.)
59
60 (% style="text-align:center" %)
61 [[image:14_html_144b2bfcd0791114.png||class="img-thumbnail"]]
62
63 (2) Click “Communication test” to comfirm the communication.
64
65 (% style="text-align:center" %)
66 [[image:14_html_d0e31208a663b835.png||class="img-thumbnail"]]
67
68 (3) After successful connection, PLC is able to operate.
69
70 == **PLC Editor2 Ethernet search funtion** ==
71
72 (1) Transfer settings → NIC comfiguration → Device search. (**✎Note:** The address of NIC must be on the same network segment as that of the PLC.)
73
74 (% style="text-align:center" %)
75 [[image:14_html_4d043668ca526831.png||class="img-thumbnail"]]
76
77 (2) The search interface is as below. Click search to display the PLC devices in the LAN, and select the corresponding device and click OK to communicate.
78
79 (% style="text-align:center" %)
80 [[image:14_html_15c7655b852e111.png||class="img-thumbnail"]]
81
82 (3) The IP address of one is filled in automatically.
83
84 (% style="text-align:center" %)
85 [[image:14_html_2d7b6e1b3d27381a.png||class="img-thumbnail"]]
86
87 = {{id name="_Toc15427"/}}{{id name="_Toc12664"/}}{{id name="_Toc24930"/}}{{id name="_Toc1600"/}}**Ethernet configuration** =
88
89 == **Hardware interface** ==
90
91 LX5V is RJ45 specification
92
93 (% class="table-bordered" %)
94 |**Contents**|**Ethernet interfece**
95 |Transmission speed|(((
96 10Mbps: 10BASE-T
97
98 100Mbps: 100BASE-TX
99
100 10Mbps/100Mbps self-adaptive
101 )))
102 |Modulation|Basband
103 |Topology|Starlike
104 |Transmission medium|Class 5 or above twisted pairs or shielded twisted pairs with aluminum foil and woven mesh
105 |Transmission distance|The distance between nodes: 100m or less
106 |Linking number|8
107
108 == **{{id name="_Toc31870"/}}{{id name="_Toc15967"/}}{{id name="_Toc3350"/}}{{id name="_Toc2558"/}}Total numbers of links supported** ==
109
110 When LX5V-N series PLC is powered on, ModbusTCP server monitor is automatically enabled by default. 2 to 8 ModbusTCP clients are supported, and the port number is 502. (PLC host computer upload and download, monitor and HMI communication protocol are supported by the ModbusTCP server.)
111
112 The number of configurable links is 6. The free configurations of TCP server free protocol, TCP client free protocol, ModbusTCP server and ModbusTCP client are supported.
113
114 (% class="table-bordered" %)
115 |**Communicaition protocol**|**Maximum links supported**
116 |ModbusTCP server|8
117 |ModbusTCP client|6
118 |Free TCP server|6
119 |Free TCP client|6
120
121 == **{{id name="_Toc9117"/}}{{id name="_Toc18527"/}}{{id name="_Toc22330"/}}{{id name="_Toc12448"/}}IP address settings** ==
122
123 (1) Set by programming software.
124
125 Project manager →Parameter→PLC parameters→Ethernet configuration. Download selected parameters through PLC after modification. The download takes effect after STOP->RUN is complete.
126
127 **✎Note: **The maximum link supported of ModbusTCP servers is used to set the maximum number of external ModbusTCP servers that could connect to PLC simultaneously. The range is from 2 to 8.
128
129 (% style="text-align:center" %)
130 [[image:14_html_5d3039a657266507.png||class="img-thumbnail"]]
131
132 (2) Set by special device.
133
134 Write IP address, subnet mask, and default gateway in SD2680 to SD2691.
135
136 SM2680 is set to ON, static IP function is enable. (**✎Note:** DHCP function is not supported by LX5V currently.)
137
138 SM2683 is set to ON, IP identification could be modified.
139
140 New IP address takes effect when STOP->RUN or after power-on again.
141
142 (% class="table-bordered" %)
143 |(% style="width:130px" %)**SM number**|(% style="width:293px" %)**Name**|**Contents**|**R/W**|**SD number**|**Name**
144 |(% style="width:130px" %)SM2680|(% style="width:293px" %)Static set IP switch|(((
145 ON: Static set
146
147 OFF: Automatically configurate IP address by router DHCP, and could not be modify IP. When STOP->RUN takes effect.
148 )))|R/W|SD2680|The 1st byte of IP address
149 |(% style="width:130px" %)SM2681|(% style="width:293px" %)Display current network information|(((
150 Refresh current IP gateway subnet mask after ON.
151
152 Turn OFF after the fresh is complete.
153 )))|R/W|SD2681|The 2nd byte of IP address
154 |(% style="width:130px" %)SM2682|(% style="width:293px" %)Display current MAC information|(((
155 Refresh current MAC after ON.
156
157 Turn OFF after the fresh is complete.
158 )))|R/W|SD2682|The 3rd byte of IP address
159 |(% style="width:130px" %)SM2683|(% style="width:293px" %)The modification flag of IP, subnet mask and gateway|(((
160 ON: Modifiable
161
162 OFF: Unmodifiable
163
164 (After setting to ON, modify when stop->run, and automatically turn OFF after the modification)
165 )))|R/W|SD2683|The 4th byte of IP address
166 |(% style="width:130px" %)SM2684|(% style="width:293px" %) | | |SD2684|The 1st byte of subnet mask
167 |(% style="width:130px" %)SM2685|(% style="width:293px" %) | | |SD2685|The 2nd byte of subnet mask
168 |(% style="width:130px" %)SM2686|(% style="width:293px" %) | | |SD2686|The 3rd byte of subnet mask
169 |(% style="width:130px" %)SM2687|(% style="width:293px" %) | | |SD2687|The 4th byte of subnet mask
170 |(% style="width:130px" %)SM2688|(% style="width:293px" %) | | |SD2688|The 1st byte of default gateway
171 |(% style="width:130px" %)SM2689|(% style="width:293px" %) | | |SD2689|The 2nd byte of default gateway
172 |(% style="width:130px" %)SM2690|(% style="width:293px" %) | | |SD2690|The 3rd byte of default gateway
173 |(% style="width:130px" %)SM2691|(% style="width:293px" %) | | |SD2691|The 4th byte of default gateway
174
175 == **{{id name="_Toc4089"/}}{{id name="_Toc24639"/}}{{id name="_Toc2733"/}}{{id name="_Toc9277"/}}TCP protocol** ==
176
177 TCP protocol, short for Transport Control Protocol, is Is a connection-oriented and reliable transport layer protocol. Connection-oriented means that a normal TCP transmission need to be completed by establishing a specific virtual circuit connection between TCP client and TCP server. To transfer data over TCP, a connection must be established between hosts at both ends.
178
179 == **{{id name="_Toc8484"/}}{{id name="_Toc24972"/}}{{id name="_Toc28751"/}}{{id name="_Toc29133"/}}UDP protocol** ==
180
181 UDP protocol, short for User Datagram Protocol, is a connectionless transport layer protocol. There is no guarantee of data order, a risk of data loss. It provides a simple and unreliable information transfer service for transactions and is Mainly used in data broadcasting.
182
183 == **{{id name="_Toc21446"/}}{{id name="_Toc4791"/}}{{id name="_Toc10286"/}}Socket** ==
184
185 When the application layer communicates data over the transport layer, TCP encounters the problem of providing concurrent services to multiple application processes at the same time. Multiple TCP connections or multiple application processes may require data to be transmitted over the same TCP protocol port. To distinguish between different application processes and connections, many computer operating systems provide interfaces called sockets for applications to interact with the TCP/IP protocol.
186
187 To generate a socket, there are three main parameters: the IP address of the destination of the communication, the transport layer protocol used (TCP or UDP) used, and the port number used. By combining these three parameters and binding to a socket, the application layer and the transport layer can distinguish communication from different application processes or network connections through the socket interface, realizing concurrent services for data transmission.
188
189 == **{{id name="_Toc1095"/}}{{id name="_Toc17322"/}}{{id name="_Toc3808"/}}{{id name="_Toc23814"/}}Establish an Ethernet link by socket** ==
190
191 At least one pair of sockets is required to establish a socket link.
192
193 For TCP, the two sockets, one running on the TCP client and the other running on the TCP server. The connection process between sockets is divided into three steps: server monitor, client request, connection confirmation, also known as the three-way handshake.
194
195 **Server monitor: **After the server socket is enabled, it does not locate the specific client socket, but is in a state of waiting for the connection, monitoring the network status in real time, and waiting for the client's connection request.
196
197 **Client request: **Refers to a connection request made by a client-side socket, and the target of the connection is the server-side socket. To do this, the client-side socket must first describe the socket of the server to which it is connecting, indicate the address and port number of the server-side socket, and then make a connection request to the server-side socket
198
199 **Connection confirmation: **Refers to when the server-side socket listens to or receives a connection request from the client socket, it responds to the client socket request, establishes a new thread, sends the description of the server-side socket to the client. Once the client confirms this description, the connection is established. The server-side socket continues to listen and continues to receive connection requests from other client-side sockets.
200
201 (% style="text-align:center" %)
202 [[image:14_html_c4fd785c7111eade.gif||class="img-thumbnail"]]
203
204 In order to simplify the complexity of ladder programming, sockets have been partially simplified:
205
206 For TCP clients, merge socket() and connect() into SOCOOPEN instructions. After this function is enabled, automatically connect to the TCP server.
207
208 For TCP server, merge socket(), bind(), listen(), and accept() into SOCOOPEN instructions. After this function is enabled, automatically listen to server connection. If the server is successfully connected, the corresponding position is marked and the IP address and port information of the server are displayed.
209
210 For UDP, there is no concept of client and server. Creating a UDP socket only requires local address information and remote address information, without connection operations. Communication could be made when the address information of the local socket and the remote socket could be matched, that is, the remote address of the local socket is the same as the local address of the remote socket, and the local address of the local socket is the same as the remote address of the remote socket. For UDP connections, the connection could be established immediately by calling the SOCOPEN instruction.
211
212 == **{{id name="_Toc3008"/}}{{id name="_Toc10015"/}}{{id name="_Toc32444"/}}{{id name="_Toc444"/}}LX5V-N socket configuration instructions** ==
213
214 LX5V socket could be configured in Project manager→Extended function→Ethernet, right click to create socket configuration, as shown below.
215
216 (% style="text-align:center" %)
217 [[image:14_html_e73123ae26a00972.png||class="img-thumbnail"]]
218
219 **Socket ID:** The number of the socket ranges from K0 to K5, and a total of six are supported. The socket is used to specify links, and each ID could be used for one link and could not be defined repeatedly.
220
221 **Communication protocol: **TCP protocol and UDP protocol are supported.
222
223 **Operating mode: **For TCP, client and server could be selected. For UDP, this is meaningless.
224
225 **Local port:**
226
227 For TCP client mode, the local port would be automatically allocated by PLC without setting.
228
229 For TCP server mode, the local port ranges from 1 to 65535. Port 502 is used for internal ModbusTCP and can not be set to port 502.
230
231 For UDP mode, the local port ranges from 1 to 65535. Port 1092 is used for scanning protocol of Wecon and can not be set to port 1092.
232
233 **Destination IP: **It is valid in TCP client mode or UDP mode, and specify the IP of opposite end device to be linked.
234
235 **Destination port: **It is valid in TCP client mode or UDP mode, and specify the port number of opposite end device to be linked.
236
237 **Receive timeout period(10ms): **After the PLC sends the data, If the response of the opposite end device exceeds the timeout period, it is considered that the network has an abnormality and sets the wrong flag.
238
239 **TCP keep-alive mechanism: **When using the TCP protocol for communication, if the communication line is idle in most cases, there is only a small amount of data to be sent and received, but it is necessary to keep the link open continuously, or disconnect in time in the case of a drop, crash or forced end of the process at the other end of the communication, the keep-alive mechanism can be used to communicate.
240
241 When the keep-alive function is turned on, after the two parties stop communicating for 5 seconds, the TCP connection that opens the keep-alive function will send a survival confirmation message to the other party. If the other party responds, it means that the other party is alive and online. The connection is normal, and the survival confirmation message is sent again after 5 seconds to continue to confirm. If the other party does not confirm the survival, it means that the other party has a problem, the end that opens the keep-alive will continue to send it a survival confirmation message after 5 seconds. When the opposite end does not respond for 9 consecutive times, it means that the opposite end communication is abnormal, and the end that opens the keep-alive will actively disconnect.
242
243 = **{{id name="_Toc15732"/}}{{id name="_Toc1158"/}}{{id name="_Toc32054"/}}{{id name="_Toc21761"/}}Ethernet instruction** =
244
245 == **{{id name="_Toc23288"/}}{{id name="_Toc6733"/}}{{id name="_Toc31937"/}}{{id name="_Toc3966"/}}SOCOPEN/Create a socket link** ==
246
247 Create socket link specified by (s), and update the data information of this socket link to (d1) and the status information to (d2).
248
249 -[SOCOPEN (s) (d1) (d2)]
250
251 **Content, range and data type**
252
253 (% class="table-bordered" %)
254 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
255 |(s)|Socket ID|0 to 5|Signed BIN 16 bit|ANY16
256 |(d1)|The start device that stores the data information of socket links|-|Signed BIN 16 bit|ANY_ELEMENTARY
257 |(d2)|The start device that stores the status information of socket links|-|Bit|ANY_BOOL
258
259 **Device used**
260
261 (% class="table-bordered" %)
262 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="12" %)**Devices**|**Offset modification**|(((
263 **Pulse**
264
265 **extension**
266 )))
267 |**Y**|**M**|**S**|**SM**|**D.b**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
268 |(% rowspan="3" %)SOCOPEN|Parameter 1| | | | | | | | | | |●|●| |
269 |Parameter 2| | | | | |●|●|●|●|●| | | |
270 |Parameter 3|●|●|●|●|●| | | | | | | | |
271
272 **Features**
273
274 ✎Create the socket link specified in (s) and update the link information in (d1) and (d2).
275
276 ✎When the instruction is turned on, the devices specified in (d1) and (d2) will be used in other Ethernet instructions using the same socket ID. (SOCSEND, SOCRECV, SOCCLOSE, SOCMTCP)
277
278 ✎(d1) Specifies the following information (a total of 14 word devices):
279
280 (% class="table-bordered" %)
281 |**Device**|**Function**
282 |(d1)|Local port number
283 |(d1+1)|The 1st segment of the destination IP
284 |(d1+2)|The 2nd segment of the destination IP
285 |(d1+3)|The 3rd segment of the destination IP
286 |(d1+4)|The 4th segment of the destination IP
287 |(d1+5)|Destination port number
288 |(d1+6)|Receive timeout period(10ms)
289 |(d1+7)|Actual receiving length (byte)
290 |(d1+8)|Current link error code
291 |(d1+9)|Numbers of communication errors high bit
292 |(d1+10)|Numbers of communication errors low bit
293 |(d1+11)|Reserved
294 |(d1+12)|Reserved
295 |(d1+13)|Reserved
296
297 ✎(d2) Specifies the following information (a total of 14 bit devices):
298
299 (% class="table-bordered" %)
300 |**Device**|**ON status**|**OFF status**
301 |(d2)|Connecting|The connection is not turned on
302 |(d2+1)|Connection completed|Connecting or not connected
303 |(d2+2)|Sending data(used by SOCSEND instruction)|Data is not sent or data sending is complete
304 |(d2+3)|Data sending completed(used by SOCSEND instruction)|The instruction is not started or being sent.
305 |(d2+4)|Receiving data(used by SOCRECV instruction)|No data or receiving is completed
306 |(d2+5)|Data receiving completed(used by SOCRECV instruction)|The instruction is not started or received
307 |(d2+6)|Connection is closing|The instruction is not started or is receiving
308 |(d2+7)|Connection close completed|The instruction is not started or close is complete
309 |(d2+8)|Communication completed(used by SOCMTCP instruction)|In communication
310 |(d2+9)|Connection error|No error in connection
311 |(d2+10)|Reserved|Reserved
312 |(d2+11)|Reserved|Reserved
313 |(d2+12)|Reserved|Reserved
314 |(d2+13)|Reserved|Reserved
315
316 **Features**
317
318 **Local port number:**
319
320 Establish a TCP client: PLC automatically allocates the local communication port, ranging from 49152 to 65535. The port number is automatically incremented by 1 each time it is turned on.
321
322 Establish a TCP server: specified by Ethernet socket configuration of the host computer.
323
324 Establish a UDP connection: specified by Ethernet socket configuration of the host computer.
325
326 **Destination IP:**
327
328 Establish a TCP client: The destination address is specified by Ethernet socket configuration of the host computer.
329
330 Establish a TCP server: After the remote client connection is successful, display the IP address of the remote connection.
331
332 Establish a UDP connection: The destination address is specified by Ethernet socket configuration of the host computer.
333
334 **Destination port number:**
335
336 Establish a TCP client: The destination port number is specified by Ethernet socket configuration of the host computer.
337
338 Establish a TCP server: After the remote client connection is successful, display the port number of the remote connection.
339
340 Establish a UDP connection: The destination port number is specified by Ethernet socket configuration of the host computer.
341
342 **Receive timeout period(10ms): **specified by Ethernet socket configuration of the host computer.
343
344 **Actual receiving length: **This parameter is valid only when the SOCRECV instruction is used. It indicates the number of bytes received after the instruction is enabled.
345
346 **Current link error code:** Display the current error information. For details, Refer to Ethernet error code List.
347
348 **Numbers of communication errors:** total number of communication errors after successful connection (double word).
349
350 **Error codes**
351
352 (% class="table-bordered" %)
353 |**Error code**|**Content**
354 |4085H|The device specified in application instruction (d1) and (d2) exceeds the corresponding device range.
355 |5080H|The specified socket is already connected and cannot be opened again.
356 |5082H|The socket used by parameter 1 exceeds the range of 0 to 5.
357 |5083H|Failed to establish TCP server.
358 |5084H|Failed to create links.
359 |5086H|The specified (d) is not configured socket or the socket is not enabled.
360 |5089H|502 port could not be used on the TCP server because the 502 port is enabled by default.
361
362 == **{{id name="_Toc17901"/}}{{id name="_Toc26204"/}}{{id name="_Toc1326"/}}{{id name="_Toc2455"/}}SOCCLOSE/Close socket link** ==
363
364 Close socket link specified by (s).
365
366 -[SOCCLOSE (s)]
367
368 **Content, range and data type**
369
370 (% class="table-bordered" %)
371 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
372 |(s)|Socket ID|0 to 5|Signed BIN 16 bit|ANY16
373
374 **Device used**
375
376 (% class="table-bordered" %)
377 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="2" %)**Devices**|**Offset modification**|(((
378 **Pulse extension**
379 )))
380 |**K**|**H**|**[D]**|**XXP**
381 |SOCCLOSE|Parameter 1|●|●| |
382
383 **Features**
384
385 ✎Close the socket link specified in (s).
386
387 ✎When the TCP server is closed, the reset request will be sent to the remote client. At the moment, in bit device specified by SOCOPEN, the status of connection closure will be set. The socket is not actually released until the connection closure state is set and the next connection is opened
388
389 ✎If the socket specified by (s) is not connected to the remote end, it cannot be closed and the instruction error occurs.
390
391 **Error codes**
392
393 (% class="table-bordered" %)
394 |**Error code**|**Content**
395 |5081H|The socket specified by is not connected, and could not be closed
396 |5082H|The data specified in (s) exceeds the range of 0 to 5
397
398 == **SOCSEND/Ethernet free-form communication sending** ==
399
400 Send the data in (s2) to the socket link specified by (s1) at the length specified by (S3).
401
402 -[SOCSEND (s1) (s2) (s3)]
403
404 **Content, range and data type**
405
406 (% class="table-bordered" %)
407 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
408 |(s1)|Socket ID|0 to 5|Signed BIN 16 bit|ANY16
409 |(s2)|The start device that send the data|-|Signed BIN 16 bit|ANY_ELEMENTARY
410 |(s3)|Sent length|1 to 256|Bit|ANY16
411
412 **Device used**
413
414 (% class="table-bordered" %)
415 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|**Offset modification**|(((
416 **Pulse extension**
417 )))
418 |**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
419 |(% rowspan="3" %)SOCSEND|Parameter 1| | | | | |●|●| |
420 |Parameter 2|●|●|●|●|●| | | |
421 |Parameter 3|●|●|●|●|●|●|●| |
422
423 **Features**
424
425 ✎Send the data specified in (s2) from the socket connected to (s1), and the length is (s3).
426
427 ✎According to the devices specified by SOCOPEN, the information such as the sending status and the total sending length could be queried. For details, refer to the SOCOPEN instruction.
428
429 ✎It must be used with the SOCOPEN instruction, and data can only be sent after a full link has been established.
430
431 **Error codes**
432
433 (% class="table-bordered" %)
434 |**Error code**|**Content**
435 |4084H|The data in (s3) exceeds the specified range.
436 |5081H|The socket specified by is not connected, and could not be sent.
437 |5082H|The data specified in (s) exceeds the range of 0 to 5.
438
439 == **SOCRECV/Ethernet free-form communication reveiving** ==
440
441 Receive the data from the socket link in (s1) and store in the start device of (s2) at the length of (S3).
442
443 -[SOCRECV (s1) (S2) (S3)]
444
445 **Content, range and data type**
446
447 (% class="table-bordered" %)
448 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
449 |(s1)|Socket ID|0 to 5|Signed BIN 16 bit|ANY16
450 |(s2)|The start device that receive the data|-|Signed BIN 16 bit|ANY_ELEMENTARY
451 |(s3)|Receive length|1 to 256|Bit|ANY16
452
453 **Device used**
454
455 (% class="table-bordered" %)
456 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|(((
457 **Offset modification**
458 )))|(((
459 **Pulse extension**
460 )))
461 |**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
462 |(% rowspan="3" %)SOCRECV|Parameter 1| | | | | |●|●| |
463 |Parameter 2|●|●|●|●|●| | | |
464 |Parameter 3|●|●|●|●|●|●|●| |
465
466 **Features**
467
468 ✎Receive the data from the socket link in (s1) and store in the start device of (s2) at the length of (S3).
469
470 ✎According to the devices specified by SOCOPEN, the information such as the sending status and the total sending length could be queried. For details, refer to the SOCOPEN instruction.
471
472 ✎It must be used with the SOCOPEN instrcution, and data can only be sent after a full link has been established.
473
474 ✎**When used with SOCSEND, it could not be opened at the same time.**
475
476 **Error codes**
477
478 (% class="table-bordered" %)
479 |**Error code**|**Content**
480 |4084H|The data in (s3) exceeds the specified range.
481 |5081H|The socket specified by is not connected, and could not be sent.
482 |5082H|The data specified in (s) exceeds the range of 0 to 5.
483 |5087H|Receiving data timeout
484
485 == **{{id name="_Toc7826"/}}{{id name="_Toc20952"/}}{{id name="_Toc14034"/}}{{id name="_Toc18874"/}}SOCMTCP/Ethernet ModbusTCP communication** ==
486
487 Ethernet ModbusTCP client communication instruction
488
489 -[SOCMTCP (s1) (s2) (s3) (s4) (s5)]
490
491 **Content, range and data type**
492
493 (% class="table-bordered" %)
494 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
495 |(s1)|Socket ID|0 to 5|Signed BIN 16 bit|ANY16
496 |(s2)|High byte is station number, low byte is function code|-|Signed BIN 16 bit|ANY_ELEMENTARY
497 |(s3)|The Modbus address that need communication|1 to 256|Unsigned BIN 16 bit|ANY16
498 |(s4)|Sent length or received length| |Signed BIN 16 bit|ANY16
499 |(s5)|Sent or received start device| |Signed BIN 16 bit|ANY_ELEMENTARY
500
501 **Device used**
502
503 (% class="table-bordered" %)
504 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|**Offset modification**|(((
505 **Pulse extension**
506 )))
507 |**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
508 |(% rowspan="5" %)SOCMTCP|Parameter 1| | | | | |●|●| |
509 |Parameter 2|●|●|●|●|●|●|●| |
510 |Parameter 3|●|●|●|●|●|●|●| |
511 |Parameter 4|●|●|●|●|●|●|●| |
512 |Parameter 5|●|●|●|●|●| | | |
513
514 **Features**
515
516 ✎(s1) specify the socket link. The other parameters are compatible with RS instruction Modbus master protocol.
517
518 ✎(s2) high byte is station number. For ModbusTCP, the station number could be set at will.
519
520 ✎(s2) low byte is function code. For details, refer to the RS instruction Modbus function code description.
521
522 ✎(s3) Modbus communication address, ModbusTCP server address that needs to be read or written.
523
524 ✎(s4): the length read or written by Modbus.
525
526 ✎(s5): the start device that Modbus receive read data or or store written data.
527
528 ✎It must be used with the SOCOPEN instruction, and data can only be sent after a full link has been established.
529
530 ✎This instruction can only be used when a TCP client socket link is established.
531
532 ✎The communication completion information and the number of received and transmitted could be viewed in the soft devices specified in the SOCOPEN instruction.
533
534 **Error codes**
535
536 (% class="table-bordered" %)
537 |**Error code**|**Content**
538 |5081H|The socket specified by is not connected, and could not communicate.
539 |5082H|The data specified in (s1) exceeds the range of 0 to 5.
540 |5086H|The socket specified by (s1) is not configured in the host computer or enabled.
541 |5088H|The SOCMTCP instruction only supports TCP client mode.
542
543 = **{{id name="_Toc8546"/}}{{id name="_Toc3486"/}}{{id name="_Toc14446"/}}{{id name="_Toc26257"/}}Ethernet applications** =
544
545 == **{{id name="_Toc2539"/}}{{id name="_Toc1989"/}}{{id name="_Toc30706"/}}Data exchange between two PLCs through ModbusTCP** ==
546
547 (% class="table-bordered" %)
548 |**Parameters**|PLC No.1|PLC No.2
549 |**Port number**|Free internal distribution|502
550 |**IP address**|192.168.8.10|192.168.8.8
551 |**Protocol type**|ModbusTCP client|ModbusTCP server
552
553 The socket configuration of PLC No.1
554
555 (% style="text-align:center" %)
556 [[image:14_html_202f1d4e5f1733c8.png||class="img-thumbnail"]]
557
558 Ladder diagram logic: Automatically connect socket 0 after power on 1s. Read the 0 address length 20 of PLC No.2 to D100 to D119 after the link is successful, and set the value of D100 to D119 to address 100 of PLC No.2 after the communication is successful. Close the link when communicate successfully again, and wait 1s to re-connect after closing successfully. Repeat the actions above.
559
560 The ladder diagram of PLC No.1
561
562 (% style="text-align:center" %)
563 [[image:14_html_4206400d31f134fa.png||class="img-thumbnail"]]
564
565 As a ModbusTCP server, PLC No. 2 does not need to write instructions. (Open two links by default, and could be modified in [PLC parameters]→[Ethernet settings]. A maximum of eight links are supported.)
566
567 == **{{id name="_Toc462"/}}{{id name="_Toc22212"/}}{{id name="_Toc11578"/}}{{id name="_Toc30403"/}}Data exchange between two PLCs through Free TCP** ==
568
569 (% class="table-bordered" %)
570 |**Parameters**|PLC No.1|PLC No.2
571 |**Port number**|Free internal distribution|520
572 |**IP address**|192.168.8.10|192.168.8.8
573 |**Protocol type**|Free TCP client|Free TCP server
574
575 The IP setting of PLC No.1
576
577 [Project manager]→[Parameter]→[PLC parameter]→[Ethernet settings]
578
579 (% style="text-align:center" %)
580 [[image:14_html_c4654ab7a5c4ee36.png||class="img-thumbnail"]]
581
582 The socket comfiguration of PLC No.1
583
584 [Project manager]→[Extended function]→[Ethernet],and right click to create.
585
586 (% style="text-align:center" %)
587 [[image:14_html_ec9300bfd59ac79f.png||class="img-thumbnail"]]
588
589 The ladder diagram of PLC No.1
590
591 Ladder diagram logic: Automatically connect socket one after power on. Send character string ”hello word” initiatively to PLC No.2 after connecting successfully.
592
593 After receiving "hello word" and verifying it correctly, PLC No.2 would reply “abcdefghijklmnopqrstuvwxyz”. If PLC No.1 receives the reply of PLC No.2, the link closed.
594
595 (% style="text-align:center" %)
596 [[image:14_html_3e51e79948c709b.png||class="img-thumbnail"]]
597
598 The socket configuration of PLC No.2
599
600 [Project manager]→[Parameter]→[PLC parameter]→[Ethernet settings]
601
602 (% style="text-align:center" %)
603 [[image:14_html_4d60262e7d7e6978.png||class="img-thumbnail"]]
604
605 The socket comfiguration of PLC No.2
606
607 [Project manager]→[Extended function]→[Ethernet],and right click to create.
608
609 (% style="text-align:center" %)
610 [[image:14_html_1e0fa43741d0ea96.png||class="img-thumbnail"]]
611
612 The ladder diagram of PLC No.2
613
614 (% style="text-align:center" %)
615 [[image:14_html_309dfbea85ed7f7c.png||class="img-thumbnail"]]
616
617 Ladder diagram logic: Automatically open the monitor server link of socket one after power on. The data sent by the client is continuously read after connecting successfully. After receiving "hello word", PLC No.2 would reply “abcdefghijklmnopqrstuvwxyz”.
618
619 == **{{id name="_Toc7658"/}}{{id name="_Toc3572"/}}{{id name="_Toc27678"/}}{{id name="_Toc13195"/}}Data exchange between two PLCs through Free UDP** ==
620
621 (% class="table-bordered" %)
622 |**Parameters**|PLC No.1|PLC No.2
623 |**Port number**|666|666
624 |**IP address**|192.168.8.10|192.168.8.8
625 |**Protocol type**|Free UDP client|Free UDP server
626
627 The IP setting of PLC No.1
628
629 (% style="text-align:center" %)
630 [[image:14_html_4d60262e7d7e6978.png||class="img-thumbnail"]]
631
632 The socket configuration of PLC No.1
633
634 (% style="text-align:center" %)
635 [[image:14_html_d26f36ecd7d82039.png||class="img-thumbnail"]]
636
637 The ladder diagram of PLC No.1
638
639 Ladder diagram logic: After setting the NIC state bit, establish UDP socket. After the link is established successful, send a data of 20 bytes that start from D100 to 192.168.8.10: 666. After the data is sent successfully, wait for the reply data of the other party. After the reply succeeds, continues the process, and so on
640
641 (% style="text-align:center" %)
642 [[image:14_html_dbd3907c288c9523.png||class="img-thumbnail"]]
643
644 The IP address configuration of PLC No.2
645
646 (% style="text-align:center" %)
647 [[image:14_html_4d60262e7d7e6978.png||class="img-thumbnail"]]
648
649 The socket configuration of PLC No.2
650
651 (% style="text-align:center" %)
652 [[image:14_html_5db18357d06716af.png||class="img-thumbnail"]]
653
654 The ladder diagram of PLC No.2
655
656 Ladder diagram logic: After setting the NIC state bit, establish UDP socket. After the link is established successful, send a data of 20 bytes that start from D300 to 192.168.8.10: 666. After the data is sent successfully, wait for the reply data of the other party, and so on.
657
658 (% style="text-align:center" %)
659 [[image:14_html_4a93f07f5fdbe522.png||class="img-thumbnail"]]
660
661 == **{{id name="_Toc4903"/}}{{id name="_Toc31730"/}}{{id name="_Toc608"/}}{{id name="_Toc9880"/}}List of special device related to Ethernet** ==
662
663 (% class="table-bordered" %)
664 |(% style="width:124px" %)**SM number**|(% style="width:396px" %)**Name**|**Content**|**R/W**|**Power down retentive**
665 |(% style="width:124px" %)SM2681|(% style="width:396px" %)Display current network information|(((
666 Refresh current IP gateway subnet mask after ON.
667
668 Turn OFF after the fresh is complete.
669 )))|R/W|×
670 |(% style="width:124px" %)SM2682|(% style="width:396px" %)Display current MAC information|(((
671 Refresh current MAC after ON.
672
673 Turn OFF after the fresh is complete.
674 )))|R/W|×
675 |(% style="width:124px" %)SM2683|(% style="width:396px" %)The modification flag of IP, subnet mask and gateway|(((
676 ON: Modifiable
677
678 OFF: Unmodifiable
679
680 (After setting to ON, modify when stop->run, and turn OFF automatically after the modification)
681 )))|R/W|√
682 |(% style="width:124px" %)SM2684|(% style="width:396px" %)The connecting status of NIC|(((
683 ON: The network is connected
684
685 OFF: The network is not connected. Please check whether the network cable is connected.
686 )))|R|√
687 |(% style="width:124px" %)SM2692|(% style="width:396px" %)MAC address modification flag|(((
688 ON: Modifiable
689
690 OFF: Unmodifiable
691
692 (After setting to ON, modify when stop->run, and automatically turn OFF after the modification)
693 )))|R/W|√
694 |(% style="width:124px" %)SM2700|(% style="width:396px" %)ModbusTCP keep-alive mechanism|(((
695 ON: open
696
697 OFF: close (default)
698 )))|R/W|√
699 |(% style="width:124px" %)SM2701|(% style="width:396px" %)ModbusTCP server force close|(((
700 ON: open
701
702 OFF: close (default)
703
704 (After enabling, automatically changes to OFF After it is successfully turned OFF)
705 )))|R/W|×
706 |(% style="width:124px" %)SM2710|(% style="width:396px" %)Ethernet error flag|(((
707 ON: Ethernet error. Please check SD2710 and SD2711
708
709 OFF: No Ethernet error.
710 )))|R|×
711 |(% style="width:124px" %)SM2740|(% style="width:396px" %)ModbusTCP server connection status 1|(((
712 ON: The client is connected
713
714 OFF: The client is not connected
715 )))|R|×
716 |(% style="width:124px" %)SM2760|(% style="width:396px" %)ModbusTCP server connection status 2|(((
717 ON: The client is connected
718
719 OFF: The client is not connected
720 )))|R|×
721 |(% style="width:124px" %)SM2780|(% style="width:396px" %)ModbusTCP server connection status 3|(((
722 ON: The client is connected
723
724 OFF: The client is not connected
725 )))|R|×
726 |(% style="width:124px" %)SM2800|(% style="width:396px" %)ModbusTCP server connection status 4|(((
727 ON: The client is connected
728
729 OFF: The client is not connected
730 )))|R|×
731 |(% style="width:124px" %)SM2820|(% style="width:396px" %)ModbusTCP server connection status 5|(((
732 ON: The client is connected
733
734 OFF: The client is not connected
735 )))|R|×
736 |(% style="width:124px" %)SM2840|(% style="width:396px" %)ModbusTCP server connection status 6|(((
737 ON: The client is connected
738
739 OFF: The client is not connected
740 )))|R|×
741 |(% style="width:124px" %)SM2860|(% style="width:396px" %)ModbusTCP server connection status 7|(((
742 ON: The client is connected
743
744 OFF: The client is not connected
745 )))|R|×
746 |(% style="width:124px" %)SM2880|(% style="width:396px" %)ModbusTCP server connection status 8|(((
747 ON: The client is connected
748
749 OFF: The client is not connected
750 )))|R|×
751
752 (% class="table-bordered" %)
753 |(% style="width:122px" %)**SD number**|(% style="width:388px" %)**Name**|**Content**|**R/W**|**Power down retentive**
754 |(% style="width:122px" %)SD2680|(% style="width:388px" %)The 1st byte of IP address|(% rowspan="4" %)Local IP address|R/W|√
755 |(% style="width:122px" %)SD2681|(% style="width:388px" %)The 2nd byte of IP address|R/W|√
756 |(% style="width:122px" %)SD2682|(% style="width:388px" %)The 3rd byte of IP address|R/W|√
757 |(% style="width:122px" %)SD2683|(% style="width:388px" %)The 4th byte of IP address|R/W|√
758 |(% style="width:122px" %)SD2684|(% style="width:388px" %)The 1st byte of subnet mask|(% rowspan="4" %)Local subnet mask|R/W|√
759 |(% style="width:122px" %)SD2685|(% style="width:388px" %)The 2nd byte of subnet mask|R/W|√
760 |(% style="width:122px" %)SD2686|(% style="width:388px" %)The 3rd byte of subnet mask|R/W|√
761 |(% style="width:122px" %)SD2687|(% style="width:388px" %)The 4th byte of subnet mask|R/W|√
762 |(% style="width:122px" %)SD2688|(% style="width:388px" %)The 1st byte of default gateway|(% rowspan="4" %)Local default gateway|R/W|√
763 |(% style="width:122px" %)SD2689|(% style="width:388px" %)The 2nd byte of default gateway|R/W|√
764 |(% style="width:122px" %)SD2690|(% style="width:388px" %)The 3rd byte of default gateway|R/W|√
765 |(% style="width:122px" %)SD2691|(% style="width:388px" %)The 4th byte of default gateway|R/W|√
766 |(% style="width:122px" %)SD2692|(% style="width:388px" %)The 1st byte of MAC|(% rowspan="6" %)Local MAC address|R/W|√
767 |(% style="width:122px" %)SD2693|(% style="width:388px" %)The 2nd byte of MAC|R/W|√
768 |(% style="width:122px" %)SD2694|(% style="width:388px" %)The 3rd byte of MAC|R/W|√
769 |(% style="width:122px" %)SD2695|(% style="width:388px" %)The 4th byte of MAC|R/W|√
770 |(% style="width:122px" %)SD2696|(% style="width:388px" %)The 5th byte of MAC|R/W|√
771 |(% style="width:122px" %)SD2697|(% style="width:388px" %)The 6th byte of MAC|R/W|√
772 |(% style="width:122px" %)SD2700|(% style="width:388px" %)Communication speed display|(((
773 0: 100Mbps/Half-duplex
774
775 1: 100Mbps/Full-duplex
776
777 2: 10Mbps/Half-duplex
778
779 3: 10Mbps/Full-duplex
780 )))|R|×
781 |(% style="width:122px" %)SD2702|(% style="width:388px" %)Maximum link number supported by ModbusTCP server|Maximum link number of simultaneous client links supported by local ModbusTCP server|R/W|×
782 |(% style="width:122px" %)SD2703|(% style="width:388px" %)The number of links of ModbusTCP|The number of links of local ModbusTCP|R|×
783 |(% style="width:122px" %)SD2710|(% style="width:388px" %)Error code|Ehternet error code|R|×
784 |(% style="width:122px" %)SD2711|(% style="width:388px" %)The socket ID of current error|(((
785 -1: default ModbusTCP server
786
787 0 to 5: Custom socket error
788 )))|R|×
789 |(% style="width:122px" %)SD2720|(% style="width:388px" %)Input low bit of number of ping request|(% rowspan="2" %)The number of external input ping command|R|×
790 |(% style="width:122px" %)SD2721|(% style="width:388px" %)Input high bit of number of ping request|R|×
791 |(% style="width:122px" %)SD2722|(% style="width:388px" %)Input low bit of number of ping response|(% rowspan="2" %)The number of replies after receiving external ping command|R|×
792 |(% style="width:122px" %)SD2723|(% style="width:388px" %)Input high bit of number of ping response|R|×
793 |(% style="width:122px" %)SD2724|(% style="width:388px" %)Input low bit of number of ping request|(% rowspan="2" %)The number of sending ping command|R|×
794 |(% style="width:122px" %)SD2725|(% style="width:388px" %)Input high bit of number of ping request|R|×
795 |(% style="width:122px" %)SD2726|(% style="width:388px" %)Input low bit of number of ping response|(% rowspan="2" %)The number of replies after receiving external ping command sent|R|×
796 |(% style="width:122px" %)SD2727|(% style="width:388px" %)Input high bit of number of ping response|R|×
797 |(% style="width:122px" %)SD2728|(% style="width:388px" %)The number of arp pack sent|Count of the number of arp packets sent|R|×
798 |(% style="width:122px" %)SD2729|(% style="width:388px" %)The number of arp pack received|The number of arp pack received|R|×
799 |(% style="width:122px" %)SD2730|(% style="width:388px" %)The number of IP pack sent|The number of IP pack sent|R|×
800 |(% style="width:122px" %)SD2731|(% style="width:388px" %)The number of IP pack received|The number of IP pack received|R|×
801 |(% style="width:122px" %)SD2732|(% style="width:388px" %)The number of TCP pack sent|The number of TCP pack sent|R|×
802 |(% style="width:122px" %)SD2733|(% style="width:388px" %)The number of TCP pack received|The number of TCP pack received|R|×
803 |(% style="width:122px" %)SD2734|(% style="width:388px" %)The number of UDP pack sent|The number of UDP pack sent|R|×
804 |(% style="width:122px" %)SD2735|(% style="width:388px" %)The number of UDP pack received|The number of UDP pack received|R|×
805 |(% style="width:122px" %)SD2740|(% style="width:388px" %)Connection one Local port number|(% rowspan="11" %)The first ModbusTCP client to connect the connection information and error information of this PLC.|R|×
806 |(% style="width:122px" %)SD2741|(% style="width:388px" %)Connection one The 1st byte of IP address|R|×
807 |(% style="width:122px" %)SD2742|(% style="width:388px" %)Connection one The 2nd byte of IP address|R|×
808 |(% style="width:122px" %)SD2743|(% style="width:388px" %)Connection one The 3rd byte of IP address|R|×
809 |(% style="width:122px" %)SD2744|(% style="width:388px" %)Connection one The 4th byte of IP address|R|×
810 |(% style="width:122px" %)SD2745|(% style="width:388px" %)Connection one Opposite end port number|R|×
811 |(% style="width:122px" %)SD2746|(% style="width:388px" %)Reserved|R|×
812 |(% style="width:122px" %)SD2747|(% style="width:388px" %)Reserved| |
813 |(% style="width:122px" %)SD2748|(% style="width:388px" %)Connection one Error code|R|×
814 |(% style="width:122px" %)SD2749|(% style="width:388px" %)Connection one Error communication times low word|R|×
815 |(% style="width:122px" %)SD2750|(% style="width:388px" %)Connection one Error communication times high word|R|×
816 |(% style="width:122px" %)SD2760|(% style="width:388px" %)Connection two Local port number|(% rowspan="11" %)The second ModbusTCP client to connect the connection information and error information of this PLC.|R|×
817 |(% style="width:122px" %)SD2761|(% style="width:388px" %)Connection two The 1st byte of IP address|R|×
818 |(% style="width:122px" %)SD2762|(% style="width:388px" %)Connection two The 2nd byte of IP address|R|×
819 |(% style="width:122px" %)SD2763|(% style="width:388px" %)Connection two The 3rd byte of IP address|R|×
820 |(% style="width:122px" %)SD2764|(% style="width:388px" %)Connection two The 4th byte of IP address|R|×
821 |(% style="width:122px" %)SD2765|(% style="width:388px" %)Connection two Opposite end port number|R|×
822 |(% style="width:122px" %)SD2766|(% style="width:388px" %)Reserved|R|×
823 |(% style="width:122px" %)SD2767|(% style="width:388px" %)Reserved| |
824 |(% style="width:122px" %)SD2768|(% style="width:388px" %)Connection two Error code|R|×
825 |(% style="width:122px" %)SD2769|(% style="width:388px" %)Connection two Error communication times low word|R|×
826 |(% style="width:122px" %)SD2770|(% style="width:388px" %)Connection two Error communication times high word|R|×
827 |(% style="width:122px" %)SD2780|(% style="width:388px" %)Connection three Local port number|(% rowspan="11" %)The third ModbusTCP client to connect the connection information and error information of this PLC.|R|×
828 |(% style="width:122px" %)SD2781|(% style="width:388px" %)Connection three The 1st byte of IP address|R|×
829 |(% style="width:122px" %)SD2782|(% style="width:388px" %)Connection three The 2nd byte of IP address|R|×
830 |(% style="width:122px" %)SD2783|(% style="width:388px" %)Connection three The 3rd byte of IP address|R|×
831 |(% style="width:122px" %)SD2784|(% style="width:388px" %)Connection three The 4th byte of IP address|R|×
832 |(% style="width:122px" %)SD2785|(% style="width:388px" %)Connection three Opposite end port number|R|×
833 |(% style="width:122px" %)SD2786|(% style="width:388px" %)Reserved|R|×
834 |(% style="width:122px" %)SD2787|(% style="width:388px" %)Reserved| |
835 |(% style="width:122px" %)SD2788|(% style="width:388px" %)Connection three Error code|R|×
836 |(% style="width:122px" %)SD2789|(% style="width:388px" %)Connection three Error communication times low word|R|×
837 |(% style="width:122px" %)SD2780|(% style="width:388px" %)Connection three Error communication times high word|R|×
838 |(% style="width:122px" %)SD2800|(% style="width:388px" %)Connection four Local port number|(% rowspan="11" %)The forth ModbusTCP client to connect the connection information and error information of this PLC.|R|×
839 |(% style="width:122px" %)SD2801|(% style="width:388px" %)Connection four The 1st byte of IP address|R|×
840 |(% style="width:122px" %)SD2802|(% style="width:388px" %)Connection four The 2nd byte of IP address|R|×
841 |(% style="width:122px" %)SD2803|(% style="width:388px" %)Connection four The 3rd byte of IP address|R|×
842 |(% style="width:122px" %)SD2804|(% style="width:388px" %)Connection four The 4th byte of IP address|R|×
843 |(% style="width:122px" %)SD2805|(% style="width:388px" %)Connection four Opposite end port number|R|×
844 |(% style="width:122px" %)SD2806|(% style="width:388px" %)Reserved|R|×
845 |(% style="width:122px" %)SD2807|(% style="width:388px" %)Reserved| |
846 |(% style="width:122px" %)SD2808|(% style="width:388px" %)Connection four Error code|R|×
847 |(% style="width:122px" %)SD2809|(% style="width:388px" %)Connection four Error communication times low word|R|×
848 |(% style="width:122px" %)SD2810|(% style="width:388px" %)Connection four Error communication times high word|R|×
849 |(% style="width:122px" %)SD2820|(% style="width:388px" %)Connection five Local port number|(% rowspan="11" %)The fifth ModbusTCP client to connect the connection information and error information of this PLC.|R|×
850 |(% style="width:122px" %)SD2821|(% style="width:388px" %)Connection five The 1st byte of IP address|R|×
851 |(% style="width:122px" %)SD2822|(% style="width:388px" %)Connection five The 2nd byte of IP address|R|×
852 |(% style="width:122px" %)SD2823|(% style="width:388px" %)Connection five The 3rd byte of IP address|R|×
853 |(% style="width:122px" %)SD2824|(% style="width:388px" %)Connection five The 4th byte of IP address|R|×
854 |(% style="width:122px" %)SD2825|(% style="width:388px" %)Connection five Opposite end port number|R|×
855 |(% style="width:122px" %)SD2826|(% style="width:388px" %)Reserved|R|×
856 |(% style="width:122px" %)SD2827|(% style="width:388px" %)Reserved| |
857 |(% style="width:122px" %)SD2828|(% style="width:388px" %)Connection five Error code|R|×
858 |(% style="width:122px" %)SD2829|(% style="width:388px" %)Connection five Error communication times low word|R|×
859 |(% style="width:122px" %)SD2830|(% style="width:388px" %)Connection five Error communication times high word|R|×
860 |(% style="width:122px" %)SD2840|(% style="width:388px" %)Connection six Local port number|(% rowspan="11" %)The sixth ModbusTCP client to connect the connection information and error information of this PLC.|R|×
861 |(% style="width:122px" %)SD2841|(% style="width:388px" %)Connection six The 1st byte of IP address|R|×
862 |(% style="width:122px" %)SD2842|(% style="width:388px" %)Connection six The 2nd byte of IP address|R|×
863 |(% style="width:122px" %)SD2843|(% style="width:388px" %)Connection six The 3rd byte of IP address|R|×
864 |(% style="width:122px" %)SD2844|(% style="width:388px" %)Connection six The 4th byte of IP address|R|×
865 |(% style="width:122px" %)SD2845|(% style="width:388px" %)Connection six Opposite end port number|R|×
866 |(% style="width:122px" %)SD2846|(% style="width:388px" %)Reserved|R|×
867 |(% style="width:122px" %)SD2847|(% style="width:388px" %)Reserved| |
868 |(% style="width:122px" %)SD2848|(% style="width:388px" %)Connection six Error code|R|×
869 |(% style="width:122px" %)SD2849|(% style="width:388px" %)Connection six Error communication times low word|R|×
870 |(% style="width:122px" %)SD2850|(% style="width:388px" %)Connection six Error communication times high word|R|×
871 |(% style="width:122px" %)SD2860|(% style="width:388px" %)Connection seven Local port number|(% rowspan="11" %)The seventh ModbusTCP client to connect the connection information and error information of this PLC.|R|×
872 |(% style="width:122px" %)SD2861|(% style="width:388px" %)Connection seven The 1st byte of IP address|R|×
873 |(% style="width:122px" %)SD2862|(% style="width:388px" %)Connection seven The 2nd byte of IP address|R|×
874 |(% style="width:122px" %)SD2863|(% style="width:388px" %)Connection seven The 3rd byte of IP address|R|×
875 |(% style="width:122px" %)SD2864|(% style="width:388px" %)Connection seven The 4th byte of IP address|R|×
876 |(% style="width:122px" %)SD2865|(% style="width:388px" %)Connection seven Opposite end port number|R|×
877 |(% style="width:122px" %)SD2866|(% style="width:388px" %)Reserved|R|×
878 |(% style="width:122px" %)SD2867|(% style="width:388px" %)Reserved| |
879 |(% style="width:122px" %)SD2868|(% style="width:388px" %)Connection seven Error code|R|×
880 |(% style="width:122px" %)SD2869|(% style="width:388px" %)Connection seven Error communication times low word|R|×
881 |(% style="width:122px" %)SD2870|(% style="width:388px" %)Connection seven Error communication times high word|R|×
882 |(% style="width:122px" %)SD2880|(% style="width:388px" %)Connection eight Local port number|(% rowspan="11" %)The eighth ModbusTCP client to connect the connection information and error information of this PLC.|R|×
883 |(% style="width:122px" %)SD2881|(% style="width:388px" %)Connection eight The 1st byte of IP address|R|×
884 |(% style="width:122px" %)SD2882|(% style="width:388px" %)Connection eight The 2nd byte of IP address|R|×
885 |(% style="width:122px" %)SD2883|(% style="width:388px" %)Connection eight The 3rd byte of IP address|R|×
886 |(% style="width:122px" %)SD2884|(% style="width:388px" %)Connection eight The 4th byte of IP address|R|×
887 |(% style="width:122px" %)SD2885|(% style="width:388px" %)Connection eight Opposite end port number|R|×
888 |(% style="width:122px" %)SD2866|(% style="width:388px" %)Reserved| |
889 |(% style="width:122px" %)SD2867|(% style="width:388px" %)Reserved|R|×
890 |(% style="width:122px" %)SD2888|(% style="width:388px" %)Connection eight Error code|R|×
891 |(% style="width:122px" %)SD2889|(% style="width:388px" %)Connection eight Error communication times low word|R|×
892 |(% style="width:122px" %)SD2890|(% style="width:388px" %)Connection eight Error communication times high word|R|×
893
894 = **{{id name="_Toc25788"/}}{{id name="_Toc14289"/}}{{id name="_Toc2936"/}}{{id name="_Toc31902"/}}Ethernet error codes table** =
895
896 == **{{id name="_Toc15175"/}}{{id name="_Toc13420"/}}{{id name="_Toc19210"/}}{{id name="_Toc13265"/}}Operational error** ==
897
898 (% class="table-bordered" %)
899 |(% style="width:101px" %)**Error code**|(% style="width:462px" %)**Description**|(% style="width:186px" %)**Action**|(% style="width:516px" %)**Processing scheme**|(% style="width:183px" %)**Test time**
900 |(% style="width:101px" %)3680|(% style="width:462px" %)Ethernet data reception error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check the environment for interference.|(% style="width:183px" %)When the instruction is executed
901 |(% style="width:101px" %)3681|(% style="width:462px" %)Ethernet data reception timeout|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
902 Check whether the network cable is loose.
903
904 Check whether the network opposite end is faulty and cannot send data.
905
906 Check whether the network opposite end is not responding in time and the data is too late.
907
908 For this reason, try increasing the receive timeout in the socket configuration.
909 )))|(% style="width:183px" %)When the instruction is executed
910 |(% style="width:101px" %)3684|(% style="width:462px" %)ModbusTCP station number configuration error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
911 Check the setting of slave station number.
912
913 Check whether there is a problem with the receiving and sending mechanism of the slave station.
914 )))|(% style="width:183px" %)When the instruction is executed
915 |(% style="width:101px" %)3685|(% style="width:462px" %)ModbusTCP send buffer overflow|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error|(% style="width:183px" %)When the instruction is executed
916 |(% style="width:101px" %)3686|(% style="width:462px" %)ModbusTCP function code error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the function code set is supported by the PLC.|(% style="width:183px" %)When the instruction is executed
917 |(% style="width:101px" %)3687|(% style="width:462px" %)ModbusTCP address error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
918 Check whether the slave station has the address.
919
920 (Please refer to Modbus abnormality 02)
921 )))|(% style="width:183px" %)When the instruction is executed
922 |(% style="width:101px" %)3688|(% style="width:462px" %)ModbusTCP length error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the communication length exceeds the range of Modbus.|(% style="width:183px" %)When the instruction is executed
923 |(% style="width:101px" %)3689|(% style="width:462px" %)ModbusTCP data error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
924 Check whether the parameter of instruction is incorrect.
925
926 Check whether the value set is supported by slave. (Please refer to Modbus abnormality 03)
927 )))|(% style="width:183px" %)When the instruction is executed
928 |(% style="width:101px" %)368A|(% style="width:462px" %)ModbusTCP slave station is busy|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
929 Slave returns message: Slave is busy.
930
931 (Please refer to Modbus abnormality 06)
932 )))|(% style="width:183px" %)When the instruction is executed
933 |(% style="width:101px" %)368B|(% style="width:462px" %)ModbusTCP slave station does not support function code|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the function code is supported by slave. (Please refer to Modbus abnormality 01)|(% style="width:183px" %)When the instruction is executed
934 |(% style="width:101px" %)368C|(% style="width:462px" %)ModbusTCP slave station fault|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
935 Slave returns message: Slave is faulty.
936
937 (Please refer to Modbus abnormality 04)
938 )))|(% style="width:183px" %)When the instruction is executed
939 |(% style="width:101px" %)368D|(% style="width:462px" %)ModbusTCP slave station confirmation|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
940 Slave returns message: Slave confirmation.
941
942 (Please refer to Modbus abnormality 05)
943 )))|(% style="width:183px" %)When the instruction is executed
944 |(% style="width:101px" %)368E|(% style="width:462px" %)ModbusTCP protocol currently does not support this instruction|(% style="width:186px" %)Continue to run|(% style="width:516px" %)RS instruction could not be used when set to slave protocol. Please change protocol or close the contact before the RS instruction.|(% style="width:183px" %)When the instruction is executed
945 |(% style="width:101px" %)368F|(% style="width:462px" %)Network port sending timeout|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
946 |(% style="width:101px" %)3690|(% style="width:462px" %)Receiving cache overflow|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the other device has been sending data.|(% style="width:183px" %)When the instruction is executed
947 |(% style="width:101px" %)36A0|(% style="width:462px" %)ModbusTCP unavailable gateway|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
948 Slave returns message: Unavailable gateway.
949
950 (Please refer to Modbus abnormality 0A)
951 )))|(% style="width:183px" %)When the instruction is executed
952 |(% style="width:101px" %)36A1|(% style="width:462px" %)ModbusTCP No response was received from the target device. Generally it means that the device is not on the network.|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
953 Slave returns message: The device is not on the network.
954
955 (Please refer to Modbus abnormality 0B)
956 )))|(% style="width:183px" %)When the instruction is executed
957 |(% style="width:101px" %)36C0|(% style="width:462px" %)ModbusTCP transaction identifier error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the network is congested and data cannot be received.|(% style="width:183px" %)When the instruction is executed
958 |(% style="width:101px" %)36C1|(% style="width:462px" %)ModbusTCP The server is full of available links|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether SD2702 and SD2703 have too many clients to link.|(% style="width:183px" %)When the instruction is executed
959 |(% style="width:101px" %)36C8|(% style="width:462px" %)The Ethernet protocol stack is running out of space|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
960 |(% style="width:101px" %)36C9|(% style="width:462px" %)The number of links exceeded the limit|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the total number of links exceeds the limit.|(% style="width:183px" %)When the instruction is executed
961 |(% style="width:101px" %)36CA|(% style="width:462px" %)The last sending is not complete|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Use the send completion flag to judge the current send is complete before sending the next one.|(% style="width:183px" %)When the instruction is executed
962 |(% style="width:101px" %)36CB|(% style="width:462px" %)TCP abnormal write|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Use flag bit device to judge whether the connection is normal. If not, not data is sent. For example, after the closing flag is set,no data is sent.|(% style="width:183px" %)When the instruction is executed
963 |(% style="width:101px" %)36CC|(% style="width:462px" %)TCP abnormal output|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
964 |(% style="width:101px" %)36CD|(% style="width:462px" %)The IP address has been used|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether a connection using the same address information exists.|(% style="width:183px" %)When the instruction is executed
965 |(% style="width:101px" %)36CE|(% style="width:462px" %)The server receiving link error|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
966 |(% style="width:101px" %)36CF|(% style="width:462px" %)TCP receiving buffer overflow|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
967 |(% style="width:101px" %)36D0|(% style="width:462px" %)TCP connection failed|(% style="width:186px" %)Continue to run|(% style="width:516px" %)The TCP client may be enabled when the network cable is not connected.|(% style="width:183px" %)When the instruction is executed
968 |(% style="width:101px" %)36D1|(% style="width:462px" %)Abnormal when closing the link initiative|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
969 |(% style="width:101px" %)36D2|(% style="width:462px" %)An abnormal shutdown occurred inside the protocol stack|(% style="width:186px" %)Continue to run|(% style="width:516px" %)It may be closed because of no response for a long time. Check whether the opposite end is online, and whether it could be pinged.|(% style="width:183px" %)When the instruction is executed
970 |(% style="width:101px" %)36D3|(% style="width:462px" %)Initiate an RST link on the opposite end|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
971 1. Check whether the opposite end initiates an abnormal shutdown.
972 1. As a client, the number of links on the opposite end is full or the port on the opposite end is notopened.
973 )))|(% style="width:183px" %)When the instruction is executed
974 |(% style="width:101px" %)36D4|(% style="width:462px" %)A single-ended shutdown of the protocol stack occurs|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
975 |(% style="width:101px" %)36D5|(% style="width:462px" %)There is an IP address conflict|(% style="width:186px" %)Continue to run|(% style="width:516px" %)There are the same IP devices in the LAN, please change the IP address.|(% style="width:183px" %)When the instruction is executed
976 |(% style="width:101px" %)36D6|(% style="width:462px" %)There is an MAC address conflict|(% style="width:186px" %)Continue to run|(% style="width:516px" %)There are the same MAC devices in the LAN, please change the MAC address.|(% style="width:183px" %)When the instruction is executed
977 |(% style="width:101px" %)36D7|(% style="width:462px" %)TCP sending buffer overflow|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
978 |(% style="width:101px" %)36D8|(% style="width:462px" %)UDP abnormal connection|(% style="width:186px" %)Continue to run|(% style="width:516px" %)IP address and port number may have been used.|(% style="width:183px" %)When the instruction is executed
979 |(% style="width:101px" %)36D9|(% style="width:462px" %)UDP sending buffer overflow|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
980 |(% style="width:101px" %)36DA|(% style="width:462px" %)UDP insufficient memory space when sending|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
981 |(% style="width:101px" %)36DB|(% style="width:462px" %)UDP failed to send|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
982 |(% style="width:101px" %)36DC|(% style="width:462px" %)UDP memory release failure|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Contact the technician for the error.|(% style="width:183px" %)When the instruction is executed
983 |(% style="width:101px" %)36DD|(% style="width:462px" %)UDP receiving buffer overflow|(% style="width:186px" %)Continue to run|(% style="width:516px" %)The data length that UDP received exceeds the limit value 512.|(% style="width:183px" %)When the instruction is executed
984 |(% style="width:101px" %)4084|(% style="width:462px" %)The data input in the application instruction exceeds the specified range.|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Modify application instruction parameter.|(% style="width:183px" %)When the application instruction is executed
985 |(% style="width:101px" %)4085|(% style="width:462px" %)The output result in the read application instruction exceeds the device range.|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Modify application instruction parameter.|(% style="width:183px" %)When the application instruction is executed
986 |(% style="width:101px" %)4086|(% style="width:462px" %)The output result in the read application instruction exceeds the device range.|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Modify application instruction parameter.|(% style="width:183px" %)When the application instruction is executed
987 |(% style="width:101px" %)5080|(% style="width:462px" %)The Ethernet socket is already linked and could not be opened again|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the SOCOPEN instruction is executed repeatedly.|(% style="width:183px" %)When the application instruction is executed
988 |(% style="width:101px" %)5081|(% style="width:462px" %)The Ethernet socket is not opened and could not be operated|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the connected bit of SOCOPEN instruction (d2) parameter is set.|(% style="width:183px" %)When the application instruction is executed
989 |(% style="width:101px" %)5082|(% style="width:462px" %)The socket ID that Ethernet instruction inputs exceeds the range|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Modify application instruction parameter.|(% style="width:183px" %)When the application instruction is executed
990 |(% style="width:101px" %)5083|(% style="width:462px" %)Failed to create TCP server|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the link is full.|(% style="width:183px" %)When the application instruction is executed
991 |(% style="width:101px" %)5084|(% style="width:462px" %)Failed to create links|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the link is full.|(% style="width:183px" %)When the application instruction is executed
992 |(% style="width:101px" %)5086|(% style="width:462px" %)The socket ID used by Ethernet instruction is not configured in the host computer or is not enabled after configuration|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check the Ethernet configuration of the host computer.|(% style="width:183px" %)When the application instruction is executed
993 |(% style="width:101px" %)5087|(% style="width:462px" %)SOCRECV instruction reception timeout|(% style="width:186px" %)Continue to run|(% style="width:516px" %)(((
994 1. Check whether the network connection is normal.
995 1. Check whether the network opposite end has data sent.
996 )))|(% style="width:183px" %)When the application instruction is executed
997 |(% style="width:101px" %)5088|(% style="width:462px" %)The socket specified by SOCMTCP instruction uses the configuration mode of non-TCP client|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check the Ethernet configuration of the host computer.|(% style="width:183px" %)When the application instruction is executed
998 |(% style="width:101px" %)5089|(% style="width:462px" %)When Ethernet socket configures a TCP server, specify the local port as 502|(% style="width:186px" %)Continue to run|(% style="width:516px" %)The port 502 is occupied by the system. Please modify the local port number.|(% style="width:183px" %)When the application instruction is executed
999 |(% style="width:101px" %)508A|(% style="width:462px" %)The UDP port is set to 1092|(% style="width:186px" %)Continue to run|(% style="width:516px" %)The UDP port 1092 is occupied by the system and could not be used. Please modify the local port number.|(% style="width:183px" %)When the application instruction is executed
1000 |(% style="width:101px" %)5090|(% style="width:462px" %)Abnormal network cable connection|(% style="width:186px" %)Continue to run|(% style="width:516px" %)Check whether the network cable is connected|(% style="width:183px" %)When the application instruction is executed