Changes for page 07 Communication

Last modified by Devin Chen on 2024/08/19 14:28

From version 1.1
edited by Leo Wei
on 2022/06/08 12:57
Change comment: Imported from XAR
To version 7.1
edited by Stone Wu
on 2022/07/20 10:29
Change comment: Renamed from xwiki:PLC Editor.1 User Manual.8\.1\. Communication.WebHome

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +XWiki.Stone
Content
... ... @@ -1,16 +1,15 @@
1 1  = **1 PLC COM2 Modbus RTU** =
2 2  
3 -== **1.1 Protocol Setting (D8126)** ==
3 +== **Protocol Setting (D8126)** ==
4 4  
5 -(% border="1" %)
6 -|**Protocol**|**Description**|**Value of D8126**
7 -|WECON PLC Protocol|Using WECON PLC Protocol|01H
8 -|MODBUS RTU Master|PLC is slave device|02H
9 -|MODBUS ASCII Master|PLC is slave device|03H
10 -|MODBUS RTU Slave|PLC is master device|20H
11 -|MODBUS ASCII Slave|PLC is master device|30H
5 +|=(% scope="row" %)**Protocol**|=**Description**|=**Value of D8126**
6 +|=WECON PLC Protocol|Using WECON PLC Protocol|01H
7 +|=MODBUS RTU Master|PLC is slave device|02H
8 +|=MODBUS ASCII Master|PLC is slave device|03H
9 +|=MODBUS RTU Slave|PLC is master device|20H
10 +|=MODBUS ASCII Slave|PLC is master device|30H
12 12  
13 -== **1.2 Communication Format (D8120)** ==
12 +== **Communication format (D8120)** ==
14 14  
15 15  (% border="1" %)
16 16  |(% rowspan="2" %)**Item**|(% rowspan="2" %)**parameter**|(% colspan="8" %)**Bit value of D8120**
... ... @@ -39,11 +39,14 @@
39 39  |Even|-|-|-|-|-|1|1|-
40 40  |(% rowspan="2" %)Data bit|7 bit|-|-|-|-|-|-|-|0
41 41  |8 bit|-|-|-|-|-|-|-|1
42 -|(% colspan="10" %)Example: the communication format is 9600.1.8.None, b7b6b5b4=1000, b3=0, b2b1=00, b 0=1. D8120=81H ( (10000001),,2,,=81H, 81H means [[hexadecimal>>path:C:/Users/Administrator/AppData/Local/Yodao/DeskDict/frame/20140818134937/javascript:void(0);]] [[number>>path:C:/Users/Administrator/AppData/Local/Yodao/DeskDict/frame/20140818134937/javascript:void(0);]])
41 +|(% colspan="10" %)Example: the communication format is 9600.1.8.None, b7b6b5b4=1000, b3=0, b2b1=00, b 0=1. D8120=81H ( (10000001),,2,,=81H, 81H means hexadecimal number)
43 43  
43 +(% class="box infomessage" %)
44 +(((
44 44  **✎Note:** If use Data bit=7.Parity can not choose None.
46 +)))
45 45  
46 -== **1.3 WECON PLC - MODBUS (Slave) addresses rules** ==
48 +== **WECON PLC - MODBUS (Slave) addresses rules** ==
47 47  
48 48  (% border="1" %)
49 49  |(% colspan="3" %)** PLC Bit Address**
... ... @@ -56,7 +56,7 @@
56 56  |C0 ~~ C255|0xF400 ~~ 0xF4FF|62464 ~~ 62719
57 57  |X0 ~~ X255|0xF800 ~~ 0xF9FE|63488 ~~ 63998
58 58  |Y0 ~~ Y255|0xFC00 ~~ 0xFDFE|64512 ~~ 65022
59 -|(% colspan="3" %)** PLC Word Address**
61 +|(% colspan="3" %)** PLC Word Address**
60 60  |(% rowspan="2" %)PLC Address|(% colspan="2" %)MODBUS Address
61 61  |Hex|Decimal
62 62  |D0 ~~ D8255|0 ~~ 0x203F|0 ~~ 8255
... ... @@ -64,9 +64,9 @@
64 64  |C0 ~~ C199|0xF400 ~~ 0xF4C7|62464 ~~ 62663
65 65  |C200 ~~ C255|0xF700 ~~ 0xF7FF|63232 ~~ 63487
66 66  
67 -== **1.4 MODBUS Function Code Introduction** ==
69 +== **MODBUS function fode introduction** ==
68 68  
69 -**(1) Function code 0x01(01): read coil (bit address)**
71 +**Function code 0x01(01): read coil (bit address)**
70 70  
71 71  Frame format: Station number of slave&0x01 + start address + number of coils + CRC
72 72  
... ... @@ -78,7 +78,7 @@
78 78  |4|(% style="width:352px" %)Number of coils|(% style="width:252px" %)2 bytes|
79 79  |5|(% style="width:352px" %)CRC|(% style="width:252px" %)2 bytes|
80 80  
81 -**(2) Function code 0x03(03): read register (word address)**
83 +**Function code 0x03(03): read register (word address)**
82 82  
83 83  Frame format: Station number of slave&0x03 + start address+ number of registers + CRC
84 84  
... ... @@ -90,7 +90,7 @@
90 90  |4|Number of registers|2 bytes|
91 91  |5|CRC|2 bytes|
92 92  
93 -**(3) Function code 0x05(05): write single coil**
95 +**Function code 0x05(05): write single coil**
94 94  
95 95  Frame format: Station number of slave&0x05 + address + state of coil + CRC
96 96  
... ... @@ -102,7 +102,7 @@
102 102  |4|State of coil|2 bytes|
103 103  |5|CRC|2 bytes|
104 104  
105 -**(4) Function code 0x06 (06): Write single register**
107 +**Function code 0x06 (06): Write single register**
106 106  
107 107  Frame format: Station number of slave&0x06 + address + value + CRC
108 108  
... ... @@ -114,7 +114,7 @@
114 114  |4|Value of register|2 bytes|
115 115  |5|CRC|2 bytes|
116 116  
117 -**(5) Function code 0x0f(15): Write continuous coils**
119 +**Function code 0x0f(15): Write continuous coils**
118 118  
119 119  Frame format: Station number of slave&0x0f + start address + number of coils + length + state of coil + CRC
120 120  
... ... @@ -128,7 +128,7 @@
128 128  |6|State of coils|[(N+7)/8] bytes|
129 129  |7|CRC|2 bytes|
130 130  
131 -**(6) Function code 0x10 (10): Write continuous registers**
133 +**Function code 0x10 (10): Write continuous registers**
132 132  
133 133  Frame format: Station number of slave&0x10 + start address + number of registers + length + value of register + CRC
134 134  
... ... @@ -142,51 +142,48 @@
142 142  |6|Value of register|N*2 bytes|
143 143  |7|CRC|2 bytes|
144 144  
145 -== **1.5 Example** ==
147 +== **Example** ==
146 146  
147 -**(1) Read bit address from device**
149 +**Read bit address from device**
148 148  
149 -**(When reading the bit address, the return value of 256 means that the coil is turned ON, and the return value of 0 means that the coil is turned OFF.)**
151 +(When reading the bit address, the return value of 256 means that the coil is turned ON, and the return value of 0 means that the coil is turned OFF.)
150 150  
151 151  (% style="text-align:center" %)
152 -[[image:1641781999957-637.png||class="img-thumbnail" height="390" width="750"]]
154 +[[image:1641781999957-637.png||height="390" width="750" class="img-thumbnail"]]
153 153  
154 -**(2) Read word address from device**
156 +**Read word address from device**
155 155  
156 156  (% style="text-align:center" %)
157 -[[image:1641782024282-424.png||class="img-thumbnail" height="439" width="750"]]
159 +[[image:1641782024282-424.png||height="439" width="750" class="img-thumbnail"]]
158 158  
159 -**(3) Write single coil**
161 +**Write single coil**
160 160  
161 161  (% style="text-align:center" %)
162 -[[image:1641782057319-761.png||class="img-thumbnail" height="440" width="750"]]
164 +[[image:1641782057319-761.png||height="440" width="750" class="img-thumbnail"]]
163 163  
164 -**Tip:**
166 +Tip: (When writing a single coil or a continuous coil, write HFF00 to turn the coil on, and write H0000 to turn off the coil.)
165 165  
166 -**(When writing a single coil or a continuous coil, write HFF00 to turn the coil on, and write H0000 to turn off the coil.)**
168 +**Write single register**
167 167  
168 -**(4) Write single register**
169 -
170 170  (% style="text-align:center" %)
171 -[[image:1641782078927-432.png||class="img-thumbnail" height="442" width="750"]]
171 +[[image:1641782078927-432.png||height="442" width="750" class="img-thumbnail"]]
172 172  
173 -**(5) Write continuous coils**
173 +**Write continuous coils**
174 174  
175 175  (% style="text-align:center" %)
176 -[[image:1641782101687-540.png||class="img-thumbnail" height="452" width="750"]]
176 +[[image:1641782101687-540.png||height="452" width="750" class="img-thumbnail"]]
177 177  
178 -**(6) Write continuous registers**
178 +**Write continuous registers**
179 179  
180 180  (% style="text-align:center" %)
181 -[[image:1641782118748-978.png||class="img-thumbnail" height="448" width="750"]]
181 +[[image:1641782118748-978.png||height="448" width="750" class="img-thumbnail"]]
182 182  
183 +**PLC is slave devic**
183 183  
184 -**(7) PLC is slave devic**
185 -
186 186  [[image:1641782203514-616.png||height="230" width="746"]]
187 187  
188 188  
189 -**(8) WECON PLC Protocol (COM2)**
188 +**WECON PLC Protocol (COM2)**
190 190  
191 191  [[image:1641782240401-942.png||height="161" width="754"]]
192 192  
... ... @@ -194,14 +194,14 @@
194 194  
195 195  **LX3VP COM2 N:N Application**
196 196  
197 -== **2.1 LX3VP COM2 N:N Connection** ==
196 +== **LX3VP COM2 N:N Connection** ==
198 198  
199 199  PLC built-in N:N connection protocol provides a effective way to exchange data among multiple PLC (Max. 8 devices). Technically, it only requires the twisted pair RS485 cable to connect with each PLC COM2 (in parallel).
200 200  
201 201  (% style="text-align:center" %)
202 -[[image:9.Communication example_html_8c43baa1ae891689.jpg||class="img-thumbnail" height="142" width="500"]]
201 +[[image:9.Communication example_html_8c43baa1ae891689.jpg||height="142" width="500" class="img-thumbnail"]]
203 203  
204 -=== **2.1.1 COM2 N:N Instructions  ** ===
203 +== **COM2 N:N Instructions  ** ==
205 205  
206 206  User should put data to specified register unit. Exchanging the data among PLCs, This function only requires putting data in preset register block, all the data in this register block would share with other PLCs. There are five modes for choice, according to data volume and communication speed. See the preset register block from table below.
207 207  
... ... @@ -232,12 +232,12 @@
232 232  Communication between each PLC (up to 8 PLC), please see the connection construction below (For 3 PLC interconnection).
233 233  
234 234  (% style="text-align:center" %)
235 -[[image:9.Communication example_html_b805bca9e1166337.jpg||class="img-thumbnail" height="93" width="600"]]
234 +[[image:9.Communication example_html_b805bca9e1166337.jpg||height="93" width="600" class="img-thumbnail"]]
236 236  
237 -=== **2.1.2 The special devices in N: N network** ===
236 +== **Special devices in N: N network** ==
238 238  
239 239  (% border="1" %)
240 -|**Register**|**Description**
239 +|=**Register**|=**Description**
241 241  |D8120|Communication format settings
242 242  |D8126|COM2 communication protocol settings, 40h means N:N Master Device, 04h means N:N Slave device
243 243  |D8176|Station number, from 0 to 7, 0 means master device
... ... @@ -263,10 +263,10 @@
263 263  )))
264 264  |M8191|Processing sending data
265 265  
266 -=== **2.1.3 Communications format:** ===
265 +== **Communications format:** ==
267 267  
268 268  (% border="1" %)
269 -|**Item**|(% style="width:115px" %)**Parameters**|(% style="width:239px" %)**b15(RS2)**|**b14-b8**|**b7**|**b6**|**b5**|**b4**|**b3**|**b2**|**b1**|**b0**
268 +|=**Item**|=(% style="width: 115px;" %)**Parameters**|=(% style="width: 239px;" %)**b15(RS2)**|=**b14-b8**|=**b7**|=**b6**|=**b5**|=**b4**|=**b3**|=**b2**|=**b1**|=**b0**
270 270  |(% rowspan="2" %)**Bit mode**|(% style="width:115px" %)8 bit|(% style="width:239px" %)0|(% rowspan="15" %)Retention|-|-|-|-|-|-|-|-
271 271  |(% style="width:115px" %)16-bit|(% style="width:239px" %)1|-|-|-|-|-|-|-|-
272 272  |(% rowspan="6" %)**Baud rate (Bps)**|(% style="width:115px" %)115200|(% style="width:239px" %)-|1|1|0|0|-|-|-|-
... ... @@ -283,7 +283,7 @@
283 283  |(% rowspan="2" %)**Data bit**|(% style="width:115px" %)7 bit|(% style="width:239px" %)-|-|-|-|-|-|-|-|0
284 284  |(% style="width:115px" %)8 bit|(% style="width:239px" %)-|-|-|-|-|-|-|-|1
285 285  
286 -=== **2.1.4 Program example** ===
285 +== **Program example** ==
287 287  
288 288  LX3VP COM2 port communication parameters: 9600, 1, 8, NONE. Register block mode: 3
289 289  
... ... @@ -290,25 +290,28 @@
290 290  **PLC as master**
291 291  
292 292  (% style="text-align:center" %)
293 -[[image:9.Communication example_html_a3fdef81ab69639.jpg||class="img-thumbnail" height="448" width="750"]]
292 +[[image:9.Communication example_html_a3fdef81ab69639.jpg||height="448" width="750" class="img-thumbnail"]]
294 294  
295 -PLC as slave
294 +**PLC as slave**
296 296  
297 297  (% style="text-align:center" %)
298 -[[image:9.Communication example_html_cc8af72b56d9c539.jpg||class="img-thumbnail" height="236" width="750"]]
297 +[[image:9.Communication example_html_cc8af72b56d9c539.jpg||height="236" width="750" class="img-thumbnail"]]
299 299  
300 -**Note for use**
299 +(% class="box infomessage" %)
300 +(((
301 +✎**Note:**
301 301  
302 302  * There are two modes of N:N protocol configuration. one is LX3VP built-in N:N protocol, the other one is LX3V N:N protocol (LX3V-2RS485-BD required).
303 303  * In LX3VP series PLC, only one kind of N:N configuration available. Second mode would be disabled when LX3VP built-in N:N protocol configured.
305 +)))
304 304  
305 -== (% style="color:inherit; font-family:inherit" %)**3 RS485-BD and ETH-BD communiaction**(%%) ==
307 += (% style="color:inherit; font-family:inherit" %)**3 RS485-BD and ETH-BD communiaction**(%%) =
306 306  
307 307  Please kindly check the link as below.
308 308  
309 -(% class="box warningmessage" %)
311 +(% class="box infomessage" %)
310 310  (((
311 -**Note:**at present 5V PLC can not support RS485-BD and ETH-BD
313 +**Note:** at present 5V PLC can not support RS485-BD and ETH-BD
312 312  )))
313 313  
314 314  [[http:~~/~~/docs.we-con.com.cn/wiki/bdmodule/view/Main/Communication/2RS485-BD-3V/>>http://docs.we-con.com.cn/wiki/bdmodule/view/Main/Communication/2RS485-BD-3V/]]