Wiki source code of 10 Communication

Version 28.2 by Jim on 2023/08/24 14:37

Show last authors
1 = **Communication** =
2
3 == **Protocol** ==
4
5 **PROTOCOL(P)**
6
7 Set (s) protocol for (N) communication port.
8
9 -[PROTOCOL (S) (N)]
10
11 **Content, range and data type**
12
13 (% class="table-bordered" %)
14 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
15 |(S)|Protocol number to be set|-|Unsigned BIN 16 bit|ANY16
16 |(N)|Which communication port to set, 0 means COM1, 1 means COM2 *1|0, 1|Unsigned BIN 16 bit|ANY16
17
18 **Device used**
19
20 (% class="table-bordered" %)
21 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|(((
22 **Offset**
23
24 **modification**
25 )))|(((
26 **Pulse**
27
28 **extension**
29 )))
30 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
31 |(% rowspan="2" %)PROTOCOL|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
32 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
33
34 **Features**
35
36 This instruction is mainly used to set the protocol during run, and can also be used in the first cycle of run.
37
38 The value of the protocol address (COM1 SD2542, COM2 SD2592) and the protocol modification flag (COM1 SD2543, COM2 SD2593) can be directly set according to the command parameters.
39
40 The specific calculation formula for setting the protocol modification flag (COM1 SD2543, COM2 SD2593) is: (parameter setting value + offset of the corresponding serial port's initial special soft component + 10)*2
41
42 For example, setting the protocol to 2 is (2 +2593-2590 +10)*2, which is (2+3+10) *2=30. At this time, SD2592 will be set to 1, and SD2593 will be set to 32.
43
44 **✎Note: **Whether it is by self-calculation and then modifying the setting value of the identifier (COM1 SD2543, COM2 SD2593) to the protocol, or using this instruction to set, it is possible to modify the protocol when the PLC is in the RUN state.
45
46 Regarding the protocol modification flags (COM1 SD2543, COM2 SD2593): During the RUN process, the first cycle of setting the protocol and modifying the flags is correct (judging at END) to the correct first cycle. When the modification is completed, the protocol modification flags (COM1 SD2543, COM2 SD2593) is cleared, and then set the same value will not be processed. Mainly to avoid repeated settings multiple times.
47
48 **Agreement Number**
49
50 (% class="table-bordered" %)
51 |**Agreement Number**|**Content**
52 |0 H|Wecon Modbus slave
53 |2 H|ModbusRTU slave
54 |3 H|ModbusASCII slave
55 |10 H|User-defined protocol
56 |20 H|ModbusRTU master station
57 |30 H|ModbusASCII master
58
59 **Related software components**
60
61 (% class="table-bordered" %)
62 |**Devices**|**Content**
63 |SD2542|COM1 protocol settings
64 |SD2543|COM1 protocol modification sign
65 |SD2592|COM2 protocol settings
66 |SD2593|COM2 protocol modification sign
67
68 **✎Note:**
69
70 The setting of communication parameters will affect the overall communication. The processing in the PLC is to modify it when there is no communication or after a round of communication is completed. This point needs attention.
71
72 If the set protocol does not match the provided protocol number, the protocol modification flag (COM1 SD2543, COM2 SD2593) will not be cleared after setting. At this time, the protocol will not be set successfully, and it will run according to the original protocol.
73
74 **Error code**
75
76 (% class="table-bordered" %)
77 |**Error code**|**Content**
78 |4085H|The read address of (s) and (N) exceeds the device range
79 |4084H|(N) is not 1
80
81 **Example**
82
83 (% style="text-align:center" %)
84 [[image:10_html_2947ba20da1d1c90.png||class="img-thumbnail"]]
85
86 Example above
87
88 M1 changes from OFF to ON during the run
89
90 SD2592 will be set to 32 (20H), SD2593 will be set to 90 and then it will be cleared. At this time, it means that the setting is successful.
91
92 (% style="text-align:center" %)
93 [[image:10_html_38333ed8624e86d1.png||class="img-thumbnail"]]
94
95 If you turn M1 from OFF to ON again
96
97 SD2592 will be set to 32 (20H), SD2593 will be set to 90 but will not be cleared.
98
99 (% style="text-align:center" %)
100 [[image:10_html_54692bd97d6e3bfd.png||class="img-thumbnail"]]
101
102 = **Modbus serial port parameter setting** =
103
104 == {{id name="_PORTPARA/MODBUS串口参数设置"/}}{{id name="_Toc1121"/}}{{id name="_Toc11010"/}}**PORTPARA/Modbus serial port parameter setting** ==
105
106 **PORTPARA(P)**
107
108 Set (s) serial port parameters for (N) communication port.
109
110 -[PORTPARA (s) (N)]
111
112 **Content, range and data type**
113
114 (% class="table-bordered" %)
115 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
116 |(s)|Serial port parameters to be set|-|Unsigned BIN 16 bit|ANY16
117 |(N)|Which communication port to set, 0 means COM1, 1 means COM2|0, 1|Unsigned BIN 16 bit|ANY16
118
119 **Device used**
120
121 (% class="table-bordered" %)
122 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|(((
123 **Offset**
124
125 **modification**
126 )))|(((
127 **Pulse**
128
129 **extension**
130 )))
131 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
132 |(% rowspan="2" %)ECAMCUT|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
133 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
134
135 **Features**
136
137 This instruction is mainly used to set serial port parameters during run, and can also be used in the first cycle of run.
138
139 Can directly set the serial port parameter address (COM1 SD2540, COM2 SD2590) and the value of the serial parameter modification flag (COM1 SD2541, COM2 SD2591) according to the command parameters.
140
141 The specific calculation formula for setting the serial port parameter modification flags (COM1 SD2541, COM2 SD2591) is: (parameter setting value + offset of the corresponding serial port's initial special soft component + 10)*2
142
143 For example, setting the COM1 serial port parameter to 193 (HC1) is (193 +2541-2540 +10)*2 which is (193 +1+10) *2=408. At this time, 193 (HC1) will be set for SD2540 and 408 for SD2541.
144
145 **✎Note: **Whether it is by self-calculation and then to the serial port parameter to modify the flag (COM1 SD2541, COM2 SD2591) setting value, or use this instruction to set, it is possible to modify the serial port parameter when the PLC is in the RUN state.
146
147 About serial port parameter modification flags (COM1 SD2541, COM2 SD2591): During RUN, when the serial port parameters are set and the modified flag is correct (judging at END) to the correct first cycle, the serial port parameter modification flag (COM1 SD2541, COM2, SD2591) are cleared, and then set the same value will not be processed. Mainly to avoid repeated settings multiple times.
148
149 **Serial port parameter setting table**
150
151 (% class="table-bordered" %)
152 |(% colspan="2" %)**Bit number**|**B0**|**B1、B2**|**B3**|**B4、B5、B6、B7、B8、B9**|**B10**|**B11**
153 |(% colspan="2" %)**Name**|**Data length**|**Parity**|**Stop Bit**|**Baud Rate(bps)**|**STX**|**ETX**
154 |(% rowspan="2" %)**Content**|**0 off**|7bit|(% rowspan="2" %)(((
155 b2,b1
156
157 (0,0):None
158
159 (0,1):Odd parity(ODD)
160
161 (1,1):Even parity(EVEN)
162 )))|1bit|(% rowspan="2" %)(((
163 |4800|0111
164 |9600|1000
165 |19200|1001
166 |38400|1010
167 |57600|1011
168 |115200|1100
169 |187500|1101
170 |230400|1110
171 |460800|1111
172 |921600|10000
173 )))|Turn off STX function|Turn off ETX function
174 |**1 on**|8bit|2bit|Enable STX function, the specific value is set by D8124|Turn on the ETX function, the specific value is set by D8125
175
176 **Related software components**
177
178 (% class="table-bordered" %)
179 |**Devices**|**Content**
180 |SD2540|COM1 serial port parameter setting
181 |SD2541|COM1 serial port parameter modification identification
182 |SD2590|COM2 serial port parameter setting
183 |SD2591|COM2 serial port parameter modification sign
184
185 **✎Note:**
186
187 The setting of communication parameters will affect the overall communication. The processing in the PLC is to be modified when there is no communication or after a round of communication is completed. This point needs attention.
188
189 STX function and ETX function are only useful in the case of custom protocol.
190
191 If the set protocol does not match the provided protocol number, the serial port parameter modification flags (COM1 SD2541, COM2 SD2591) will not be cleared after setting. At this time, the protocol will not be set successfully, and it will run according to the original protocol.
192
193 **Error code**
194
195 (% class="table-bordered" %)
196 |**Error code**|**Content**
197 |4085H|The read address of (s) and (N) exceeds the device range
198 |4084H|(N) is not 0 or 1
199
200 **Example**
201
202 (% style="text-align:center" %)
203 [[image:10_html_4a65cac3b7fac971.png||class="img-thumbnail"]]
204
205 Example above
206
207 M1 changes from OFF->ON during run
208
209 SD2540 will be set to 129 (H81, baud rate: 9600, stop bit: 1, data bit: 8, parity bit: none), SD2541 will be set to 280 and then cleared. At this time it has been set successfully
210
211 (% style="text-align:center" %)
212 [[image:10_html_6c71076e92745b55.png||class="img-thumbnail"]]
213
214 If you turn M1 from OFF->ON again
215
216 SD2540 will be set to 129 (H81), SD2541 will be set to 280 but will be cleared.
217
218 (% style="text-align:center" %)
219 [[image:10_html_b19182554f11878c.png||class="img-thumbnail"]]
220
221 = {{id name="_Toc18012"/}}**{{id name="_Toc31925"/}}Modbus station number setting** =
222
223 == {{id name="_Toc27385"/}}**{{id name="_Toc31405"/}}STATION/Modbus station number setting** ==
224
225 **STATION(P)**
226
227 Under the Modbus slave station protocol. Set the station number (s) for the (N) communication port.
228
229 -[STATION (s) (N)]
230
231 **Content, range and data type**
232
233 (% class="table-bordered" %)
234 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
235 |(s)|Station number to be set|0 to 255|Unsigned BIN 16 bit|ANY16
236 |(N)|Which communication port to set 0 means COM1, 1 means COM2|0, 1|Unsigned BIN 16 bit|ANY16
237
238 **Device used**
239
240 (% class="table-bordered" %)
241 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|(((
242 **Offset**
243
244 **modification**
245 )))|(((
246 **Pulse**
247
248 **extension**
249 )))
250 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
251 |(% rowspan="2" %)ECAMCUT|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|(% rowspan="2" %)●
252 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●
253
254 **Features**
255
256 ●This instruction is mainly used to set the station number during run, and it can also be used in the first cycle of run.
257
258 ●The value of the station number address (COM1 SD2544, COM2 SD2594) and the station number modification flag (COM1 SD2545, COM2 SD2595) can be directly set according to the command parameters.
259
260 ●The specific calculation formula for setting the station number modification flag (COM1 SD2545, COM2 SD2595) is: (parameter setting value + offset of the corresponding serial port's initial special device + 10)*2
261
262 ●For example, setting the COM2 station number to 1 is (1 +2595-2590 +10)*2, which is (1 +5+10) *2=32. At this time, SD2594 will be set to 1, and SD2595 will be set to 32.
263
264 **✎Note: **Whether it is by self-calculation and then modifying the ID (COM1 SD2545, COM2 SD2595) setting value to the station number, or setting with this instruction, the station number can be modified when the PLC is in the RUN state.
265
266 ●Regarding station number modification identification (COM1 SD2545, COM2 SD2595): During RUN, when the station number is set and the modification identification is correct (judgment at END) to the correct first cycle, the station number will be modified when the modification is completed (COM1 SD2545, COM2 SD2595) are cleared, and then set the same value will not be processed. Mainly to avoid repeated settings multiple times.
267
268 **Related software components**
269
270 (% class="table-bordered" %)
271 |**Devices**|**Content**
272 |SD2544|COM1 station number setting
273 |SD2545|COM1 station number modification sign
274 |SD2594|COM2 station number setting
275 |SD2595|COM2 station number modification sign
276
277 **Error code**
278
279 (% class="table-bordered" %)
280 |**Error code**|**Content**
281 |4085H|The read address of (s) and (N) exceeds the device range
282 |(% rowspan="2" %)4084H|(s) not in the range of 0 to 255
283 |(N) is not 0 or 1
284
285 **✎Note:**
286
287 The setting of communication parameters will affect the overall communication. The processing in the PLC is to modify it when there is no communication or after a round of communication is completed. This point needs attention.
288
289 **Example**
290
291 (% style="text-align:center" %)
292 [[image:10_html_687577f8e28f9089.png||class="img-thumbnail"]]
293
294 Example above
295
296 M1 changes from OFF->ON during run
297
298 SD2594 will be set to 2, SD2595 will be set to 34 and then it will be cleared. At this time it has been set successfully
299
300 (% style="text-align:center" %)
301 [[image:10_html_b474623d8ed5305f.png||class="img-thumbnail"]]
302
303 If you turn M1 from OFF->ON again
304
305 SD2594 will be set to 2, SD2595 will be set to 34 but will not be cleared.
306
307 (% style="text-align:center" %)
308 [[image:10_html_309b7cb63c6f5d1b.png||class="img-thumbnail"]]
309
310 = {{id name="_Toc1836"/}}**{{id name="_Toc10711"/}}{{id name="_Toc29509"/}}{{id name="_Toc5112"/}}RS instruction** =
311
312 == {{id name="_Toc10635"/}}**{{id name="_Toc16249"/}}{{id name="_Toc17183"/}}{{id name="_Toc29599"/}}RS/External communication instruction** ==
313
314 **RS**
315
316 In the case of Modbus master station protocol: This instruction is the setting interface for the master station to send protocol frames. The function code (s), slave address (m), length (d) of the station number set according to the instruction, and the function code determines whether the data of n is required to be automatically combined to send and receive protocol frames. If it is a read type function code, the data will be written into (N).
317
318 -[RS (s) (m) (d) (N)]
319
320 **{{id name="_Toc26963"/}}Content, range and data type**
321
322 In the case of user-defined protocol:
323
324 (% class="table-bordered" %)
325 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
326 |(s)|The start address of register area that stores the data to be sent|-|Unsigned BIN 16 bit|ANY16
327 |(m)|The length of data to be sent (bytes)|0 to 523|Unsigned BIN 16 bit|ANY16
328 |(d)|The device start number that stores the written data|-|Unsigned BIN 16 it|ANY16
329 |(N)|Number of data written (bytes)|0 to 523|Unsigned BIN 16 bit|ANY16
330
331 In the case of Modbus protocol:
332
333 (% class="table-bordered" %)
334 |**Parameter**|**Content**|**Range**|**Data type**|(((
335 **Data type**
336
337 **(label)**
338 )))
339 |(s)|The high byte stores the station number of slave station, and the low byte stores function code of Modbus|-|Unsigned BIN 16 bit|ANY16
340 |(m)|Slave address. The address provided by the slave station will read or write data from this address of the slave station|-|Unsigned BIN 16 bit|ANY16
341 |(d)|Length. The length of Modbus read or write. The unit is determined by function code.|-|Unsigned BIN 16 bit|ANY16
342 |(N)|Start address for reading or writing data|-|Unsigned BIN 16 bit|ANY16
343
344 {{id name="_Toc26776"/}}{{id name="_Toc17529"/}}**Device used**
345
346 (% class="table-bordered" %)
347 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" %)**Devices**|**Offset modification**|(((
348 **Pulse**
349
350 **extension**
351 )))
352 |**T**|**C**|**D**|**R**|**K**|**H**|**[D]**|**XXP**
353 |(% rowspan="4" %)RS|Parameter 1|●|●|●|●|●|●| |
354 |Parameter 2|●|●|●|●|●|●| |
355 |Parameter 3|●|●|●|●|●|●| |
356 |Parameter 4|●|●|●|●|●|●| |
357
358 **{{id name="OLE_LINK409"/}}(1) {{id name="_Toc13811"/}}Custom protocol**
359
360 When the communication protocol is set as a [[custom protocol>>url:http://dict.cn/self-defined%20protocol]]. When the contact in before RS instruction is turned on and SM2591 is also turned on at the same time, if the sending length (m) is not 0, the data of (s) will be sent (m) bytes out, and then it will be in the mode of waiting for reception. When the data is received, (N) bytes of data will be stored in (d). SM2593 will be turned ON after receiving (N) data.
361
362 In addition, when the sending length (m) is 0, it will be in the receive-only mode. When the receiving length (N) is 0, it will be in the send-only mode.
363
364 To enable the start character (STX) and the end character (ETX) modes of RS instruction, the status of the 10th and 11th bits of the special address SD2600 must be set. See the table below for detailed settings:
365
366 (% class="table-bordered" %)
367 |(% colspan="2" %)**Bit number**|**B0**|**B1、B2**|**B3**|(((
368 **B4、B5、B6、**
369
370 **B7、B8、B9**
371 )))|**B10**|**B11**
372 |(% colspan="2" %)**Name**|**Data length**|**Parity**|**Stop Bit**|**Baud rate(bps)**|**STX**|**ETX**
373 |(% rowspan="2" %)**Content**|(((
374 **0**
375
376 **off**
377 )))|7-bit|(% rowspan="2" %)(((
378 b2, b1
379
380 (0,0): None
381
382 (0,1): Odd parity (ODD)
383
384 (1,1): Even parity (EVEN)
385 )))|1-bit|(% rowspan="2" %)(((
386 |9600|001000
387 |19200|001001
388 |38400|001010
389 |57600|001011
390 |115200|001100
391 |187500|001101
392 |230400|001110
393 |460800|001111
394 |921600|010000
395 )))|None|None
396 |(((
397 **1**
398
399 **on**
400 )))|8-bit|2-bit|Turn on STX, the STX value is set in SD2600|Turn on ETX, the ETX value is set in SD2601
401
402 **Example**
403
404 (% style="text-align:center" %)
405 [[image:10_html_dbd00c955b74b44.png||class="img-thumbnail"]]
406
407 When M1 is ON, the sending and receiving data of communication after executing instruction is stored as the following figure.
408
409 (% style="text-align:center" %)
410 [[image:10_html_fa670961ae3e6f05.gif||class="img-thumbnail"]]
411
412 Some configuration and preparation of serial communication are needed for actual programming to communicate as expected, such as setting the transceiver mode of serial port, baud rate, number of bits, parity, software protocol settings, timeout judgment conditions, and data preparation for the transceiver buffer, send and receive flag processing, etc.,
413
414 A relatively complete RS communication setup program is shown as follows:
415
416 (% style="text-align:center" %)
417 [[image:10_html_487e57593173359e.png||class="img-thumbnail"]]
418
419 (((
420 Serial port parameters settings:
421
422 Baud rate 112500, stop bit 1, data bit 8, parity bit none
423 )))
424
425 (((
426 Set the protocol as a custom protocol
427
428 Sending interval: 5ms
429
430 Receiving timeout: 100ms
431
432 Number of repetitions: 3 times
433
434 Timeout between characters: 30ms
435
436 Custom protocol, send start address D200, sending length 8, receive start address D300, receiving length 8,
437
438 Receive start address D300 Receive length 6
439
440 Send directly after trigger
441
442 After receiving, close the instruction directly and reset the instruction receiving flag
443 )))
444
445 For detailed user-defined protocol instructions, please refer to "__[[10.7.1 Custom protocol description>>path:#_10.7.1 Custom protocol description]]__"
446
447 **{{id name="_Toc24060"/}}(2) Modbus protocol**
448
449 When the protocol is set to Modbus master protocol (whether it is RTU or ASCII). When the contact before RS instruction is turned ON, the RS instruction will send the combined data frame according to the station number function code (s), slave station address (m), length (d) and judge whether the data of (N) is needed according to the function code.
450
451 (% style="text-align:center" %)
452 [[image:10_html_9d0ddca3305d21b0.png||class="img-thumbnail"]]
453
454 (% class="table-bordered" %)
455 |**Parameter**|**Content**
456 |(s)|The high byte stores the station number of slave station, and the low byte stores the function code of Modbus
457 |(m)|Slave address. The address provided by the slave station will read or write data from this address of the slave station
458 |(d)|Length, the length of Modbus read or write. The unit is determined by the function code.
459 |(N)|Start address for reading or writing data
460
461 (% style="text-align:center" %)
462 [[image:10_html_a7e64b4f4526b73e.png||class="img-thumbnail"]]
463
464 (((
465 Serial port parameter setting
466
467 Baud rate 115200, data bit 8, parity bit none, stop bit 1
468
469 Communication protocol setting: ModbusRTU master station protocol
470
471 Sending interval: 5ms
472
473 Receiving timeout: 100ms
474
475 Timeout retry times: 3 times
476
477 Station number 01H, function code 03H, slave address 10, length 05
478 )))
479
480 As the ladder program shown above:
481
482 When M1 is turned ON, PLC will send data (hexadecimal) from COM2 of PLC: 01 03 00 0A 00 05 A5 C8
483
484 01: represents slave address, the upper 8 bits of (s);
485
486 03: Modbus instruction code, the lower 8 bits of (s), meaning to read the slave register;
487
488 00 0A: The address of slave register to be read, the value of (m);
489
490 00 05: The number of registers to be read, the value of (d),
491
492 A5 C8: CRC check code.
493
494 For detailed custom protocol instructions, please refer to "[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__10.7.2 Modbus protocol description__>>path:#_10.7.2 Modbus protocol description]](%%)"
495
496 **✎Note: **
497
498 Although the RS instruction currently allows all the parameters of the instruction to use constants such as K and H, there are different restrictions depending on the protocol.
499
500 When the protocol is a custom protocol, S and D cannot be constants, otherwise it will report (3189H) error.
501
502 When the protocol is Modbus protocol, n cannot be a constant, otherwise it will report (3189H) error.
503
504 The combination of RTU protocol and 7-bit data bits cannot be set.
505
506 If the serial port parameter settings are different, it may still be able to communicate. At present, it is normal to set one.
507
508 Currently, the RS instruction cannot be used in interrupts and events.
509
510 **{{id name="_Toc8113"/}}Error code**
511
512 (% class="table-bordered" %)
513 |(% style="width:102px" %)**Error code**|(% style="width:979px" %)**Content**
514 |(% style="width:102px" %)4085H|(% style="width:979px" %)The read address of (s), (m), (d) and (N) exceed the device range.
515 |(% style="width:102px" %)3180H|(% style="width:979px" %)COM2 data reception error. There may be interference on the communication line, it is recommended to connect the ground wire.
516 |(% style="width:102px" %)3181H|(% style="width:979px" %)COM2 data reception timed out. "Check the wiring, check whether the serial port parameter settings are compatible with master and slave, check whether there is interference. Check whether the slave station is too late to respond. For this reason, you can try to increase the sending interval SD2546."
517 |(% style="width:102px" %)3182H|(% style="width:979px" %)COM2 CRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
518 |(% style="width:102px" %)3183H|(% style="width:979px" %)COM2 LRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
519 |(% style="width:102px" %)3184H|(% style="width:979px" %)The COM2 station number is incorrectly configured. Check the slave station number setting, and check whether there is any problem with the receiving and sending mechanism of slave station.
520 |(% style="width:102px" %)3185H|(% style="width:979px" %)COM2 send buffer overflow. Contact a technician if this error occurs
521 |(% style="width:102px" %)3186H|(% style="width:979px" %)COM2 function code is wrong. Check whether the set function code is a function code supported by PLC
522 |(% style="width:102px" %)3187H|(% style="width:979px" %)COM2 address is wrong. Check whether the slave station has this address (please refer to Modbus Abnormal 02)
523 |(% style="width:102px" %)3188H|(% style="width:979px" %)The length of COM2 is wrong. Check whether the communication length exceeds the length range specified by the Modbus protocol, or whether it exceeds the specified length range of the custom protocol.
524 |(% style="width:102px" %)3189H|(% style="width:979px" %)COM2 data error. "Check whether there are errors in the parameters of the instruction. Check whether the slave station supports the setting of this value. (Please refer to Modbus Abnormal 03)"
525 |(% style="width:102px" %)318AH|(% style="width:979px" %)COM2 slave station is busy. Slave station returns information: Slave station is busy (please refer to Modbus exception 06)
526 |(% style="width:102px" %)318BH|(% style="width:979px" %)COM2 slave station does not support function codes. Check whether the slave station supports this function code (please refer to Modbus exception 01)
527 |(% style="width:102px" %)318CH|(% style="width:979px" %)COM2 slave station is faulty. Slave station returns information: Slave station is faulty, please check whether the slave station is faulty (please refer to Modbus Abnormal 04)
528 |(% style="width:102px" %)318DH|(% style="width:979px" %)COM2 slave station confirmation. Slave station return information: slave station confirmation (please refer to Modbus abnormal 05)
529 |(% style="width:102px" %)318EH|(% style="width:979px" %)COM2 current protocol does not support this instruction or function. The related conmunication instruction of master station or the function of maste station cannot be used when it is set to slave station protocol, please change the protocol or close the contact before the corresponding instruction or diable the corresponding communication function.
530 |(% style="width:102px" %)318FH|(% style="width:979px" %)COM2 sending timed out. Contact a technician if this error occurs
531 |(% style="width:102px" %)31A0H|(% style="width:979px" %)COM2 is not available as a gateway. Slave station returns information: unavailable gateway (please refer to Modbus exception 0A)
532 |(% style="width:102px" %)31A1H|(% style="width:979px" %)COM2 indicates that no response was obtained from the target device. Slave station returns information: the device is not in the network (please refer to Modbus exception 0B)
533
534 = {{id name="_Toc3328"/}}**{{id name="_Toc27516"/}}{{id name="_Toc32747"/}}RS2 instruction** =
535
536 == **RS2/External communication instruction** ==
537
538 **RS2**
539
540 In custom protocol: This instruction is a communication send and receive instruction. It takes out (M) of the initial data specified (s) and send it, and stores (N) of the data received through the serial port in (d) and sent by (n1) automatic communication port.
541
542 In Modbus master station protocol: This instruction is the setting interface for the master station to send protocol frames. According to the station number function code (s), slave address (m), length (d) set by the instruction, and the function code to determine whether n data is required to automatically combined sending and receiving protocol frames. If it is a read type function code, the data would be written to (N) and sent by (n1) custom communication port.
543
544 -[RS2 (s) (m) (d) (N) (n1)]
545
546 **Content, range and data type**
547
548 In custom protocol
549
550 (% class="table-bordered" %)
551 |=(% scope="row" %)**Parameter**|=(% style="width: 453px;" %)**Content**|=(% style="width: 107px;" %)**Range**|=(% style="width: 207px;" %)**Data type**|=(% style="width: 197px;" %)**Data type (label)**
552 |=(s)|(% style="width:453px" %)The start address of register area that stores the data to be sent|(% style="width:107px" %)-|(% style="width:207px" %)Unsigned BIN 16 bit|(% style="width:197px" %)ANY16
553 |=(m)|(% style="width:453px" %)The length of data to be sent (bytes)|(% style="width:107px" %)0 to 528|(% style="width:207px" %)Unsigned BIN 16 bit|(% style="width:197px" %)ANY16
554 |=(d)|(% style="width:453px" %)The device start number that stores the written data|(% style="width:107px" %)-|(% style="width:207px" %)Unsigned BIN 16 bit|(% style="width:197px" %)ANY16
555 |=(N)|(% style="width:453px" %)Number of data written (bytes)|(% style="width:107px" %)0 to 528|(% style="width:207px" %)Unsigned BIN 16 bit|(% style="width:197px" %)ANY16
556 |=(n1)|(% style="width:453px" %)Specify the communication port|(% style="width:107px" %) |(% style="width:207px" %)Unsigned BIN 16 bit|(% style="width:197px" %)ANY16
557
558 In Modbus protocol
559
560 (% class="table-bordered" %)
561 |=(% scope="row" %)**Parameter**|=(% style="width: 517px;" %)**Content**|=(% style="width: 114px;" %)**Range**|=(% style="width: 173px;" %)**Data type**|=(% style="width: 185px;" %)**Data type (label)**
562 |=(s)|(% style="width:517px" %)The high byte stores the station number of slave station, and the low byte stores function code of Modbus|(% style="width:114px" %)-|(% style="width:173px" %)Unsigned BIN 16 bit|(% style="width:185px" %)ANY16
563 |=(m)|(% style="width:517px" %)Slave address. The address provided by the slave station will read or write data from this address of the slave station|(% style="width:114px" %)-|(% style="width:173px" %)Unsigned BIN 16 bit|(% style="width:185px" %)ANY16
564 |=(d)|(% style="width:517px" %)Length. The length of Modbus read or write. The unit is determined by function code.|(% style="width:114px" %)-|(% style="width:173px" %)Unsigned BIN 16 bit|(% style="width:185px" %)ANY16
565 |=(N)|(% style="width:517px" %)The start address of the data to be read or written|(% style="width:114px" %)-|(% style="width:173px" %)Unsigned BIN 16 bit|(% style="width:185px" %)ANY16
566 |=(n1)|(% style="width:517px" %)Specify the communicatiom port|(% style="width:114px" %) |(% style="width:173px" %)Unsigned BIN 16 bit|(% style="width:185px" %)ANY16
567
568 **Device used**
569
570 (% class="table-bordered" style="width:1078px" %)
571 |=(% rowspan="2" style="width: 116px;" %)**Instruction**|=(% rowspan="2" style="width: 101px;" %)**Parameter**|=(% colspan="7" style="width: 496px;" %)**Devices**|=(% style="width: 175px;" %)(((
572 **Offset modification**
573 )))|=(% style="width: 187px;" %)(((
574 **Pulse extension**
575 )))
576 |=(% style="width: 61px;" %)**T**|=(% style="width: 68px;" %)**C**|=(% style="width: 59px;" %)**D**|=(% style="width: 73px;" %)**R**|=(% style="width: 85px;" %)**SD**|=(% style="width: 79px;" %)**K**|=(% style="width: 71px;" %)**H**|=(% style="width: 175px;" %)**[D]**|=(% style="width: 187px;" %)**XXP**
577 |=(% rowspan="5" style="width: 116px;" %)RS2|(% style="width:101px" %)(s)|(% style="width:61px" %)●|(% style="width:68px" %)●|(% style="width:59px" %)●|(% style="width:73px" %)●|(% style="width:85px" %)●|(% style="width:79px" %)●|(% style="width:71px" %)●|(% style="width:175px" %)-|(% style="width:187px" %)-
578 |(% style="width:101px" %)(m)|(% style="width:61px" %)●|(% style="width:68px" %)●|(% style="width:59px" %)●|(% style="width:73px" %)●|(% style="width:85px" %)●|(% style="width:79px" %)●|(% style="width:71px" %)●|(% style="width:175px" %)-|(% style="width:187px" %)-
579 |(% style="width:101px" %)(d)|(% style="width:61px" %)●|(% style="width:68px" %)●|(% style="width:59px" %)●|(% style="width:73px" %)●|(% style="width:85px" %)●|(% style="width:79px" %)●|(% style="width:71px" %)●|(% style="width:175px" %)-|(% style="width:187px" %)-
580 |(% style="width:101px" %)(N)|(% style="width:61px" %)●|(% style="width:68px" %)●|(% style="width:59px" %)●|(% style="width:73px" %)●|(% style="width:85px" %)●|(% style="width:79px" %)●|(% style="width:71px" %)●|(% style="width:175px" %)-|(% style="width:187px" %)-
581 |(% style="width:101px" %)(n1)|(% style="width:61px" %) |(% style="width:68px" %) |(% style="width:59px" %) |(% style="width:73px" %) |(% style="width:85px" %) |(% style="width:79px" %)●|(% style="width:71px" %)●|(% style="width:175px" %) |(% style="width:187px" %)
582
583 **Features**
584
585 Parameter (n1) is the specified port. Curently, k0 indicates COM1, and k1 indicates COM2.
586
587 **(1) Custom protocol**
588
589 When the communication protocol is set as a [[custom protocol>>url:http://dict.cn/self-defined%20protocol]]. When the contact in before RS2 instruction is turned on and “sending control enable” is also turned on at the same time, and the sending length (m) is not 0, the data of (s) will be sent (m) bytes out, and then it will be in the mode of waiting for reception. When the data is received, (N) bytes of data will be stored in (d). “reception control or reception notice” will be turned ON after receiving (N) data.
590
591 In addition, when the sending length (m) is 0, it will be in the receive-only mode. When the receiving length (N) is 0, it will be in the send-only mode.
592
593 To enable the start character (STX) and the end character (ETX) modes of RS2 instruction, the status of the 10th and 11th bits of the special address “communication port setting” must be set. See the table below for detailed settings:
594
595 (% class="table-bordered" style="width:1073px" %)
596 |(% colspan="2" style="width:154px" %)**Bit number**|(% style="width:68px" %)**B0**|(% style="width:181px" %)**B1、B2**|(% style="width:68px" %)**B3**|(% style="width:180px" %)(((
597 **B4、B5、B6、**
598
599 **B7、B8、B9**
600 )))|(% style="width:207px" %)**B10**|(% style="width:213px" %)**B11**
601 |(% colspan="2" style="width:154px" %)**Name**|(% style="width:68px" %)**Data length**|(% style="width:181px" %)**Parity**|(% style="width:68px" %)**Stop Bit**|(% style="width:180px" %)**Baud rate(bps)**|(% style="width:207px" %)**STX**|(% style="width:213px" %)**ETX**
602 |(% rowspan="2" style="width:85px" %)**Content**|(% style="width:69px" %)(((
603 **0**
604
605 **off**
606 )))|(% style="width:68px" %)7-bit|(% rowspan="2" style="width:181px" %)(((
607 b2, b1
608
609 (0,0): none
610
611 (0,1): odd parity (ODD)
612
613 (1,1): even parity (EVEN)
614 )))|(% style="width:68px" %)1-bit|(% rowspan="2" style="width:180px" %)(((
615 (% style="width:164px" %)
616 |(% style="width:83px" %)9600|(% style="width:79px" %)001000
617 |(% style="width:83px" %)19200|(% style="width:79px" %)001001
618 |(% style="width:83px" %)38400|(% style="width:79px" %)001010
619 |(% style="width:83px" %)57600|(% style="width:79px" %)001011
620 |(% style="width:83px" %)115200|(% style="width:79px" %)001100
621 |(% style="width:83px" %)187500|(% style="width:79px" %)001101
622 |(% style="width:83px" %)230400|(% style="width:79px" %)001110
623 |(% style="width:83px" %)460800|(% style="width:79px" %)001111
624 |(% style="width:83px" %)921600|(% style="width:79px" %)010000
625 )))|(% style="width:207px" %)None|(% style="width:213px" %)None
626 |(% style="width:69px" %)(((
627 **1**
628
629 **on**
630 )))|(% style="width:68px" %)8-bit|(% style="width:68px" %)2-bit|(% style="width:207px" %)Turn on STX, the STX value is set in the device of the corresponding communication|(% style="width:213px" %)Turn on ETX, the ETX value is set in the device of the corresponding communication
631
632 **Example**
633
634 (% style="text-align:center" %)
635 [[image:10_html_42196c0b440282c3.gif||class="img-thumbnail"]]
636
637 When M1 is ON, the sending and receiving data of communication after executing instruction is stored as the following figure.
638
639 (% style="text-align:center" %)
640 [[image:image-20220926140831-1.jpeg||class="img-thumbnail"]]
641
642 Some configuration and preparation of serial communication are needed for actual programming to communicate as expected, such as setting the transceiver mode of serial port, baud rate, number of bits, parity, software protocol settings, timeout judgment conditions, and data preparation for the transceiver buffer, send and receive flag processing, etc.,
643
644 A relatively complete RS communication setup program is shown as follows:
645
646 (% style="text-align:center" %)
647 [[image:10_html_1917cca86a75115b.png||class="img-thumbnail"]]
648
649 (((
650 Set the protocol to a custom protocol.
651
652 Set serial port parameter: baud rate 115200 stop bit 1, data bit 8, no parity bit
653 )))
654
655 For detailed custom protocol instructions, please refer to "__[[10.7.1 Custom protocol description>>path:#_10.7.1 Custom protocol description]]__"
656
657 **(2) Modbus protocol**
658
659 When the protocol is set to Modbus master protocol (whether it is RTU or ASCII). When the contact before RS2 instruction is turned ON, the RS2 instruction will send the combined data frame according to the station number function code (s), slave station address (m), length (d) and judge whether the data of (N) is needed according to the function code.
660
661 (% style="text-align:center" %)
662 [[image:10_html_d97afb4fe5346ca.gif||class="img-thumbnail"]]
663
664 (% class="table-bordered" %)
665 |=(% scope="row" %)**Parameter**|=**Content**
666 |=(s)|The high byte stores the station number of slave station, and the low byte stores function code of Modbus
667 |=(m)|Slave address. The address provided by the slave station will read or write data from this address of the slave station
668 |=(d)|Length. The length of Modbus read or write. The unit is determined by function code.
669 |=(N)|The start address of the data to be read or written
670 |=(n1)|Specify the communicatiom port
671
672 (% style="text-align:center" %)
673 [[image:10_html_7400bc2aa339cd6d.png||class="img-thumbnail"]]
674
675 (((
676 As the ladder program shown above:
677
678 When M1 is turned ON, PLC will send data (hexadecimal) from COM2 of PLC: 01 03 00 0A 00 05 A5 C8
679
680 * 01: represents slave address, the high 8 bits of (s);
681 * 03: Modbus command code, the low 8 bits of (s), which means to read the slave register;
682 * 00 0A: The address of slave register to be read, the value of (m);
683 * 00 05: The number of registers to be read, the value of (d),
684 * A5 C8: CRC check code.
685 )))
686
687 For detailed custom protocol instructions, please refer to "[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__10.7.2 Modbus protocol description__>>path:#_10.7.2 Modbus protocol description]](%%)"
688
689 **✎Note: **
690
691 * The RS2 instruction allows parameters to be represented by K and H constants, but there are different restrictions depending on the protocol.
692 * When the protocol is a custom protocol, S and D cannot be constants, otherwise it will report (3X89H) error.
693 * When the protocol is Modbus protocol, n cannot be a constant, otherwise it will report (3X89H) error.
694 * When the protocol is set to the RTU protocol, only 8 bits of data can be selected
695 * If the serial port parameter settings are different, it may still be able to communicate. However, it is recommended that the serial port parameters be the same to avoid other faults.
696 * Currently, the RS2 instruction cannot be used in interrupts and events.
697
698 **Error code**
699
700 (% class="table-bordered" %)
701 |=(% scope="row" style="width: 104px;" %)**Error code**|=(% style="width: 977px;" %)**Content**
702 |=(% style="width: 104px;" %)4085H|(% style="width:977px" %)The read address of (s), (m), (d) and (N) exceed the device range.
703 |=(% style="width: 104px;" %)4084H|(% style="width:977px" %)The parameter value exceed the specified range
704 |=(% style="width: 104px;" %)3080H|(% style="width:977px" %)COM1 data reception error. There may be interference on the communication line, it is recommended to connect the ground wire.
705 |=(% style="width: 104px;" %)3081H|(% style="width:977px" %)COM1 data reception timed out. "Check the wiring, check whether the serial port parameter settings are compatible with master and slave, check whether there is interference. Check whether the slave station is too late to respond. For this reason, you can try to increase “the sending interval".
706 |=(% style="width: 104px;" %)3082H|(% style="width:977px" %)COM1 CRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
707 |=(% style="width: 104px;" %)3083H|(% style="width:977px" %)COM1 LRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
708 |=(% style="width: 104px;" %)3084H|(% style="width:977px" %)The COM1 station number is incorrectly configured. Check the slave station number setting, and check whether there is any problem with the receiving and sending mechanism of slave station.
709 |=(% style="width: 104px;" %)3085H|(% style="width:977px" %)COM1 send buffer overflow. Contact a technician if this error occurs.
710 |=(% style="width: 104px;" %)3086H|(% style="width:977px" %)COM1 function code is wrong. Check whether the set function code is a function code supported by PLC
711 |=(% style="width: 104px;" %)3087H|(% style="width:977px" %)COM1 address is wrong. Check whether the slave station has this address (please refer to Modbus Abnormal 02)
712 |=(% style="width: 104px;" %)3088H|(% style="width:977px" %)The length of COM1 is wrong. Check whether the communication length exceeds the length range specified by the Modbus protocol, or whether it exceeds the specified length range of the custom protocol.
713 |=(% style="width: 104px;" %)3089H|(% style="width:977px" %)COM1 data error. "Check whether there are errors in the parameters of the instruction. Check whether the slave station supports the setting of this value. (Please refer to Modbus Abnormal 03)"
714 |=(% style="width: 104px;" %)308AH|(% style="width:977px" %)COM1 slave station is busy. Slave station returns information: Slave station is busy (please refer to Modbus exception 06)
715 |=(% style="width: 104px;" %)308BH|(% style="width:977px" %)COM1 slave station does not support function codes. Check whether the slave station supports this function code (please refer to Modbus exception 01)
716 |=(% style="width: 104px;" %)308CH|(% style="width:977px" %)COM1 slave station is faulty. Slave station returns information: Slave station is faulty, please check whether the slave station is faulty (please refer to Modbus Abnormal 04)
717 |=(% style="width: 104px;" %)308DH|(% style="width:977px" %)COM1 slave station confirmation. Slave station return information: slave station confirmation (please refer to Modbus abnormal 05)
718 |=(% style="width: 104px;" %)308EH|(% style="width:977px" %)COM1 current protocol does not support this instruction or function. The related conmunication instruction of master station or the function of maste station cannot be used when it is set to slave station protocol, please change the protocol or close the contact before the corresponding instruction or diable the corresponding communication function.
719 |=(% style="width: 104px;" %)308FH|(% style="width:977px" %)COM1 sending timed out. Contact a technician if this error occurs.
720 |=(% style="width: 104px;" %)30A0H|(% style="width:977px" %)COM1 is not available as a gateway. Slave station returns information: unavailable gateway (please refer to Modbus exception 0A)
721 |=(% style="width: 104px;" %)30A1H|(% style="width:977px" %)COM1 indicates that no response was obtained from the target device. Slave station returns information: the device is not in the network (please refer to Modbus exception 0B)
722 |=(% style="width: 104px;" %)3181H|(% style="width:977px" %)COM2 data reception timed out. "Check the wiring, check whether the serial port parameter settings are compatible with master and slave, check whether there is interference. Check whether the slave station is too late to respond. For this reason, you can try to increase the “sending interval".
723 |=(% style="width: 104px;" %)3182H|(% style="width:977px" %)COM2 CRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
724 |=(% style="width: 104px;" %)3183H|(% style="width:977px" %)COM2 LRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
725 |=(% style="width: 104px;" %)3184H|(% style="width:977px" %)The COM2 station number is incorrectly configured. Check the slave station number setting, and check whether there is any problem with the receiving and sending mechanism of slave station.
726 |=(% style="width: 104px;" %)3185H|(% style="width:977px" %)COM2 send buffer overflow. Contact a technician if this error occurs.
727 |=(% style="width: 104px;" %)3186H|(% style="width:977px" %)COM2 function code is wrong. Check whether the set function code is a function code supported by PLC.
728 |=(% style="width: 104px;" %)3187H|(% style="width:977px" %)COM2 address is wrong. Check whether the slave station has this address (please refer to Modbus Abnormal 02)
729 |=(% style="width: 104px;" %)3188H|(% style="width:977px" %)The length of COM2 is wrong. Check whether the communication length exceeds the length range specified by the Modbus protocol, or whether it exceeds the specified length range of the custom protocol.
730 |=(% style="width: 104px;" %)3189H|(% style="width:977px" %)COM2 data error. "Check whether there are errors in the parameters of the instruction. Check whether the slave station supports the setting of this value. (Please refer to Modbus Abnormal 03)"
731 |=(% style="width: 104px;" %)318AH|(% style="width:977px" %)COM2 slave station is busy. Slave station returns information: Slave station is busy (please refer to Modbus exception 06)
732 |=(% style="width: 104px;" %)318BH|(% style="width:977px" %)COM2 slave station does not support function codes. Check whether the slave station supports this function code (please refer to Modbus exception 01)
733 |=(% style="width: 104px;" %)318CH|(% style="width:977px" %)COM2 slave station is faulty. Slave station returns information: Slave station is faulty, please check whether the slave station is faulty (please refer to Modbus Abnormal 04)
734 |=(% style="width: 104px;" %)318DH|(% style="width:977px" %)COM2 slave station confirmation. Slave station return information: slave station confirmation (please refer to Modbus abnormal 05)
735 |=(% style="width: 104px;" %)318EH|(% style="width:977px" %)COM2 current protocol does not support this instruction or function. The related conmunication instruction of master station or the function of maste station cannot be used when it is set to slave station protocol, please change the protocol or close the contact before the corresponding instruction or diable the corresponding communication function.
736 |=(% style="width: 104px;" %)318FH|(% style="width:977px" %)COM2 sending timed out. Contact a technician if this error occurs.
737 |=(% style="width: 104px;" %)31A0H|(% style="width:977px" %)COM2 is not available as a gateway. Slave station returns information: unavailable gateway (please refer to Modbus exception 0A)
738 |=(% style="width: 104px;" %)31A1H|(% style="width:977px" %)COM2 indicates that no response was obtained from the target device. Slave station returns information: the device is not in the network (please refer to Modbus exception 0B)
739
740 = **Expansion module communication** =
741
742 == {{id name="_Toc15142"/}}**{{id name="_Toc7013"/}}{{id name="_Toc4135"/}}Single word data writing from TO/PLC to the module (16-bit specification)** ==
743
744 **TO(P)**
745
746 Write the data at the start (N) point of the device specified in (s3) to the buffer memory in the intelligent function module specified in (s1) after the address specified in (s2).
747
748 -[TO (s1) (s2) (s3) (N)]
749
750 **{{id name="OLE_LINK401"/}}Content, range and data type**
751
752 (% class="table-bordered" %)
753 |**Parameter**|(% style="width:419px" %)**Content**|(% style="width:152px" %)**Range**|(% style="width:228px" %)**Data type**|(% style="width:177px" %)**Data type (label)**
754 |(s1)|(% style="width:419px" %)Module number, the first module is 0, the second module is 1, and so on|(% style="width:152px" %)0 to 32767|(% style="width:228px" %)Unsigned BIN 16 bit|(% style="width:177px" %)ANY16
755 |(s2)|(% style="width:419px" %)Start writing from which BFM in the module|(% style="width:152px" %)0 to 32767|(% style="width:228px" %)Unsigned BIN 16 bit|(% style="width:177px" %)ANY16
756 |(s3)|(% style="width:419px" %)Start number of the device storing the written data|(% style="width:152px" %)-32768 to 32767|(% style="width:228px" %)Signed BIN 16 bit|(% style="width:177px" %)ANY16
757 |(N)|(% style="width:419px" %)Number of data written|(% style="width:152px" %)0 to 512|(% style="width:228px" %)Unsigned BIN 16 bit|(% style="width:177px" %)ANY16
758
759 **Device used**
760
761 (% class="table-bordered" %)
762 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|(((
763 **Offset**
764
765 **modification**
766 )))|(((
767 **Pulse**
768
769 **extension**
770 )))
771 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
772 |(% rowspan="4" %)TO|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
773 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
774 |Parameter 3|●|●|●|●|●|●|●|●|●|●|●|●
775 |Parameter 4|●|●|●|●|●|●|●|●|●|●|●|●
776
777 **Features**
778
779 Write the data at the start (N) point of the device specified in (s3) to the buffer memory in the intelligent function module specified in (s1) after the address specified in (s2).
780
781 (% style="text-align:center" %)
782 [[image:10_html_603a54a4bdbc6b8f.gif||class="img-thumbnail"]]
783
784 As the following Circuit program
785
786 (% style="text-align:center" %)
787 [[image:10_html_9d053b1a8c234094.png||class="img-thumbnail"]]
788
789 Indicates that when X1 is ON, write the data in the PLC's D220 register to the buffer register (BFM) #24 in the #1 (second) special module. When X1 is OFF, no operation is performed.
790
791 Currently LX5VPLC supports 16 special expansion modules at the same time.
792
793 The special devices used are as follows
794
795 (% class="table-bordered" %)
796 |**Devices**|**Content**
797 |SD2081|Total number of modules
798 |SD2082|Number of IO expansion modules
799 |SD2083|Number of special expansion modules
800 |SD2084|The first missing expansion module. When the value is -1, it means not lost
801
802 **Error code**
803
804 (% class="table-bordered" %)
805 |**Error code**|**Content**
806 |4085H|The read addresses of (s1), (s2), (s3) and (N) exceed the device range
807 |4084H|(s1) and (s2) is not in the range of 0 to 32767 or (N) is not in the range of 0 to 512
808 |7080H|Check error when communicating between PLC and module
809 |7081H|Expansion module communication message is abnormal
810 |7082H|FROM/TO instruction error
811 |7083H|The specified extension module was not found
812
813 **Example**
814
815 (% style="text-align:center" %)
816 [[image:10_html_936412ccc04cc4cb.png||class="img-thumbnail"]]
817
818 When M1 is turned on
819
820 The values of D200 and D201 will be passed to BFM2 and BFM3 of module #0 (the first)
821
822 (% style="text-align:center" %)
823 [[image:10_html_555c0224c9a9e02d.png||class="img-thumbnail"]]
824
825 (% style="text-align:center" %)
826 [[image:10_html_ab29c2a6c272559.png||class="img-thumbnail"]]
827
828 == **Double word data write from DTO/PLC to the module (32-bit specification)** ==
829
830 DTO(P)
831
832 Write the data of (N)×2 points from the device specified in (s3) to the buffer memory in the intelligent function module specified in (s1) and beyond the address specified in (s2).
833
834 -[DTO (s1) (s2) (s3) (N)]
835
836 **Content, range and data type**
837
838 (% class="table-bordered" %)
839 |**Parameter**|(% style="width:421px" %)**Content**|(% style="width:228px" %)**Range**|(% style="width:201px" %)**Data type**|**Data type (label)**
840 |(s1)|(% style="width:421px" %)Module number, the first module is 0, the second module is 1, and so on|(% style="width:228px" %)0 to 32767|(% style="width:201px" %)Unsigned BIN 16 bit|ANY16
841 |(s2)|(% style="width:421px" %)Start writing from which BFM in the module|(% style="width:228px" %)0 to 32767|(% style="width:201px" %)Unsigned BIN 16 bit|ANY16
842 |(s3)|(% style="width:421px" %)Start number of the device storing the written data|(% style="width:228px" %)-2147483648 to 2147483647|(% style="width:201px" %)Signed BIN 32 bit|ANY32
843 |(N)|(% style="width:421px" %)Number of data written|(% style="width:228px" %)0 to 256|(% style="width:201px" %)Unsigned BIN 16 bit|ANY16
844
845 **Device used**
846
847 (% class="table-bordered" %)
848 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="12" %)**Devices**|(((
849 **Offset**
850
851 **modification**
852 )))|(((
853 **Pulse**
854
855 **extension**
856 )))
857 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**[D]**|**XXP**
858 |(% rowspan="4" %)DTO|Parameter 1|●|●|●|●|●|●|●|●| | |●|●|●|●
859 |Parameter 2|●|●|●|●|●|●|●|●| | |●|●|●|●
860 |Parameter 3|●|●|●|●|●|●|●|●|●|●|●|●|●|●
861 |Parameter 4|●|●|●|●|●|●|●|●| | |●|●|●|●
862
863 **Features**
864
865 Write the data of (N)×2 points from the device specified in (s3) to the buffer memory in the intelligent function module specified in (s1) and beyond the address specified in (s2).
866
867 (% style="text-align:center" %)
868 [[image:10_html_86bfbd89b2652fbf.gif||class="img-thumbnail"]]
869
870 As the following Circuit program
871
872 (% style="text-align:center" %)
873 [[image:10_html_d3dfe7b80f649f8e.png||class="img-thumbnail"]]
874
875 Indicates that when M1 is ON, write the data in the PLC's D200 and D201 registers to the buffer registers (BFM) #1 and #2 in the #0 (first) special module. When X1 is OFF, no operation is performed.
876
877 Currently LX5V PLC supports 16 special expansion modules at the same time.
878
879 The special devices used are as follows
880
881 (% class="table-bordered" %)
882 |**Devices**|**Content**
883 |SD2081|Total number of modules
884 |SD2082|Number of IO expansion modules
885 |SD2083|Number of special expansion modules
886 |SD2084|The first missing expansion module. When the value is -1, it means not lost
887
888 **Error code**
889
890 (% class="table-bordered" %)
891 |**Error code**|**Content**
892 |4085H|(s1) (s2) (s3) (N) The read address exceeds the device range
893 |4084H|(s1) (s2) is not in the range of 0 to 32767 or (N) is not in the range of 0 to 256
894 |7080H|Check error when communicating between PLC and module
895 |7081H|Expansion module communication message is abnormal
896 |7082H|FROM/TO instruction error
897 |7083H|The specified extension module was not found
898
899 **Example**
900
901 (% style="text-align:center" %)
902 [[image:10_html_12ff08a3df52558c.png||class="img-thumbnail"]]
903
904 When M1 is turned on
905
906 The values from D200 to D203 will be transferred to BFM1 to BFM4 of module #0 (first)
907
908 (% style="text-align:center" %)
909 [[image:10_html_fe06c272cbdd1f7f.png||class="img-thumbnail"]]
910
911 (% style="text-align:center" %)
912 [[image:10_html_adeb00a341e12368.png||class="img-thumbnail"]]
913
914 == {{id name="_Toc9726"/}}**{{id name="_Toc721"/}}{{id name="_Toc151"/}}{{id name="_Toc25394"/}}FROM/Read single word data from the module (16-bit specification)** ==
915
916 **FROM(P)**
917
918 Read (N) word data from the buffer memory specified in (s2) in the module specified in (s1), and store it in the device specified in (d) and later.
919
920 Ladder
921
922 -[FROM (s1) (s2) (d) (N)]
923
924 **Content, range and data type**
925
926 (% class="table-bordered" %)
927 |**Parameter**|(% style="width:473px" %)**Content**|(% style="width:134px" %)**Range**|(% style="width:185px" %)**Data type**|(% style="width:180px" %)**Data type (label)**
928 |(s1)|(% style="width:473px" %)Module number, the first module is 0, the second module is 1, and so on|(% style="width:134px" %)0 to 32767|(% style="width:185px" %)Unsigned BIN 16 bit|(% style="width:180px" %)ANY16
929 |(s2)|(% style="width:473px" %)Start reading from which BFM in the module|(% style="width:134px" %)0 to 32767|(% style="width:185px" %)Unsigned BIN 16 bit|(% style="width:180px" %)ANY16
930 |(d)|(% style="width:473px" %)Start number of the device storing the read data|(% style="width:134px" %)-|(% style="width:185px" %)Signed BIN 16 bit|(% style="width:180px" %)ANY16
931 |(N)|(% style="width:473px" %)Number of read data|(% style="width:134px" %)0 to 512|(% style="width:185px" %)Unsigned BIN 16 bit|(% style="width:180px" %)ANY16
932
933 **Device used**
934
935 (% class="table-bordered" style="width:1098px" %)
936 |=(% rowspan="2" style="width: 76px;" %)**Instruction**|=(% rowspan="2" style="width: 114px;" %)**Parameter**|=(% colspan="10" style="width: 490px;" %)**Devices**|=(% style="width: 218px;" %)(((
937 **Offset modification**
938 )))|=(% style="width: 119px;" %)(((
939 **Pulse extension**
940 )))
941 |=(% style="width: 53px;" %)**KnY**|=(% style="width: 63px;" %)**KnM**|=(% style="width: 49px;" %)**KnS**|=(% style="width: 41px;" %)**T**|=(% style="width: 65px;" %)**C**|=(% style="width: 48px;" %)**D**|=(% style="width: 52px;" %)**R**|=(% style="width: 39px;" %)**SD**|=(% style="width: 48px;" %)**K**|=(% style="width: 34px;" %)**H**|=(% style="width: 218px;" %)**[D]**|=(% style="width: 119px;" %)**XXP**
942 |=(% rowspan="4" style="width: 76px;" %)FROM|(% style="width:114px" %)Parameter 1|(% style="width:53px" %)●|(% style="width:63px" %)●|(% style="width:49px" %)●|(% style="width:41px" %)●|(% style="width:65px" %)●|(% style="width:48px" %)●|(% style="width:52px" %)●|(% style="width:39px" %)●|(% style="width:48px" %)●|(% style="width:34px" %)●|(% style="width:218px" %)●|(% style="width:119px" %)●
943 |(% style="width:114px" %)Parameter 2|(% style="width:53px" %)●|(% style="width:63px" %)●|(% style="width:49px" %)●|(% style="width:41px" %)●|(% style="width:65px" %)●|(% style="width:48px" %)●|(% style="width:52px" %)●|(% style="width:39px" %)●|(% style="width:48px" %)●|(% style="width:34px" %)●|(% style="width:218px" %)●|(% style="width:119px" %)●
944 |(% style="width:114px" %)Parameter 3|(% style="width:53px" %)●|(% style="width:63px" %)●|(% style="width:49px" %)●|(% style="width:41px" %)●|(% style="width:65px" %)●|(% style="width:48px" %)●|(% style="width:52px" %)●|(% style="width:39px" %)●|(% style="width:48px" %) |(% style="width:34px" %) |(% style="width:218px" %)●|(% style="width:119px" %)●
945 |(% style="width:114px" %)Parameter 4|(% style="width:53px" %)●|(% style="width:63px" %)●|(% style="width:49px" %)●|(% style="width:41px" %)●|(% style="width:65px" %)●|(% style="width:48px" %)●|(% style="width:52px" %)●|(% style="width:39px" %)●|(% style="width:48px" %)●|(% style="width:34px" %)●|(% style="width:218px" %)●|(% style="width:119px" %)●
946
947 **Features**
948
949 Read (N) word data from the buffer memory specified in (s2) in the intelligent function module specified in (s1) and store it in the device specified in (d) and later.
950
951 (% style="text-align:center" %)
952 [[image:10_html_1b9d34e74f852368.gif||class="img-thumbnail"]]
953
954 As the following Circuit program
955
956 (% style="text-align:center" %)
957 [[image:10_html_ad9897d46ca8f957.png||class="img-thumbnail"]]
958
959 It means that when M1 is ON, the data in the buffer registers (BFM) #10 and #11 in the special module #0 (the first) will be written into the D200 and D201 registers of the PLC. When M1 is OFF, no operation is performed.
960
961 Currently LX5V PLC supports 16 special expansion modules at the same time.
962
963 The special soft components used are as follows:
964
965 (% class="table-bordered" %)
966 |=(% scope="row" style="width: 163px;" %)**Devices**|=(% style="width: 911px;" %)**Content**
967 |=(% style="width: 163px;" %)SD2081|(% style="width:911px" %)Total number of modules
968 |=(% style="width: 163px;" %)SD2082|(% style="width:911px" %)Number of IO expansion modules
969 |=(% style="width: 163px;" %)SD2083|(% style="width:911px" %)Number of special expansion modules
970 |=(% style="width: 163px;" %)SD2084|(% style="width:911px" %)The first missing expansion module. When the value is -1, it means not lost
971
972 **Error code**
973
974 (% class="table-bordered" %)
975 |=(% scope="row" %)**Error code**|=**Content**
976 |=4085H|(s1) (s2) (N) The read address exceeds the device range
977 |=4086H|(d) The write address exceeds the device range
978 |=4084H|(s1) (s2) is not in the range of 0 to 32767 or (N) is not in the range of 0 to 512
979 |=7080H|Check error when communicating between PLC and module
980 |=7081H|Expansion module communication message is abnormal
981 |=7082H|FROM/TO instruction error
982 |=7083H|The specified extension module was not found
983
984 **Example**
985
986 (% style="text-align:center" %)
987 [[image:10_html_a9071734dc5cfce5.png||class="img-thumbnail"]]
988
989 When M1 is turned on
990
991 The values of BFM3, BFM4, and BFM5 of the #0 (first) module will be transferred to D200, D201, D202
992
993 (% style="text-align:center" %)
994 [[image:10_html_f1df0562ea9002cf.png||class="img-thumbnail"]]
995
996 (% style="text-align:center" %)
997 [[image:10_html_73bb66d1890735ff.png||class="img-thumbnail"]]
998
999 == {{id name="_Toc18124"/}}{{id name="_Toc10981"/}}{{id name="_Toc21090"/}}**DFROM/single word data read from the module (32-bit specification)** ==
1000
1001 **DFROM(P)**
1002
1003 Read (N)*2 words of data from the buffer memory specified in (s2) in the module specified in (s1), and store it in the device specified in (d) and later.
1004
1005 -[DFROM (s1) (s2) (d) (N)]
1006
1007 **Content, range and data type**
1008
1009 (% class="table-bordered" %)
1010 |=(% scope="row" %)**Parameter**|=(% style="width: 473px;" %)**Content**|=(% style="width: 134px;" %)**Range**|=(% style="width: 193px;" %)**Data type**|=(% style="width: 172px;" %)**Data type (label)**
1011 |=(s1)|(% style="width:473px" %)Module number, the first module is 0, the second module is 1, and so on|(% style="width:134px" %)0 to 32767|(% style="width:193px" %)Unsigned BIN 16 bit|(% style="width:172px" %)ANY16
1012 |=(s2)|(% style="width:473px" %)Start reading from which BFM in the module|(% style="width:134px" %)0 to 32767|(% style="width:193px" %)Unsigned BIN 16 bit|(% style="width:172px" %)ANY16
1013 |=(d)|(% style="width:473px" %)Start number of the device storing the read data|(% style="width:134px" %)-|(% style="width:193px" %)Signed BIN 32 bit|(% style="width:172px" %)ANY32
1014 |=(N)|(% style="width:473px" %)Number of read data|(% style="width:134px" %)0 to 256|(% style="width:193px" %)Unsigned BIN 16 bit|(% style="width:172px" %)ANY16
1015
1016 **Device used**
1017
1018 (% class="table-bordered" style="width:1074px" %)
1019 |=(% rowspan="2" %)**Instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="12" %)**Devices**|=(((
1020 **Offset**
1021
1022 **modification**
1023 )))|=(% style="width: 147px;" %)(((
1024 **Pulse**
1025
1026 **extension**
1027 )))
1028 |=**KnY**|=**KnM**|=**KnS**|=**T**|=**C**|=**D**|=**R**|=**SD**|=**LC**|=(% style="width: 40px;" %)**HSC**|=(% style="width: 55px;" %)**K**|=**H**|=**[D]**|=(% style="width: 147px;" %)**XXP**
1029 |=(% rowspan="4" %)DFROM|Parameter 1|●|●|●|●|●|●|●|●| |(% style="width:40px" %) |(% style="width:55px" %)●|●|●|(% style="width:147px" %)●
1030 |Parameter 2|●|●|●|●|●|●|●|●| |(% style="width:40px" %) |(% style="width:55px" %)●|●|●|(% style="width:147px" %)●
1031 |Parameter 3|●|●|●|●|●|●|●|●|●|(% style="width:40px" %)●|(% style="width:55px" %) | |●|(% style="width:147px" %)●
1032 |Parameter 4|●|●|●|●|●|●|●|●| |(% style="width:40px" %) |(% style="width:55px" %)●|●|●|(% style="width:147px" %)●
1033
1034 **Features**
1035
1036 Read (N)×2 words of data from the buffer memory specified in (s2) in the intelligent function module specified in (s1), and store it in the device specified in (d) and later.
1037
1038 (% style="text-align:center" %)
1039 [[image:10_html_ea4017a0483ddbbe.gif||class="img-thumbnail"]]
1040
1041 As the following Circuit program
1042
1043 (% style="text-align:center" %)
1044 [[image:10_html_6d0c9e8bc37fe95.png||class="img-thumbnail"]]
1045
1046 It means that when M1 is ON, the data in the buffer register (BFM) #10 to #13 in the special module #0 (the first) will be written to the D200 to D203 registers of the PLC. When M1 is OFF, no operation is performed.
1047
1048 Currently LX5V PLC supports 16 special expansion modules at the same time.
1049
1050 The special soft components used are as follows:
1051
1052 (% class="table-bordered" %)
1053 |=(% scope="row" %)**Devices**|=**Content**
1054 |=SD2081|Total number of modules
1055 |=SD2082|Number of IO expansion modules
1056 |=SD2083|Number of special expansion modules
1057 |=SD2084|The first missing expansion module. When the value is -1, it means not lost
1058
1059 **Error code**
1060
1061 (% class="table-bordered" %)
1062 |=(% scope="row" style="width: 140px;" %)**Error code**|=(% style="width: 934px;" %)**Content**
1063 |=(% style="width: 140px;" %)4085H|(% style="width:934px" %)(s1) (s2) (N) The read address exceeds the device range
1064 |=(% style="width: 140px;" %)4086H|(% style="width:934px" %)(d) The write address exceeds the device range
1065 |=(% style="width: 140px;" %)4084H|(% style="width:934px" %)(s1) (s2) is not in the range of 0 to 32767 or (N) is not in the range of 0 to 256
1066 |=(% style="width: 140px;" %)7080H|(% style="width:934px" %)Check error when communicating between PLC and module
1067 |=(% style="width: 140px;" %)7081H|(% style="width:934px" %)Expansion module communication message is abnormal
1068 |=(% style="width: 140px;" %)7082H|(% style="width:934px" %)FROM/TO instruction error
1069 |=(% style="width: 140px;" %)7083H|(% style="width:934px" %)The specified extension module was not found
1070
1071 **Example**
1072
1073 (% style="text-align:center" %)
1074 [[image:10_html_7389fb305b495d09.png||class="img-thumbnail"]]
1075
1076 When M1 is turned on
1077
1078 The value of BFM3 to BFM8 of module #0 (first) will be transferred to D200 to D205
1079
1080 (% style="text-align:center" %)
1081 [[image:10_html_2f6f4ddff10c30ec.png||class="img-thumbnail"]]
1082
1083 (% style="text-align:center" %)
1084 [[image:10_html_8a1de3e41b64afe1.png||class="img-thumbnail"]]
1085
1086 = {{id name="_Toc28953"/}}**{{id name="_Toc13721"/}}{{id name="_Toc14994"/}}{{id name="_Toc4655"/}}RS and RS2 instructions corresponding protocol description** =
1087
1088 == {{id name="_10.7.1 Custom protocol description"/}}**{{id name="_Toc19972"/}}{{id name="_Toc7163"/}}{{id name="_Toc25715"/}}{{id name="_Toc23891"/}}{{id name="_Toc21391"/}}{{id name="_自定义协议说明"/}}Custom protocol description** ==
1089
1090 **{{id name="_Toc28071132"/}}Introduction**
1091
1092 The function of custom protocol is that it can directly transmit data with the device without any processing or communicate with other devices with the corresponding protocol set by the customer.
1093
1094 At present, the custom protocol of 5V PLC is configured and sent by COM2, and the instruction used is RS instruction, and it need to configure the protocol and serial port parameters through the Devices.
1095
1096 The current custom protocol is generally close to 3V series.
1097
1098 **{{id name="_Toc28071133"/}}Basic configuration**
1099
1100 **(1) Instructions**
1101
1102 The RS instruction itself has the same usage as the previous RS instruction at 3V, and it can use R device.
1103
1104 -[RS (s) (m) (d) (N)]
1105
1106 **Content, range and data type**
1107
1108 (% class="table-bordered" %)
1109 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1110 |(s)|The start address of the register area where the data to be sent is stored|-|Unsigned BIN 16 bit|ANY16
1111 |(m)|Is the length of the data to be sent (number of bytes)|0 to 528|Unsigned BIN 16 bit|ANY16
1112 |(d)|Start number of the device storing the written data|-|Unsigned BIN 16 bit|ANY16
1113 |(N)|Number of data written|0 to 528|Unsigned BIN 16 bit|ANY16
1114
1115 **{{id name="_Toc20319"/}}Device used**
1116
1117 (% class="table-bordered" %)
1118 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" %)**Devices**|**Offset modification**|(((
1119 **Pulse**
1120
1121 **extension**
1122 )))
1123 |**T**|**C**|**D**|**R**|**K**|**H**|**[D]**|**XXP**
1124 |(% rowspan="4" %)RS|Parameter 1|●|●|●|●|●|●| |
1125 |Parameter 2|●|●|●|●|●|●| |
1126 |Parameter 3|●|●|●|●|●|●| |
1127 |Parameter 4|●|●|●|●|●|●| |
1128
1129 **✎Note: **Although the RS instruction currently allows all the parameters of the instruction to use constants such as K and H, there are different restrictions according to the different protocol. When the protocol is a custom protocol, S and D cannot be constants, otherwise it will report an error.
1130
1131 **{{id name="_Toc28071135"/}}(2) Special device settings**
1132
1133 Special address table
1134
1135 (% class="table-bordered" %)
1136 |(% colspan="2" %)**COM2 special D device (SD)**|(% colspan="2" %)**COM2 special M Device (SM)**
1137 |2590|__**Communication port setting**__|2590|__**Send control on**__
1138 |2591|__**Serial parameter modification identification**__|2591|__**Send control/send reminder**__
1139 |2592|Protocol settings|2592|__**Receive control on**__
1140 |2593|Protocol modification logo|2593|__**Accept control/receive prompt**__
1141 |2594|Station number setting|2594|__**8-bit mode (for custom protocol)**__
1142 |2595|Station number modification logo|2595|
1143 |2596|(((
1144 __**Sending interval (0.1ms) 0-32767**__
1145
1146 __**It is 10 (1ms) when set to 0**__
1147 )))|2596|
1148 |2597|(((
1149 __**Communication timeout setting (10ms) 0-32767**__
1150
1151 __**It is 10(100ms) when set to 0**__
1152 )))|2597|
1153 |2598|__**Timeout retry times 0-32767**__|2598|
1154 |2599|(((
1155 __**Character interval timeout setting (for custom protocol) (0.1ms)**__
1156
1157 __**0-32767 . It is 10 (1ms) when set to 0**__
1158 )))|2599|
1159 |2600|__**STX value**__|2600|
1160 |2601|__**ETX value**__|2601|
1161 |...| |...|
1162 |2610|**The amount of data received**|2610|**Communication complete flag**
1163 |2611|**Last error**|2611|**Receiving flag**
1164 |2612|**Current error**|2612|**Retry occurred**
1165 |2613|**Error steps**|2613|**Communication error**
1166 |2614|**Error station number**|2614|**Communication timeout**
1167 |2615|**Cumulative number of errors**|2615|
1168
1169 The contents that the custom protocol will be used and set has been marked with underline and bold.
1170
1171 In addition, the devices to be used as judgment conditions have also been marked in bold in the table.
1172
1173 **✎Note: **COM1 currently does not support custom protocols.
1174
1175 **{{id name="_Toc28071136"/}}1) Communication port setting SD2590**
1176
1177 (% class="table-bordered" %)
1178 |(% colspan="2" %)**Bit number**|**B0**|**B1、B2**|**B3**|(((
1179 **B4、B5、B6、**
1180
1181 **B7、B8、B9**
1182 )))|**B10**|**B11**
1183 |(% colspan="2" %)**Name**|**Data length**|**Parity**|**Stop Bit**|**Baud rate(bps)**|**STX**|**ETX**
1184 |(% rowspan="2" %)**Content**|**0 off**|7 bit|(% rowspan="2" %)(((
1185 b2,b1
1186
1187 (0,0): None
1188
1189 (0,1): Odd parity (ODD)
1190
1191 (1,1): Even parity (EVEN)
1192 )))|1 bit|(% rowspan="2" %)(((
1193 |4800|0111
1194 |9600|1000
1195 |19200|1001
1196 |38400|1010
1197 |57600|1011
1198 |115200|1100
1199 |187500|1101
1200 |230400|1110
1201 |460800|1111
1202 |921600|10000
1203 )))|None|None
1204 |**1 on**|8 bit|2 bit|Turn on ETX, the ETX value is set in SD2600|Turn on ETX, the ETX value is set in SD2601
1205
1206 Set the serial port parameters to SD2590 according to the bit settings provided in the table above. The setting is roughly the same as 3V. It is mainly because the baud rate can be set to a higher baud rate, the bit used need backward two bits when STX and ETX start.
1207
1208 For example: To set the serial port parameters: baud rate 115200, stop bit 1, data bit 8, no parity bit, turn on STX, you need to set the value H4C1 (K1217) on SD2590. The parameters directly set to SD2590 are only valid in the first cycle of PLC RUN.
1209
1210 If you need to modify it during RUN, you can use the PORTPARAM instruction to set it.
1211
1212 **{{id name="_Toc28071137"/}}2) Protocol setting SD2592**
1213
1214 (% class="table-bordered" %)
1215 |(% colspan="2" %)**Protocol settings**|(% colspan="2" %)**Protocol settings**
1216 |0 H|Wecon Modbus slave station|10 H|Cunstom protocol
1217 |2 H|ModbusRTU slave station|20 H|ModbusRTU master station
1218 |3 H|ModbusASCII slave station|30 H|ModbusASCII master station
1219
1220 The corresponding protocol can be set by setting the corresponding value in SD2592.
1221
1222 The parameters directly set to SD2592 are only valid in the first cycle of PLC RUN.
1223
1224 If you need to modify it during RUN, you can use the PROTOCOL instruction to set it.
1225
1226 **{{id name="_Toc28071138"/}}3) Sending interval SD2596**
1227
1228 The main function of sending interval is: how long to wait for sending the next instruction after one instruction is completed. If the value is set to 0, there is basically no waiting for sending interval, but it will be affected by the scan cycle.
1229
1230 The unit of the sending interval is 0.1ms, that is, the interval time is 10ms when the setting is 100.
1231
1232 **{{id name="_Toc28071139"/}}4) Communication timeout SD2597 and timeout retry SD2598**
1233
1234 (% style="text-align:center" %)
1235 [[image:10_html_53f716718aad2197.png||class="img-thumbnail"]]
1236
1237 The main function of communication timeout is: How long does it take to wait for no data to be received after the PLC sends retry or occurs an error. When 0 is set, the default is 100ms.
1238
1239 The unit of communication timeout is 10ms, that is, the timeout judgment time is 10ms when the setting is 100.
1240
1241 When a receiving timeout occurs, it will determine whether there are retry times and the current retry times. If the retry times are greater than or equal to SD2598, an error will be reported.
1242
1243 If SD2598 is set to 0, it will not try again.
1244
1245 If it is set to 1, send once again after sending a timeout.
1246
1247 **{{id name="_Toc28071140"/}}5) Character interval timeout SD2599**
1248
1249 Currently this setting is only available for custom protocols.
1250
1251 The main function of the character interval timeout is: after receiving at least one character before the communication timeout, judge whether the interval time between the following two characters has exceeded. if it is, report an error and end the communication.
1252
1253 (% style="text-align:center" %)
1254 [[image:10_html_3725d523c70bd43d.png||class="img-thumbnail"]]
1255
1256 This setting is mainly designed considering that some devices may send slow or have other specific sending requirements.
1257
1258 {{id name="_Toc28071141"/}}The character interval timeout will not retry.
1259
1260 **(3) Serial port parameter setting instructions**
1261
1262 **1) Host computer interface settings**
1263
1264 (% style="text-align:center" %)
1265 [[image:10_html_3f08ef293fcbfcf1.png||class="img-thumbnail"]]
1266
1267 Through the PLC parameter setting in the upper computer interface, If protocol is set to none, it is a custom protocol.
1268
1269 The serial port parameter content mainly sets the serial port parameters such as baud rate and data bit.
1270
1271 After the start character is enabled, the start/end character can be sent. The start/end character will also be distinguished when receiving. See the description in the sending and receiving process for details.
1272
1273 **✎Note: **The characters here are decimal values.
1274
1275 **{{id name="_Toc28071142"/}}2) PORTPARA instruction**
1276
1277 -[PORTPARA (s) (N)]
1278
1279 **Content, range and data type**
1280
1281 (% class="table-bordered" %)
1282 |**Parameter**|**Content**|**Range**|**Data type**|(((
1283 **Data type**
1284
1285 **(label)**
1286 )))
1287 |(s)|Serial port parameters to be set|0 to 256|Unsigned BIN 16 bit|ANY16
1288 |(N)|Which communication port to set (0 means COM1, 1 means COM2)|0, 1|Unsigned BIN 16 bit|ANY16
1289
1290 **{{id name="_Toc23976"/}}Device used**
1291
1292 (% class="table-bordered" %)
1293 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|(((
1294 **Pulse**
1295
1296 **extension**
1297 )))
1298 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
1299 |(% rowspan="2" %)PROTPARA|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
1300 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
1301
1302 Function: To set communication parameters when running.
1303
1304 Please refer to "PORTPARA instruction description" for details.
1305
1306 **{{id name="_Toc28071143"/}}3) PROTOCOL instruction**
1307
1308 -[PROTOCOL (s) (N)]
1309
1310 **Content, range and data type**
1311
1312 (% class="table-bordered" %)
1313 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1314 |(s)|Protocol number to be set|0 to 65535|Unsigned BIN 16 bit|ANY16
1315 |(N)|Which communication port to set (0 means COM1, 1 means COM2 *1)|1|Unsigned BIN 16 bit|ANY16
1316
1317 **{{id name="_Toc1191"/}}Device used**
1318
1319 (% class="table-bordered" %)
1320 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|(((
1321 **Offset**
1322
1323 **modification**
1324 )))|(((
1325 **Pulse**
1326
1327 **extension**
1328 )))
1329 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
1330 |(% rowspan="2" %)PORTOCOL|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|
1331 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|
1332
1333 **Features:**
1334
1335 It is used to set the communication protocol when running. The above instruction actually sets a specific value for the parameter modification flag. The specific calculation formula is: (parameter setting value + the offset of the start special device corresponding to the serial port + 10)*2
1336
1337 For example, setting the protocol to Modbusrtu master station (H20) is (0x20 +2593-2590 +10)*2, that is (32 +3+10) *2=90. This is to prevent the serial port parameters from being modified at will.
1338
1339 The trigger of setting parameters in custom protocol will not change the value until an instruction is completed.
1340
1341 The trigger of setting parameters in Modbus master station protocol won’t change the value until an instruction is completed.
1342
1343 The trigger of setting parameters in the Modbus slave protocol can be switched as long as it is not processing the received data. Please refer to "PROTOCOL instruction description" for details.
1344
1345 **4) Priority description of serial port parameters**
1346
1347 The priority of serial port parameter settings are listed as blow. The serial port parameters are saved by power failure currently.
1348
1349 Serial port parameter set instruction setting = Ladder program MOV instruction set the corresponding SD device > the download parameters of host computer > Previous power-off save data.
1350
1351 **(4) Ladder program**
1352
1353 (% style="text-align:center" %)
1354 [[image:10_html_487e57593173359e.png||class="img-thumbnail"]]
1355
1356 (((
1357 * Set serial port parameters:
1358 * Baud rate 112500, stop bit 1, data bit 8, no parity bit none
1359 * Set protocol to custom protocol
1360 * Sending interval: 5ms
1361 * Receiving timeout: 100ms
1362 * Number of repetitions: 3 times
1363 * Characters interval timeout: 30ms
1364 * Custom protocol sending start address D200, sending length 8.
1365 * Receiving start address D300, receiving length 6
1366 * Send directly after trigger
1367 * After receiving is completed, close the instruction directly and reset the instruction receiving flag
1368 )))
1369
1370 **{{id name="_Toc28071145"/}}Sending and receiving process**
1371
1372 **{{id name="_Toc28071146"/}}(1) Sending and receiving mechanism**
1373
1374 **1) **{{id name="_Toc28071147"/}}**No start character (STX) and end character (ETX)**
1375
1376 ①16-bit (SM2594 is OFF)
1377
1378 The devices will be divided into high and low directly, and send data from the low address first and then the high address in order.
1379
1380 (% style="text-align:center" %)
1381 [[image:10_html_5891dcc3161d6651.png||class="img-thumbnail"]]
1382
1383 (% style="text-align:center" %)
1384 [[image:image-20220926145824-1.jpeg||height="430" width="607"]]
1385
1386 ②8-bit (SM2594 is ON)
1387
1388 Get the value of the low address of device directly and send it
1389
1390 (% style="text-align:center" %)
1391 [[image:10_html_1d76c606ba1b2ba8.png||class="img-thumbnail"]]
1392
1393 (% style="text-align:center" %)
1394 [[image:10_html_a46b2be94cb51e78.png||class="img-thumbnail"]]
1395
1396 The data sent in the case of the ladder program and the data above should be 70 E1 31 62 6C.
1397
1398 (% style="text-align:center" %)
1399 [[image:10_html_1920f501fdbca9b8.png||class="img-thumbnail"]]
1400
1401 Receiving will also be stored in the lower address
1402
1403 **{{id name="_Toc28071148"/}}2) Open and set the start character STX**
1404
1405 The value of the start character SD2600 is only valid in the low bit
1406
1407 When STX is enabled, the send will start with STX. When receiving, the send will start with STX, but STX will not be displayed.
1408
1409 If it receives the STX during the receiving, the receiving will restart.
1410
1411 If the first character is not received, the timeout period is judged by the first character timeout. When a character is received, no matter what data is received, the inter-character timeout will be counted from the last character received.
1412
1413 (% style="text-align:center" %)
1414 [[image:10_html_bd054fd74ccaddc.png||class="img-thumbnail"]]
1415
1416 (% style="text-align:center" %)
1417 [[image:10_html_a46b2be94cb51e78.png||class="img-thumbnail"]]
1418
1419 For example, the result of the above ladder program and the above data sending is FE 70 7D E1 00 31.
1420
1421 Sending FE 51 26 34 15 to the PLC at this time will receive the following data. And if you send FE 25 63 FE 51 26 34 15 you will also receive the following data.
1422
1423 (% style="text-align:center" %)
1424 [[image:10_html_f2dbc2f6fb276e3f.png||class="img-thumbnail"]]
1425
1426 **{{id name="_Toc28071149"/}}3) Open and set the end character ETX situation**
1427
1428 The value of ending character SD2601 is only valid in the low bit.
1429
1430 When ETX is enabled, the send will end with ETX.
1431
1432 When ETX is received, SM2610 and SM2593 are immediately turned ON, regardless of whether sufficient length is received.
1433
1434 (% style="text-align:center" %)
1435 [[image:10_html_17fa71d20bec1531.png||class="img-thumbnail"]]
1436
1437 (% style="text-align:center" %)
1438 [[image:10_html_a46b2be94cb51e78.png||class="img-thumbnail"]]
1439
1440 For example, the result of the above Circuit program and the above data transmission is 70 7D E1 00 31 FD.
1441
1442 If the above Circuit program sends 01 06 FD to him, the following data will be received. If the FD is sent directly, it will be judged as the end directly.
1443
1444 (% style="text-align:center" %)
1445 [[image:10_html_72c7fdeee574504.png||class="img-thumbnail"]]
1446
1447 **{{id name="_Toc28071150"/}}4) Both the start character STX and the end character ETX are turned on**
1448
1449 When both are opened, it is basically a combination of the above single opened states. But if only ETX data is received when both start, it will not end immediately. It will judge the character interval time and does not start receiving data.
1450
1451 **{{id name="_Toc28071151"/}}(2) Receiving after sending (similar to Modbus master station mechanism)**
1452
1453 **{{id name="_Toc28071152"/}}1) Send control switch (SM2590) and receive control switch (SM2592) OFF (default)**
1454
1455 When the contact of RS instruction is on, turn SM2591 on and send it immediately. SM2591 will be automatically OFF immediately after sending.
1456
1457 After sending, SM2593 is ON, it will always stop at this instruction, and wait for it to be OFF and then receive data. If it is OFF, it will start to receive data.
1458
1459 After the first character timeout period (SD2597), if no character is received, it is judged as a timeout. If there are retry times, it will retry. But after retrying, the communication still does not report an error, and SM2593 and SM2614 are turned on.
1460
1461 After receiving the first character, it will judge whether that the interval between characters exceeds the time set by SD2599. If it it doesn’t. it will report an error.(For the details, please refer to [the timeout of the interval character].)
1462
1463 When there are two or more instructions, the first RS instruction which is set ON will be sent after SM2591 is ON. Later, if this RS instruction is completed*1, then turn ON, SM2591 will switch to the next RS instruction*2 in the ladder sequence.
1464
1465 When there are two or more instructions, switch to another one during the data reception and it continue to stay back in the original instruction to until the reception is complete.
1466
1467 **✎Note:**
1468
1469 **✎**Completion refers to receiving data or reporting an error.
1470
1471 **✎**If there is no other open RS instruction after the ladder sequence, it will return to the first RS instruction that was opened in the ladder sequence for execution.
1472
1473 **{{id name="_Toc28071153"/}}2) The sending way when the sending control switch (SM2590) is ON**
1474
1475 When the sending control switch (SM2590) is ON, there is no need to set SM2591 ON. At this time, as long as the contact of the RS instruction is triggered, it can be sent, and SM2591 is automatically turned ON.
1476
1477 **{{id name="_Toc28071154"/}}3) The receiving way when the receiving control switch (SM2592) is ON**
1478
1479 When the receiving control switch (SM2592) is ON, SM2593 will be OFF automatically when the instruction is executed. It will no longer judge the status of SM2593 when receiving, and SM2593 will still be turned ON after receiving.
1480
1481 **{{id name="_Toc28071155"/}}4) Sending control switch (SM2590) and receiving control switch (SM2592) ON**
1482
1483 In this case, you only need to trigger the contact before the RS instruction to send data, then it will automatically switch to the waiting status. When the reception is completed, it will turn to the next RS instruction that is turned on.
1484
1485 **{{id name="_Toc28071156"/}}(3) Send-only**
1486
1487 (% style="text-align:center" %)
1488 [[image:10_html_ee6092e0d3a61be2.png||class="img-thumbnail"]]
1489
1490 When the sending length is set to a value other than 0, and the receiving length is set to 0, it is send-only mode.
1491
1492 **{{id name="_Toc28071157"/}}1) The sending control switch (SM2590) is OFF**
1493
1494 When SM2591 is turned ON, the data will be sent without receiving.
1495
1496 When there are two or more instructions, the first RS instruction which is turned ON will be sent after SM2591 is turned ON. After this RS instruction is completed, then turn ON SM2591 will switch to the next RS instruction in the ladder program.
1497
1498 **{{id name="_Toc28071158"/}}2) The Sending control switch (SM2590) is ON**
1499
1500 The RS instruction will be sent when triggered. Multiple instructions are triggered and sent in a loop. During the sending cycle, the interval will be sent according to the set sending interval.
1501
1502 **{{id name="_Toc28071159"/}}(4) Receive-only**
1503
1504 (% style="text-align:center" %)
1505 [[image:10_html_46075eaee9d78457.png||class="img-thumbnail"]]
1506
1507 When the sending length is 0 and the receiving length is not 0, it is only receiving.
1508
1509 **{{id name="_Toc28071160"/}}1) SM2592 receiving control switch OFF**
1510
1511 SM2593 will be turned ON when receiving, and the ladder program control must be turned OFF to continue receiving. SM2593 will not turn ON without receiving data.
1512
1513 When multiple instructions are enabled to receive only at the same time, it will start to receive from the smallest number of steps in the ladder diagram. Time out or received data will be forwarded to the second to continue receiving.
1514
1515 **{{id name="_Toc28071161"/}}2) SM2592 receiving control switch ON**
1516
1517 It can receive normally and will not be controlled by the flag bit. The SM2593 receiving identifier serves as the receiving prompt identifier,and SM2593 will not turn ON without receiving data.
1518
1519 If multiple RS receive only instructions are turned on at the same time, the receiving position is uncertain due to the timeout judgment and switching to the next one.
1520
1521 **{{id name="_Toc28071162"/}}(5) Use receive-only and send-only methods to send after receiving (similar to Modbus slave mechanism)**
1522
1523 (% style="text-align:center" %)
1524 [[image:10_html_a70fbc189fa39660.png||class="img-thumbnail"]]
1525
1526 (((
1527 Receive-only: When it is determined that the reception is complete, it will determine the instruction to be triggered according to the received content, and save the received data at the same time.
1528
1529 Send-only: The content sent by triggered M2 is different from that of triggered M3. After the trigger is over, they will return to trigger the receive-only of M1.
1530 )))
1531
1532 **{{id name="_Toc28071163"/}}10.7.1.4 Error message**
1533
1534 Currently The Error code will be displayed on SD7, SD0, SD 2611 and SD2612.
1535
1536 The Error codes that will appear in the custom protocol are mainly as follows.
1537
1538 (% class="table-bordered" %)
1539 |(% style="width:106px" %)**Error code**|(% style="width:975px" %)**Content**
1540 |(% style="width:106px" %)3181H|(% style="width:975px" %)Data receiving timeout
1541 |(% style="width:106px" %)3188H|(% style="width:975px" %)Wrong length
1542 |(% style="width:106px" %)3189H|(% style="width:975px" %)COM2 data error. "Check whether there are errors in the parameters of instruction. Check whether the slave station supports the setting of this value. (Please refer to Modbus exception 03)"
1543 |(% style="width:106px" %)318EH|(% style="width:975px" %)(((
1544 Current protocol does not support this instruction
1545
1546 (This error is only displayed on SD7 and SD0)
1547 )))
1548 |(% style="width:106px" %)318FH|(% style="width:975px" %)COM2 sending timed out. Contact a technician if this error occurs
1549 |(% style="width:106px" %)3190H|(% style="width:975px" %)COM2 receiving data exceeds the buffer limit.
1550
1551 After resetting the protocol or communication parameters, the error will be cleared.
1552
1553 In addition, the communication completion/communication error/communication timeout flag will be set after the executed instruction.
1554
1555 **10.7.1.5 The difference with Mitsubishi**
1556
1557 The current differences:
1558
1559 1. STX and ETX: Mitsubishi can set up to 4 bytes, we only have one byte.
1560 1. Add sum check and CR, LF.
1561 1. The instruction control of Mitsubishi is that the first instruction triggered is fixed to execute this instruction. It will not be switched to other instructions midway, unless the contact of this instruction is closed.
1562
1563 == **Modbus protocol description** ==
1564
1565 **Introduction**
1566
1567 The Modbus master station protocol is generally close to LX3V. The address was modified in the slave station.
1568
1569 **Basic configuration**
1570
1571 **(1) Introduction**
1572
1573 The RS instruction has the same usage as the previous RS instruction of 3V, and can use R device.
1574
1575 -[RS (s) (m) (d) (N)]
1576
1577 **Content, range and data type**
1578
1579 (% class="table-bordered" %)
1580 |**Parameter**|(% style="width:589px" %)**Content**|(% style="width:119px" %)**Range**|(% style="width:168px" %)**Data type**|(% style="width:113px" %)**Data type (label)**
1581 |(s)|(% style="width:589px" %)The high byte stores the station number of slave station, and the low byte stores the Modbus function code.|(% style="width:119px" %)-|(% style="width:168px" %)Unsigned BIN 16 bit|(% style="width:113px" %)ANY16
1582 |(m)|(% style="width:589px" %)Slave address. The address provided by slave station will read or write data from this address of the slave station|(% style="width:119px" %)-|(% style="width:168px" %)Unsigned BIN 16 bit|(% style="width:113px" %)ANY16
1583 |(d)|(% style="width:589px" %)Length. The length of Modbus read or write. The unit is determined by function code.|(% style="width:119px" %)-|(% style="width:168px" %)Unsigned BIN 16 bit|(% style="width:113px" %)ANY16
1584 |(N)|(% style="width:589px" %)Start address for reading or writing data|(% style="width:119px" %)-|(% style="width:168px" %)Unsigned BIN 16 bit|(% style="width:113px" %)ANY16
1585
1586 **{{id name="_Toc20576"/}}Device used**
1587
1588 (% class="table-bordered" style="width:1058px" %)
1589 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" style="width:348px" %)**Devices**|(% style="width:226px" %)**Offset modification**|(((
1590 **Pulse**
1591
1592 **extension**
1593 )))
1594 |**T**|**C**|**D**|**R**|**K**|(% style="width:96px" %)**H**|(% style="width:226px" %)**[D]**|**XXP**
1595 |(% rowspan="4" %)RS|Parameter 1|●|●|●|●|●|(% style="width:96px" %)●|(% style="width:226px" %) |
1596 |Parameter 2|●|●|●|●|●|(% style="width:96px" %)●|(% style="width:226px" %) |
1597 |Parameter 3|●|●|●|●|●|(% style="width:96px" %)●|(% style="width:226px" %) |
1598 |Parameter 4|●|●|●|●| |(% style="width:96px" %) |(% style="width:226px" %) |
1599
1600 **✎Note: **Although the RS instruction currently allows all the parameters of the instruction to use constants such as K and H, there are different restrictions according to the different protocols. When the protocol is Modbus master station protocol, n cannot be a constant, otherwise an error will be reported.
1601
1602 **{{id name="_Toc33979607"/}}(2) Special device setting**
1603
1604 Special address table
1605
1606 (% class="table-bordered" %)
1607 |(% colspan="2" %)**COM 1 special D device (SD)**
1608 |2540|__**Communication port settings**__
1609 |2541|__**Serial parameter modification identification**__
1610 |2542|
1611 |2543|
1612 |2544|__**Station number setting**__
1613 |2545|__**Station number modification logo**__
1614
1615 **✎Note: **COM1 does not support modifying the protocol.
1616
1617 (% class="table-bordered" %)
1618 |(% colspan="2" %)**COM2 special D device (SD)**|(% colspan="2" %)**COM2 special M Device (SM)**
1619 |2590|__**Communication port setting**__|2590|Send control start
1620 |2591|__**Serial parameter modification identifier**__|2591|**Send control/send reminder**
1621 |2592|__**Protocol setting**__|2592|Receive control start
1622 |2593|__**Protocol modification identifier**__|2593|**Receive control/receive prompt**
1623 |2594|__**Station number setting**__|2594|8-bit mode (for custom protocol)
1624 |2595|__**Station number modification identifier**__|2595|
1625 |2596|(((
1626 __**Sending interval (0.1ms) 0-32767.**__
1627
1628 __**It is 10 when set to 0 (1ms)**__
1629 )))|2596|
1630 |2597|(((
1631 __**Communication timeout setting (10ms) 0-32767**__
1632
1633 __**It is 10 when set to 0 (100ms)**__
1634 )))|2597|
1635 |2598|__**Timeout retry times 0-32767**__|2598|
1636 |2599|Character interval timeout setting (for custom protocol) (0.1ms) 0-32767. It is 10 when set to 0 (1ms)|2599|
1637 |2600|STX value|2600|
1638 |2601|ETX value|2601|
1639 |...| |...|
1640 |2610|**The amount of data received**|2610|**Communication complete flag**
1641 |2611|**Last error**|2611|**Receiving flag**
1642 |2612|**Current error**|2612|**Retry occurred**
1643 |2613|**Error steps**|2613|**Communication error**
1644 |2614|**Error station number**|2614|**Communication timeout**
1645 |2615|**Cumulative number of errors**|2615|
1646
1647 {{id name="_Toc33979608"/}}The contents that the custom protocol will be used and set has been marked with underline and bold. In addition, the devices to be used as judgment conditions have also been marked in bold in the table.
1648
1649 **1) Communication port setting SD2590**
1650
1651 (% class="table-bordered" %)
1652 |(% colspan="2" %)**Bit number**|**B0**|**B1、B2**|**B3**|**B4、B5、B6、B7、B8、B9**
1653 |(% colspan="2" %)**Name**|**Data length**|**Parity**|**Stop Bit**|**Baud rate(bps)**
1654 |(% rowspan="2" %)**Content**|**0 off**|7 bit|(% rowspan="2" %)(((
1655 b2,b1
1656
1657 (0,0): None
1658
1659 (0,1): Odd parity (ODD)
1660
1661 (1,1): Even parity (EVEN)
1662 )))|1 bit|(% rowspan="2" %)(((
1663 |4800|0111
1664 |9600|1000
1665 |19200|1001
1666 |38400|1010
1667 |57600|1011
1668 |115200|1100
1669 |187500|1101
1670 |230400|1110
1671 |460800|1111
1672 |921600|10000
1673 )))
1674 |**1 on**|8 bit|2 bit
1675
1676 Set the serial port parameters to SD2590 according to the bit settings provided in the table above. The setting is roughly the same as 3V. It is mainly because the baud rate can be set to a higher baud rate, the bit used need backward two bits when STX and ETX start.
1677
1678 {{id name="_Toc33979609"/}}For example: To set the serial port parameters: baud rate 115200, stop bit 1, data bit 8, no parity bit, you need to set the value H4C1 (K1217) on SD2590. The parameters directly set to SD2590 are only valid in the first cycle of PLC RUN. If you need to modify it during RUN, you can use the PORTPARAM instruction to set it.
1679
1680 **2) Protocol setting SD2592**
1681
1682 (% class="table-bordered" %)
1683 |(% colspan="4" %)**Protocol settings**
1684 |0 H|Wecon Modbus slave station|10 H|Custom protocol
1685 |2 H|ModbusRTU slave station|20 H|ModbusRTU master station
1686 |3 H|ModbusASCII slave station|30 H|ModbusASCII master station
1687
1688 The corresponding protocol can be set by setting the corresponding value in SD2592. The parameters directly set to SD2592 are only valid in the first cycle of PLC RUN. If you need to modify it during RUN, you can use the PROTOCOL instruction to set it. COM1 cannot use protocols other than Wecon Modbus slave station Currently.
1689
1690 **{{id name="_Toc33979610"/}}3) Sending interval SD2596**
1691
1692 The main function of sending interval is: how long to wait for sending the next instruction after one instruction is completed. If it is set to 0, there is basically no waiting for interval sending, but it will be affected by the scan cycle. The unit of the sending interval is 0.1ms, that is, the interval is 10ms when set to 100.
1693
1694 **{{id name="_Toc33979611"/}}4) Communication timeout SD2597 and timeout retry SD2598**
1695
1696 (% style="text-align:center" %)
1697 [[image:10_html_8c204d3cecb508d7.png||class="img-thumbnail"]]
1698
1699 The main function of communication timeout is: How long does it take to wait for no data to be received and then retry or report an error after the PLC sends. When it is set to 0, the default value is 100ms.
1700
1701 The unit of communication timeout is 10ms, that is, the timeout determine time is 100ms when set to 10.
1702
1703 When a receiving timeout occurs, it will determine whether there are retry times and the current retry times. If the retry times are greater than or equal to SD2598, an error will be reported.
1704
1705 If SD2598 is set to 0, it will not retry.
1706
1707 If it is set to 1, send once and then send once again after timeout.
1708
1709 (% class="wikigeneratedid" id="HSerialportparametersetting" %)
1710 **Serial port parameter setting**
1711
1712 (% class="wikigeneratedid" id="HPORTPARAinstruction" %)
1713 **PORTPARA instruction**
1714
1715 -[PORTPARA (s) (N)]
1716
1717 **Content, range and data type**
1718
1719 (% class="table-bordered" %)
1720 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1721 |(s1)|The start number of the device that stores the number of digits of converted value|-|Signed BIN 16 bit|ANY16_S_ARRAY
1722 |(s2)|Converted BIN data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S
1723
1724 **{{id name="_Toc3250"/}}Device used**
1725
1726 (% class="table-bordered" %)
1727 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|(((
1728 **Offset**
1729
1730 **modification**
1731 )))|(((
1732 **Pulse**
1733
1734 **extension**
1735 )))
1736 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
1737 |(% rowspan="2" %)PORTPARA|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
1738 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
1739
1740 **Features**
1741
1742 Set communication parameters when used for run. Please refer to "__[[PORTPARA instruction description>>path:#_PORTPARA/MODBUS serial port parameter setting]]__" for details**.**
1743
1744 **PROTOCOL instruction**
1745
1746 -[PROTOCOL (s) (N)]
1747
1748 **Content, range and data type**
1749
1750 (% class="table-bordered" %)
1751 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1752 |(s)|Protocol number to be set|0 to 65535|Unsigned BIN 16 bit|ANY16
1753 |(N)|Which communication port to set (0 means COM1, 1 means COM2 *1)|1|Unsigned BIN 16 bit|ANY16
1754
1755 **Device used**
1756
1757 (% class="table-bordered" %)
1758 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|(((
1759 **Pulse**
1760
1761 **extension**
1762 )))
1763 |**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|(% style="width:33px" %)**H**|**[D]**|**XXP**
1764 |(% rowspan="2" %)PROTOCOL|Parameter 1|●|●|●|●|●|●|●|●|●|(% style="width:33px" %)●|●|●
1765 |Parameter 2|●|●|●|●|●|●|●|●|●|(% style="width:33px" %)●|●|●
1766
1767 **{{id name="_Toc13079"/}}Features**
1768
1769 Set the communication protocol when used for run. The instruction above actually is to set a specific value for the parameter modification flag.
1770
1771 The calculation formula is: (parameter setting value + the offset of the start special device corresponding to the serial port + 10)*2
1772
1773 For example, setting the protocol to ModbusRTU master station (H20) is (0x20 +2593-2590 +10)*2, which is (32 +3+10) *2=90. This is to prevent the serial port parameters from being modified at will. .
1774
1775 In Modbus master protocol, the trigger of setting parameters is to change the value after an instruction is completed.
1776
1777 In Modbus slave protocol, the trigger of setting parameters is that to switch as long as it is not processing the received data.
1778
1779 For details, please refer to "PROTOCOL instruction description"
1780
1781 **3) Host computer settings**
1782
1783 The PLC parameter setting of host computer can set the corresponding serial port parameters.
1784
1785 (% style="text-align:center" %)
1786 [[image:10_html_4208a2ce93bb23e7.png||class="img-thumbnail"]]
1787
1788 Specialized protocol station number cannot be 0.
1789
1790 The station number under ModbusRTU and ModbusASCII protocol is 0: the protocol sets the master station.
1791
1792 The station number under ModbusRTU and ModbusASCII protocol is not 0: the protocol sets the slave station.
1793
1794 The serial port parameters are filled in according to the content in the form.
1795
1796 **✎Note: **RTU protocol cannot set data bit of 7-bit.
1797
1798 **4)Priority description of serial port parameters**
1799
1800 The priority of serial port parameter settings are listed as blow. The serial port parameters are saved by power failure currently.
1801
1802 Serial port parameter set instruction setting = Ladder program MOV instruction set the corresponding SD device > the download parameters of host computer > Previous power-off save data.
1803
1804 **{{id name="_Toc33979615"/}}(4) Basic ladder program**
1805
1806 (% style="text-align:center" %)
1807 [[image:10_html_a7e64b4f4526b73e.png||class="img-thumbnail"]]
1808
1809 (((
1810 Serial port parameter setting
1811
1812 Baud rate 115200, data bit 8, parity bit none, stop bit 1
1813
1814 Communication protocol setting: ModbusRTU master station protocol
1815
1816 Sending interval: 5ms
1817
1818 Receiving timeout: 100ms
1819
1820 Timeout retry times: 3 times
1821
1822 Station number 01H, function code 03H, slave address 10, length 05
1823
1824
1825 )))
1826
1827 **{{id name="_Toc33979616"/}}10.7.2.3 Send and receive process**
1828
1829 **{{id name="_Toc33979617"/}}(1) Modbus master station**
1830
1831 When programming, before each RS (Modbus mode) instruction, the assignment of each operand unit, such as the communication operation object address, operation type, operation register address, data number, sending or receiving unit, etc., is completed, once the execution starts, the system program will automatically calculate the CRC check, organize the communication frame, and complete the operation of sending data and receiving response.
1832
1833 If you use Modbus-ASC protocol communication (set SD2592 as H30), the HEX-ASC format conversion of sending and receiving data is automatically completed by the PLC system program. The RS (Modbus mode) instruction method and the Modbus-RTU protocol method are exactly the same.
1834
1835 In the plc program, if multiple RS (Modbus mode) instructions are driven, the system program will still execute the "sending, waiting for answer, receiving, verification, analysis and storage" of an RS instruction, and then perform the same process for the next RS instruction until all RS instructions are executed and then restarted. You don not need to care about the timing and process of its execution, which simplifies the PLC programming design. This is the advantage of Modbus instruction.
1836
1837 Modbus master function list
1838
1839 (% class="table-bordered" %)
1840 |**Function code**|**Function name**|**Details**
1841 |0x01|Coil readout|Coil readout (multiple points optional)
1842 |0x02|Input readout|Input and read (multiple points optional)
1843 |0x03|Holding register readout|Holding register readout(multiple points optional)
1844 |0x04|Input register readout|Input register readout (multiple points optional)
1845 |0x05|1 coil write|Coil writing (only 1 point)
1846 |0x06|1 register write|Holding register write (only 1 point)
1847 |0x0F|Batch coil write|Multi-point coil writing
1848 |0x10|Batch register write|Multi-point holding register write
1849
1850 (((
1851 Serial port parameter setting
1852
1853 Baud rate 115200, data bit 8, no parity bit, stop bit 1
1854
1855 Example:
1856 )))
1857
1858 (% style="text-align:center" %)
1859 [[image:10_html_a7e64b4f4526b73e.png||class="img-thumbnail"]]
1860
1861 (((
1862 Communication protocol setting: ModbusRTU master station protocol
1863
1864 Sending interval: 5ms
1865
1866 Receiving timeout: 100ms
1867
1868 Timeout retry times: 3 times
1869
1870 Station number 01H, function code 03H, slave address 10, length 05
1871
1872
1873 )))
1874
1875 As shown in the ladder program shown:
1876
1877 When M1 is turned ON, PLC will send data (hexadecimal) from COM2 of PLC: 01 03 00 0A 00 05 A5 C8
1878
1879 * 01: Slave address, the high 8 bits of (s);
1880 * 03: Modbus instruction code, the lower 8 bits of (s). It is to read the slave register;
1881 * 00 0A: The address of the slave register to be read, the value of (m);
1882 * 00 05: The number of registers to be read, the value of (d),
1883 * A5 C8: CRC check code.
1884
1885 **✎Note: **
1886
1887 When using 1 coil to write (0x05), the value used for writing 1 is 0xFF00, and the value used for writing 0 is 0x0000.
1888
1889 When using batch coil write (0x0F), pay attention to the high and low byte exchange. For example, when writing 1 length, the fourth parameter value is 1 (0x0001), which means 0 is sent. You need to write 256 (0x0100) to write 1 to the target address.
1890
1891 **{{id name="_Toc33979618"/}}(2) Modbus slave**
1892
1893 When the PLC series is used as a Modbus slave, it supports Modbus communication operation instructions such as 0x01, 0x03, 0x05, 0x06, 0x 0f, 0x10. The coils of the PLC that can be read and written include M, S, T, C, X (only Read) SM, Y, LC, HSC and other variables through these instructions. Register variables include D, T, C, R, SD, LC, HSC.
1894
1895 When the Modbus communication master accesses (reads or rewrites) the internal variables of the PLC slave, it must follow the following communication instruction frame definition and the variable address index method in order to carry out normal communication operations.
1896
1897 **{{id name="_Toc33979619"/}}1) instruction code 0x01 (01): read coil**
1898
1899 (% class="table-bordered" %)
1900 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1901 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1902 |2|0x01 (instruction code)|1 byte|Read coil
1903 |3|Coil start address|2 bytes|High bit in front, low bit in back, see coil addressing
1904 |4|Number of coils|2 bytes|High bit in front, low bit in back (N)
1905 |5|CRC check|2 bytes|Low bit in front, high bit in back
1906
1907 Response frame format: slave address + 0x01 + number of bytes + coil status + CRC check
1908
1909 (% class="table-bordered" %)
1910 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1911 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1912 |2|0x01 (instruction code)|1 byte|Read coil
1913 |3|Number of bytes|1 byte|Value: [(N+7)/8]
1914 |4|Coil state|[(N+7)/8] bytes|Every 8 coils are combined into one byte. If the last one is less than 8 bits, fill in 0 in the undefined part. The first 8 coils are in the first byte, and the coil with the smallest address is in the lowest bit. And so on
1915 |5|CRC check|2 bytes|High bit first, then low bit
1916
1917 Error response: refer to error response frame.
1918
1919 **{{id name="_Toc33979620"/}}2) instruction code 0x03 (03): read register**
1920
1921 Request frame format: slave address + 0x03 + register start address + number of registers + CRC check.
1922
1923 (% class="table-bordered" %)
1924 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1925 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1926 |2|0x03 (instruction code)|1 byte|Read register
1927 |3|Register start address|2 bytes|High bit in front, low bit in back, see register addressing
1928 |4|Number of registers|2 bytes|High bit in front, low bit in back (N)
1929 |5|CRC check|2 bytes|High bit in front, low bit in back
1930
1931 Response frame format: slave address + 0x03 + number of bytes + register value + CRC check.
1932
1933 (% class="table-bordered" %)
1934 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1935 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1936 |2|0x03 (instruction code)|1 byte|Read register
1937 |3|Number of bytes|1 byte|Value: N*2
1938 |4|Register value|N*2 bytes|Every two bytes represent a register value, with high bit in front, low bit in back. The smallest register address comes first
1939 |5|CRC check|2 bytes|High bit in front, low bit in back
1940
1941 Error response: See error response frame.
1942
1943 **{{id name="_Toc216324734"/}}3)** {{id name="_Toc267753989"/}}{{id name="_Toc33979621"/}}**instruction code 0x05 (05): write single coil**
1944
1945 Request frame format: slave address + 0x05 + coil address + coil status + CRC check.
1946
1947 (% class="table-bordered" %)
1948 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1949 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1950 |2|0x05 (instruction code)|1 byte|Write single coil
1951 |3|Coil address|2 bytes|High bit in front, low bit in back, see coil addressing
1952 |4|Coil state|2 bytes|High bit in front, low bit in back. Non-zero is valid
1953 |5|CRC check|2 bytes|High bit in front, low bit in back
1954
1955 Response frame format: slave address + 0x05 + coil address + coil status + CRC check.
1956
1957 (% class="table-bordered" %)
1958 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1959 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1960 |2|0x05 (instruction code)|1 byte|Write single coil
1961 |3|Coil address|2 bytes|High bit in front, low bit in back, see coil addressing
1962 |4|Coil state|2 bytes|High bit in front, low bit in back. Non-zero is valid
1963 |5|CRC check|2 bytes|High bit in front, low bit in back
1964
1965 {{id name="_Toc33979622"/}}{{id name="_Toc267753990"/}}{{id name="_Toc216324735"/}}Error response: see error response frame. The coil status 0xFF00 means ON, and 0x0000 means OFF.
1966
1967 **4) instruction code 0x06 (06): write a single register**
1968
1969 Request frame format: slave address + 0x06 + register address + register value + CRC check.
1970
1971 (% class="table-bordered" %)
1972 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1973 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1974 |2|0x06 (instruction code)|1 byte|Write single coil
1975 |3|Register|2 bytes|High bit in front, low bit in back, see coil addressing
1976 |4|Register value|2 bytes|High bit in front, low bit in back. Non-zero is valid
1977 |5|CRC check|2 bytes|High bit in front, low bit in back
1978
1979 Response frame format: slave address + 0x06 + register address + register value + CRC check.
1980
1981 (% class="table-bordered" %)
1982 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1983 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1984 |2|0x06 (instruction code)|1 byte|Write single coil
1985 |3|Register|2 bytes|High bit in front, low bit in back, see coil addressing
1986 |4|Register value|2 bytes|High bit in front, low bit in back. Non-zero is valid
1987 |5|CRC check|2 bytes|High bit in front, low bit in back
1988
1989 Error response: See error response frame.{{id name="_Toc33979623"/}}{{id name="_Toc216324736"/}}{{id name="_Toc267753991"/}}
1990
1991 **5) instruction code 0x 0f (15): write multiple coils**
1992
1993 Request frame format: slave address + 0x 0f + coil start address + coil number + byte number + coil status + CRC check.
1994
1995 (% class="table-bordered" %)
1996 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
1997 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
1998 |2|0x 0f (instruction code)|1 byte|Write multiple single coils
1999 |3|Coil start address|2 bytes|High bit in front, low bit in back, see coil addressing
2000 |4|Number of coils|2 bytes|High bit in front, low bit in back. The maximum of N is 1968
2001 |5|Number of bytes|1 byte|Value: [(N+7)/8]
2002 |6|Coil state|[(N+7)/8] bytes|Every 8 coils are combined into one byte. If the last one is less than 8 bits, fill in 0 in the undefined part. The first 8 coils are in the first byte, and the coil with the smallest address is in the lowest bit. And so on
2003 |7|CRC check|2 bytes|High bit in front, low bit in back
2004
2005 Response frame format: slave address + 0x 0f + coil start address + coil number + CRC check
2006
2007 (% class="table-bordered" %)
2008 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
2009 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
2010 |2|0x 0f (instruction code)|1 byte|Write multiple single coils
2011 |3|Coil start address|2 bytes|High bit in front, low bit in back, see coil addressing
2012 |4|Number of coils|2 bytes|High bit in front, low bit in back
2013 |5|CRC check|2 bytes|High bit in front, low bit in back
2014
2015 Error response: See error response frame.
2016
2017 **{{id name="_Toc33979624"/}}6)** {{id name="_Toc216324737"/}}{{id name="_Toc267753992"/}}**3.2.6 instruction code 0x10 (16): write multiple registers**
2018
2019 Request frame format: slave address + 0x10 + register start address + register number + byte number + register value + CRC check.
2020
2021 (% class="table-bordered" %)
2022 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
2023 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
2024 |2|0x10(instruction code)|1 byte|Write multiple registers
2025 |3|Register start address|2 bytes|High bit in front, low bit in back, see register addressing
2026 |4|Number of registers|2 bytes|High bit in front, low bit in back. The maximum of N is 120
2027 |5|Number of bytes|1 byte|Value: N*2
2028 |6|Register value|N*2 (N*4)|
2029 |7|CRC check|2 bytes|High bit in front, low bit in back
2030
2031 Response frame format: slave address + 0x10 + register start address + register number + CRC check.
2032
2033 (% class="table-bordered" %)
2034 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
2035 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
2036 |2|0x10 (instruction code)|1 byte|Write multiple registers
2037 |3|Register start address|2 bytes|High bit in front, low bit in back, see register addressing
2038 |4|Number of registers|2 bytes|High bit in front, low bit in back. The maximum of N is 120
2039 |5|CRC check|2 bytes|High bit in front, low bit in back
2040
2041 Error response: See error response frame.{{id name="_Toc33979625"/}}{{id name="_Toc216324738"/}}{{id name="_Toc267753993"/}}
2042
2043 **7) Error response frame**
2044
2045 Error response: slave address + (instruction code + 0x80) + Error code + CRC check.
2046
2047 (% class="table-bordered" %)
2048 |**Serial number**|**Data (byte) meaning**|**Number of bytes**|**Instruction**
2049 |1|Slave address|1 byte|Value 1 to 247, set by SD2544, SD2594
2050 |2|Instruction code+0x80|1 byte|Error instruction code
2051 |3|Code|1 byte|1 to 4
2052 |4|CRC check|2 bytes|High bit in front, low bit in back
2053
2054 (% class="table-bordered" %)
2055 |**Serial number**|**Error code**|**Instruction**
2056 |1|01|Unsupported function code
2057 |2|02|Wrong address or function code
2058 |3|03|Wrong length
2059 |4|04|Imperfect instruction
2060 |5|05|Address not allowed
2061
2062 **{{id name="_Toc33979626"/}}8) Slave address table**
2063
2064 (% class="table-bordered" %)
2065 |(% colspan="5" %)**Word address**
2066 |**Address type**|**Occupy**|**Address range**|**Decimal address**|**Total reserved address size**
2067 |T0 to T511|512 WORD|0x0000-0x01ff|0|1536
2068 |C0 to C255|256 WORD|0x0600-0x06ff|1536|1024
2069 |LC0 to LC255|512 WORD|0x0A00-0x0BFF|2560|1024
2070 |HSC0 to HSC15|32 WORD|0x0E00-0x0E1F|3584|512
2071 |D0 to D7999|8000 WORD|0x1000-0x2F3F|4096|16384
2072 |SD0 to SD4095|4096 WORD|0x5000-0x5FFF|20480|12288
2073 |R0 to R29999|30000 WORD|0x8000-0xF52F|32768|30000
2074
2075 (% class="table-bordered" %)
2076 |(% colspan="5" %)**Bit address**
2077 |**Address type**|**Occupy**|**Address range**|**Decimal address**|**Total reserved address size**
2078 |T0 to T511|512 bit|0x0000-0x01ff| |1536
2079 |C0 to C255|256 bit|0x0600-0x06ff|1536|1024
2080 |LC0 to LC255|256 bit|0x0A00-0x0AFF|2560|1024
2081 |HSC0 to HSC15|16 bit|0x0E00-0x0E0F|3584|512
2082 |M0 to M7999|8000 bit|0x1000-0x2F3F|4096|16384
2083 |SM0 to SM4095|4096 bit|0x5000-0x5FFF|20480|12288
2084 |Reserved| |0x8000-0xBFFF| |16383
2085 |S0 to S4095|4096 bit|0xC000-0xCFFF|49152|8192
2086 |X0 to X1777|1024 bit|0xE000-0xE3FF|57344|4096
2087 |Y0 to Y1777|1024 bit|0xF000-0xF3FF|61440|4096
2088
2089 **Error message**
2090
2091 Currently the Error code will be displayed on SD7 and SD0 and SD2611 and SD2612.
2092
2093 The Error codes that appear in the Modbus protocol are mainly as follows.
2094
2095 (% class="table-bordered" %)
2096 |(% style="width:101px" %)**Error code**|(% style="width:980px" %)**Content**
2097 |(% style="width:101px" %)4085H|(% style="width:980px" %)(s)(m)(d)(N) The read address is out of the device range (this error is only displayed on SD7 and SD0)
2098 |(% style="width:101px" %)3180H|(% style="width:980px" %)COM2 data reception error. There may be interference on the communication line, it is recommended to connect the ground wire.
2099 |(% style="width:101px" %)3181H|(% style="width:980px" %)COM2 data reception timed out. "Check the wiring, check whether the serial port parameter settings are compatible with master and slave, check whether there is interference. Check whether the slave station is too late to respond. For this reason, you can try to increase the sending interval SD2546."
2100 |(% style="width:101px" %)3182H|(% style="width:980px" %)COM2 CRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
2101 |(% style="width:101px" %)3183H|(% style="width:980px" %)COM2 LRC check error. There may be interference on the communication line, it is recommended to connect the ground wire.
2102 |(% style="width:101px" %)3184H|(% style="width:980px" %)The COM2 station number is incorrectly configured. Check the slave station number setting. And check whether there is any problem with the receiving and sending mechanism from the station.
2103 |(% style="width:101px" %)3185H|(% style="width:980px" %)COM2 send buffer overflow. Contact a technician if this error occurs
2104 |(% style="width:101px" %)3186H|(% style="width:980px" %)COM2 function code is wrong. Check whether the set function code is a function code supported by PLC
2105 |(% style="width:101px" %)3187H|(% style="width:980px" %)COM2 address is wrong. Check whether the slave station has this address (please refer to Modbus Abnormal 02)
2106 |(% style="width:101px" %)3188H|(% style="width:980px" %)The length of COM2 is wrong. Check whether the communication length exceeds the length range specified by the Modbus protocol, or whether it exceeds the specified length range of the custom protocol.
2107 |(% style="width:101px" %)3189H|(% style="width:980px" %)COM2 data error. "Check whether there are errors in the parameters of the instruction. Check whether the slave station supports the setting of this value. (Please refer to Modbus Abnormal 03)"
2108 |(% style="width:101px" %)318AH|(% style="width:980px" %)COM2 slave is busy. Slave station returns information: Slave station is busy (please refer to Modbus exception 06)
2109 |(% style="width:101px" %)318BH|(% style="width:980px" %)The COM2 slave station does not support function codes. Check whether the slave station supports this function code (please refer to Modbus exception 01)
2110 |(% style="width:101px" %)318CH|(% style="width:980px" %)The COM2 slave is faulty. Slave station returns information: Slave station is faulty, please check whether the slave station is faulty (please refer to Modbus Abnormal 04)
2111 |(% style="width:101px" %)318DH|(% style="width:980px" %)COM2 slave confirms. Slave station return information: slave station confirmation (please refer to Modbus abnormal 05)
2112 |(% style="width:101px" %)318EH|(% style="width:980px" %)COM2 current protocol does not support this instruction. RS instruction cannot be used when it is set to slave station protocol, please change the protocol or close the contact before RS instruction (this error is only displayed on SD7 and SD0)
2113 |(% style="width:101px" %)318FH|(% style="width:980px" %)COM2 sending timed out. Contact a technician if this error occurs
2114 |(% style="width:101px" %)3190H|(% style="width:980px" %)COM2 receiving data exceeds the buffer limit.
2115 |(% style="width:101px" %)31A0H|(% style="width:980px" %)COM2 is not available as a gateway. Returned information from the station: unavailable gateway (please refer to Modbus exception 0A)
2116 |(% style="width:101px" %)31A1H|(% style="width:980px" %)COM2 indicates that no response was obtained from the target device. Slave station returns information: the device is not in the network (please refer to Modbus exception 0B)
2117
2118 After resetting the protocol or communication parameters, the error will be cleared.
2119
2120 In addition, the communication completion/communication error/communication timeout flag will be set after the executed instruction.
2121
2122 == {{id name="_10.7 WECON MODBUS protocol description"/}}**PLCLINK/Fast interconnect** ==
2123
2124 PLCLINK function is used to simplify the fast connection between PLCs. The fast communication of the LX5V series PLC could be achieved only using the configuration parameters without using the communication instruction(RS).
2125
2126 The topological diagram is shown in the figure below.
2127
2128 (% style="text-align:center" %)
2129 [[image:image-20220614170612-1.jpeg]]
2130
2131 When using the PLCLINK function:
2132
2133 * Master station configuration: Select COM2 port and set the protocol to PLCLINK protocol.
2134 * Slave configuration: Select COM1 or COM2 and set the protocol to dedicated protocol.
2135
2136 (% class="wikigeneratedid" id="H28129Createatable" %)
2137 **(1) Create a table**
2138
2139 In [Project manager]-[Extended function]-[PLCLINK], right click [PLCLINK], and click it to create a table.
2140
2141 (% style="text-align:center" %)
2142 [[image:10_html_347d7923523ad9af.png||class="img-thumbnail"]]
2143
2144 Click it and a prompt box as below would pop up.
2145
2146 (% style="text-align:center" %)
2147 [[image:10_html_dbbb9b1ddaa56dce.png||class="img-thumbnail"]]
2148
2149 Click "Yes" will automatically change the protocol to PLCLINK, click "No" will not change the protocol.
2150
2151 The number of PLCLINK protocol is H60.
2152
2153 (% class="table-bordered" %)
2154 |**0H**|Wecon Modbus slave station
2155 |**2H**|ModbusRTU slave station
2156 |**3H**|ModbusASCII slave station
2157 |**10H**|user-defined protocol
2158 |**20H**|ModbusRTU main station
2159 |**30H**|ModbusASCII main station
2160 |**60H**|PLCLINK protocol
2161
2162 Click "Yes" will generate an empty table MAIN.
2163
2164 (% style="text-align:center" %)
2165 [[image:10_html_39ce9cf6a41c3901.png||class="img-thumbnail"]]
2166
2167 Double click MAIN will pop up the POLCLINK table as below.
2168
2169 (% style="text-align:center" %)
2170 [[image:10_html_14072bc2a32c267.png||class="img-thumbnail"]]
2171
2172 Currently only one PLCLINK table can be created. Creating a new table after creating one is disallowed.
2173
2174 (% style="text-align:center" %)
2175 [[image:10_html_f4bec5285beb7949.png||class="img-thumbnail"]]
2176
2177 (2) Write the table
2178
2179 Write station number in
2180
2181 After writing the station number in the new instruction station number in the table, click the new instruction to add the communication instruction.
2182
2183 The range of station number is 1 to 31. The maximum number of communication instruction is 255.
2184
2185 (% style="text-align:center" %)
2186 [[image:10_html_21d3b9789058efb3.png||class="img-thumbnail"]]
2187
2188 (% style="text-align:center" %)
2189 [[image:10_html_20232344eaa6cb2a.png||class="img-thumbnail"]]
2190
2191 Currently the station number is only selected by drop-down box.
2192
2193 (% style="text-align:center" %)
2194 [[image:10_html_f09857f93ae04f0a.png||class="img-thumbnail"]]
2195
2196 The devices of main station and slave station are selected by drop-down box.
2197
2198 (% style="text-align:center" %)
2199 [[image:10_html_99c7d435825defd1.png||class="img-thumbnail"]]
2200
2201 (% style="text-align:center" %)
2202 [[image:10_html_f62cce6501331b8d.png||class="img-thumbnail"]]
2203
2204 The transfer direction are read and write, and also selected by drop-down box.
2205
2206 (% style="text-align:center" %)
2207 [[image:10_html_7b3de12a134b4e95.png||class="img-thumbnail"]]
2208
2209 The device address range limitations are as below.
2210
2211 1. The device address could not exceed the current device range
2212 1. {{id name="OLE_LINK102"/}}In the device of bit written, the mantissa of points of X and Y must be zero, such as X0, X10, X20, Y0, Y10, Y20 and so on. The software PLC Editor 2 will adjust automatically.
2213 1. {{id name="OLE_LINK106"/}}The Points of bit device other than X and Y must be a multiple of 8,such as M0, M8, N16, T(bit) 16, C(bit) 24 and so on. The software PLC Editor 2 will adjust automatically.
2214 1. {{id name="OLE_LINK103"/}}Bit device must communicate with bit device , and word device must communicate with word device. Double word device can only communicate with double word device. This is to avoid length perception differences.
2215
2216 {{id name="OLE_LINK104"/}}The number limitations of slave station device are as below.
2217
2218 1. The number of bit device ranges from 8 to 2,032.
2219 1. {{id name="OLE_LINK105"/}}The number of word device ranges from 1 to 126.
2220 1. The number of double word device ranges from 1 to 63. HSC can only use a maximum of 16 due to the number limitation.
2221 1. The number of bit device must be a multiple of 8, such as 8, 16, 24, 32 and so on. The software PLC Editor 2 will adjust automatically.display the corresponding device address and range.
2222
2223 (3) Download
2224
2225 {{id name="OLE_LINK107"/}}Currently PLCLINK could only be downloaded with the program and could not downloaded separately.
2226
2227 (% style="text-align:center" %)
2228 [[image:10_html_a586bd0ca75cd8f.png||class="img-thumbnail"]]
2229
2230 Click on PLCLINK in monitoring mode to re-write part of the table into PLC, but the start device could not be modified.
2231
2232 (% style="text-align:center" %)
2233 [[image:10_html_92ca328b83e6ef12.png||class="img-thumbnail"]]
2234
2235 In monitoring mode, monitoring read and monitoring write could not be executed if the ladder program comparison is incorrect.
2236
2237 (4) Automatic check
2238
2239 Click “Check” in monitoring mode, the PLC that can communicate will be automatically searched and enabled. Stations that could not communicate will be closed. The Stations without instructions will not be checked. The PLCLINK table will be updated after the automatic check of the upper computer is finished.
2240
2241 (% style="text-align:center" %)
2242 [[image:10_html_d6ff78427b75140d.png||class="img-thumbnail"]]
2243
2244 Write 1 to in the table for addresses whose start address is offset 12 (for example, R200 is R212). The corresponding function is as below.
2245
2246 (% class="table-bordered" %)
2247 |**S1+12**|(((
2248 Auto check mode
2249
2250 (Reserved)
2251 )))|(((
2252 {{id name="OLE_LINK109"/}}0: No check; 1: Automatic check mode; 2: Automatic check in progress.
2253
2254 {{id name="OLE_LINK110"/}}{{id name="OLE_LINK111"/}}When enabled, all the station numbers will send data to determine whether the station number exists. The corresponding communication switch will be turned on if it exists. If not, the corresponding communication switch will be turned off.
2255 )))
2256
2257 No error will be reported during auto check after the auto check is enabled. After the check is complete, the corresponding station number will be automatically enabled and disabled.
2258
2259 (% class="table-bordered" %)
2260 |**S1+13**|Corresponding station number communication switch 1|(((
2261 The switch control of station 1 to 15
2262
2263 {{id name="OLE_LINK112"/}}Bit0: ON: Station number 0 (broadcast) normal communication
2264
2265 OFF: Station number 0 (broadcast) communication prohibited (broadcast prohibited)
2266
2267 Bit1: ON: Station number 1 normal communication; OFF: Station 1 communication prohibited
2268
2269 Bit2: ON: Station number 2 normal communication; OFF: Station 2 communication prohibited
2270 )))
2271 |**S1+14**|Corresponding station number communication switch 2|The switch control of station 16 to 31
2272
2273 Click [station number enable] to set the station enable according to the corresponding situations.
2274
2275 (% style="text-align:center" %)
2276 [[image:10_html_beda0fdc84802959.png||class="img-thumbnail"]]
2277
2278 (% style="text-align:center" %)
2279 [[image:10_html_f84703130b23d8f6.png||class="img-thumbnail"]]
2280
2281 **✎Note: **When in the automatic check state, forcibly turn off the automatic check state (write 0 in S1+12), an error may occur.
2282
2283 {{id name="OLE_LINK113"/}}(5) Main station parameter configuration
2284
2285 (% style="text-align:center" %)
2286 [[image:10_html_434fac0fa8c16597.png||class="img-thumbnail"]]
2287
2288 The protocol must be PLCLINK protocol, and the data bit can not be 7-bit data bit. Other parameters can be selected as required.
2289
2290 (6) Slave station configuration
2291
2292 For PLCLINK communication ports, select the dedicated protocol from the station protocol.
2293
2294 (% style="text-align:center" %)
2295 [[image:10_html_2641eb7c39f4f4aa.png||class="img-thumbnail"]]
2296
2297 The settings of Baud rate, data bit, stop bit, parity bit must be consistent with main station. The parameters above are consistent if not modified. The station number needs to be configured separately. The slave station number ranges from 1 to 31.
2298
2299 {{id name="OLE_LINK115"/}}(7) Close PLCLINK
2300
2301 In S1+11, The pause and start of PLCLINK are controlled by bit 8. If bit 8 is ON, PLCLINK would be closed. No error is reported when switching protocol after this function is disabled.
2302
2303 (% class="table-bordered" %)
2304 |**S1+11**|Operation state|(((
2305 Bit0=1,Port is occupied. This function obtains the right of data transaction transmission.
2306
2307 Bit2=1,One cycle has been executed.
2308
2309 {{id name="OLE_LINK114"/}}Bit4,Communication transmission output indication
2310
2311 Bit5,Communication error output indication (Exceeds the number of retry times)
2312
2313 Bit6,Communication completion output indication
2314
2315 Bit8,PLCLINK suspension (0: Normal operation, 1: Operation paused)
2316 )))
2317
2318 (8) Table contents
2319
2320 {{id name="OLE_LINK119"/}}Currently the communication table is downloaded to the device to operate. The details of the table are as follows.
2321
2322 (% class="table-bordered" %)
2323 |(% rowspan="2" %)**Address offset**|(% colspan="2" %){{id name="OLE_LINK116"/}}**Brief description**|(% rowspan="2" %)**Detailed description**
2324 |**High byte**|**Low byte**
2325 |S1+0|(% colspan="2" %)Header|{{id name="OLE_LINK117"/}}Header =70h, correct PLCLINK table. (modification prohibited)
2326 |S1+1|(% colspan="2" %)Number of communication instructions|1 to 255 (modification prohibited)
2327 |S1+2|(% colspan="2" %)Version|{{id name="OLE_LINK121"/}}{{id name="OLE_LINK118"/}}V1.100 (modification prohibited)
2328 |S1+3|(% colspan="2" %){{id name="OLE_LINK120"/}}The start address of communication table|modification prohibited
2329 |S1+4|(% colspan="2" %)Check bit of the number of header and communication|Simple check calculation for table header, number of communication instructions, version, and the start address of communication table ((modification prohibited))
2330 |S1+5|(% colspan="2" %)Which instruction currently is running|Display the current running command (read only)
2331 |S1+6|Station NO.1|Read/write direction|(% rowspan="5" %)The instruction content of current communication
2332 |S1+7|(% colspan="2" %)The data start address of station NO.1
2333 |S1+8|Station NO.2|Address type distinction
2334 |S1+9|(% colspan="2" %)The data start address of station NO.2
2335 |S1+10|(% colspan="2" %)Data length
2336 |S1+11|(% colspan="2" %)Operation state|(((
2337 Bit0=1,Port is occupied. This function obtains the right of data transaction transmission.
2338
2339 Bit2=1, One cycle has been executed.
2340
2341 Bit4, Communication transmission output indication
2342
2343 Bit5, Communication error output indication (Exceeds the number of retry times)
2344
2345 Bit6, Communication completion output indication
2346
2347 Bit8, PLCLINK suspension (0: Normal operation, 1: Operation paused)
2348 )))
2349 |S1+12|(% colspan="2" %)Auto check mode (Reserved)|(((
2350 0: No check; 1: Automatic check mode; 2: Automatic check in progress.
2351
2352 When enabled, all the station numbers will send data to determine whether the station number exists. The corresponding communication switch will be turned on if it exists. If not, the corresponding communication switch will be turned off.
2353 )))
2354 |S1+13|(% colspan="2" %)Corresponding station number communication switch 1|(((
2355 The switch control of station 1 to 15
2356
2357 Bit0: ON: Station NO. 0 (broadcast) normal communication
2358
2359 OFF: Station NO.0 (broadcast) communication prohibited (broadcast prohibited)
2360
2361 Bit1: ON: Station NO.1 normal communication;
2362
2363 OFF: Station NO.1 communication prohibited
2364
2365 Bit2: ON: Station NO.2 normal communication;
2366
2367 OFF: Station NO.2 communication prohibited
2368 )))
2369 |S1+14|(% colspan="2" %)Corresponding station number communication switch 2|The switch control of station 16 to 31
2370 |S1+15|(% colspan="2" %)Reserved|
2371 |S1+16|(% colspan="2" %)Reserved|
2372 |S1+17|(% colspan="2" %)Reserved|
2373 |S1+18|(% colspan="2" %)Reserved|
2374 |S1+19|(% colspan="2" %)Reserved|
2375 |S1+20|(% colspan="2" %)Reserved|
2376 |S1+21|Station NO.1|Read/write direction|(((
2377 • Station NO. 1 to 32, FF(FF represents main station)
2378
2379 • Function code:
2380
2381 ~=01H, read
2382
2383 ~=02H, write
2384 )))
2385 |S1+22|(% colspan="2" %)The data start address of station NO.1|• Valid word. Define operating the start address of slave station data
2386 |S1+23|Station NO.2|Address type distinction|(((
2387 •Station NO.0 to 32 (If it is 0, broadcast to all the slave stations on behalf of master station, and slave stations do not respond
2388
2389 •Distinguish the type of the starting device for storing data in the main station.
2390
2391 Main station address type distinction. 0: word address; 1: bit address
2392 )))
2393 |S1+24|(% colspan="2" %)The data start address of station NO.2|• Valid word. Define operating the start device of slave station data. Define the corresponding address by MUDBUS address of 5V.
2394 |S1+25|(% colspan="2" %)Data length|• Valid word. Range 1 to 126(bit data), 1 to 2,032(bit data)
2395 |S1+26|Station NO.1|Read/write direction|(% rowspan="5" %)(((
2396 The second data transmission description.
2397
2398 Main station address type distinction.
2399 )))
2400 |S1+27|(% colspan="2" %)The data start address of station NO.1
2401 |S1+28|Station NO.2|Address type distinction
2402 |S1+29|(% colspan="2" %)The data start address of station NO.2
2403 |S1+30|(% colspan="2" %)Data length
2404 |•|(% colspan="2" %) | 
2405 |•|(% colspan="2" %) | 
2406 |S1+20+ n×5|(% colspan="2" %)Reserved|• n is the total number of data transmission commands.
2407
2408 **{{id name="_Toc27709"/}}✎Note: **
2409
2410 1. It is forbidden to modify S0 to S4.
2411 1. It is not recommended to change the value except the function enable or station number enable. Otherwise, the operation or upload may be abnormal.
2412
2413 **{{id name="_Toc18822"/}}Error code**
2414
2415 (% class="table-bordered" %)
2416 |(% style="width:105px" %)**Error code**|(% style="width:976px" %)**Contents**
2417 |(% style="width:105px" %)31C0H|(% style="width:976px" %){{id name="OLE_LINK129"/}}Abnormal PLCLINK header. Re-download the program.
2418 |(% style="width:105px" %)31C1H|(% style="width:976px" %)PLCLINK function is not supported by COM port currently.
2419 |(% style="width:105px" %)31C2H|(% style="width:976px" %)PLCLINK table version is incompatible. Re-download the program.
2420 |(% style="width:105px" %)31C3H|(% style="width:976px" %)The number of PLCLINK command exceeds the range. The value ranges from 1 to 255 Currently.
2421 |(% style="width:105px" %)31C4H|(% style="width:976px" %){{id name="OLE_LINK133"/}}{{id name="OLE_LINK132"/}}The station number of PLCLINK table exceeds the range. Check the station number in the table.
2422 |(% style="width:105px" %)31C5H|(% style="width:976px" %)PLCLINK table exceeds the range of device. Check the corresponding device range of table.
2423 |(% style="width:105px" %)31C6H|(% style="width:976px" %)The device used by PLCLINK table command exceeds the range. Check the device used for each command in the table.
2424 |(% style="width:105px" %)3180H|(% style="width:976px" %)COM2 data reception error. There may be interference on the communication line. It is recommended to connect the ground wire.
2425 |(% style="width:105px" %)3181H|(% style="width:976px" %)COM2 data reception time. Check wiring, whether the parameters of the serial port setting is master-slave correspondence, whether there is interference, whether it is caused by the delay of the slave station. For this reason, try to increase the sending interval SD2546.
2426 |(% style="width:105px" %)3182H|(% style="width:976px" %)COM2 CRC check error. There may be interference on the communication line. It is recommended to connect the ground wire.
2427 |(% style="width:105px" %)3184H|(% style="width:976px" %)COM2 station number error. Check the setting of slave station number. Check whether there is a problem with the slave receiving and sending mechanism.
2428 |(% style="width:105px" %)3186H|(% style="width:976px" %){{id name="OLE_LINK135"/}}COM2 function code error. Check whether the function code is supported by PLC.
2429 |(% style="width:105px" %)3187H|(% style="width:976px" %)COM2 address error.
2430 |(% style="width:105px" %)3188H|(% style="width:976px" %){{id name="OLE_LINK136"/}}COM2 length error. Check whether the communication length exceeds the length range specified by Modbus or user-defined protocol.
2431 |(% style="width:105px" %)3189H|(% style="width:976px" %){{id name="OLE_LINK137"/}}{{id name="OLE_LINK138"/}}COM2 data error. Check whether the parameter of instruction is wrong. Check whether the setting of the value is supported by slave station. (Please refer to Modbus abnormal 03)
2432 |(% style="width:105px" %)318AH|(% style="width:976px" %){{id name="OLE_LINK139"/}}{{id name="OLE_LINK140"/}}COM2 slave station is busy. Slave station returns message: Slave station is busy. (Please refer to Modbus abnormal 06)
2433 |(% style="width:105px" %)318BH|(% style="width:976px" %){{id name="OLE_LINK141"/}}COM2 slave station does not support function codes. Check whether the function code is supported by slave station. (Please refer to Modbus abnormal 01)
2434 |(% style="width:105px" %)318CH|(% style="width:976px" %)COM2 slave station fault. Slave station returns message: Slave station is fault. Check whether the slave station is faulty. (Please refer to Modbus abnormal 04)
2435 |(% style="width:105px" %)318DH|(% style="width:976px" %)COM2 slave station confirmation. Slave station returns message: Slave station confirmation.(Please refer to Modbus abnormal 05)
2436 |(% style="width:105px" %)318EH|(% style="width:976px" %)COM2 does not support this instruction or function. When slave station protocol is set, the corresponding communication instruction or function of main station could not be used. Please change the protocol or close the contacts before the corresponding instruction, or the corresponding communication function.
2437 |(% style="width:105px" %)3190H|(% style="width:976px" %)The data received by COM2 exceeds the cache limit.
2438
2439 **{{id name="_Toc25970"/}}Example**
2440
2441 Create a PLCLINK table and automatically switch the Com2 protocol to PLCLINK.
2442
2443 (% style="text-align:center" %)
2444 [[image:10_html_c4962fb2076781b9.png||class="img-thumbnail"]]
2445
2446 {{id name="OLE_LINK143"/}}Open PLCLINK table, write the master station D10 to the slave station D10 device number 10, and read the slave station D10 to the master station D20 device number 10.
2447
2448 (% style="text-align:center" %)
2449 [[image:10_html_3244c013d7d800c3.png||class="img-thumbnail"]]
2450
2451 {{id name="OLE_LINK144"/}}Connect Com2 of master station PLC to COM1 of slave station, and set the slave station number to 1. After downloading, set the value of main station D10 to 1 and D11 to 8192 . Then, D20 will change to 1 and and D21 will change to 8192.
2452
2453 (% style="text-align:center" %)
2454 [[image:10_html_ae5ef70ce179ad5e.png||class="img-thumbnail"]]
2455
2456 **{{id name="_Toc27083"/}}The situation of connecting more than one**
2457
2458 When adding commands, the station number that corresponding more slave station number can add more station number communication connections
2459
2460 (% style="text-align:center" %)
2461 [[image:10_html_98f836562979721.png||class="img-thumbnail"]]
2462
2463 == {{id name="_Toc7760"/}}**Wecon Modbus protocol description** ==
2464
2465 The current Wecon Modbus protocol description (special protocol) is modified based on the ModbusRTU protocol.
2466
2467 Therefore, 7-bit data bits cannot be used in the serial port parameter part.
2468
2469 The protocol of COM0 and COM1 can only use WECON Modbus protocol at present and cannot be changed.
2470
2471 This protocol is fully compatible with Modbus RTU protocol, and the address is also the same as the default address of LX5V PLC's Modbus RTU protocol.
2472
2473 The extended function is mainly used to communicate with PLCEDITOR.