Changes for page 07 Communication
Last modified by Devin Chen on 2024/08/19 14:28
From version 17.1
edited by Theodore Xu
on 2024/08/08 10:10
on 2024/08/08 10:10
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,1 @@ 1 -PLC Editor.WebHome 1 +PLC Editor.1 User Manual.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. AiXia1 +XWiki.admin - Content
-
... ... @@ -1,16 +1,16 @@ 1 -= **PLC COM2 Modbus RTU** = 1 += **1 PLC COM2 Modbus RTU** = 2 2 3 -== **Protocol Setting (D8126)** == 3 +== **1.1 Protocol Setting (D8126)** == 4 4 5 - |=(%scope="row" %)**Protocol**|=**Description**|=**Value of D8126**6 -| =WECONPLC Protocol|Using WECON PLC Protocol|01H7 -| =MODBUSRTU Master|PLCisslavedevice|02H8 -| =MODBUSASCIIMaster|PLC is slave device|03H9 -| =User-defined Protocol|Using User-defined Protocol|10H10 -| =MODBUS RTU Slave|PLC is master device|20H11 -| =MODBUS ASCII Slave|PLC is master device|30H5 +(% 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 12 12 13 -== **Communication format (D8120)** ==13 +== **1.2 Communication Format (D8120)** == 14 14 15 15 (% border="1" %) 16 16 |(% rowspan="2" %)**Item**|(% rowspan="2" %)**parameter**|(% colspan="8" %)**Bit value of D8120** ... ... @@ -39,14 +39,11 @@ 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 number) 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);]]) 43 43 44 -(% class="box infomessage" %) 45 -((( 46 46 **✎Note:** If use Data bit=7.Parity can not choose None. 47 -))) 48 48 49 -== **WECON PLC - MODBUS (Slave) addresses rules** == 46 +== **1.3 WECON PLC - MODBUS (Slave) addresses rules** == 50 50 51 51 (% border="1" %) 52 52 |(% colspan="3" %)** PLC Bit Address** ... ... @@ -57,9 +57,9 @@ 57 57 |S0 ~~ S999|0xE000 ~~ 0xE3E7|57344 ~~ 58343 58 58 |T0 ~~ T256|0xF000 ~~ 0xF100|61440 ~~ 61696 59 59 |C0 ~~ C255|0xF400 ~~ 0xF4FF|62464 ~~ 62719 60 -|X0 ~~ X 377|0xF800 ~~ 0xF8FF|63488 ~~ 6374361 -|Y0 ~~ Y 377|0xFC00 ~~ 0xFCFF|64512 ~~ 6476762 -|(% colspan="3" %)** PLC Word Address** 57 +|X0 ~~ X255|0xF800 ~~ 0xF9FE|63488 ~~ 63998 58 +|Y0 ~~ Y255|0xFC00 ~~ 0xFDFE|64512 ~~ 65022 59 +|(% colspan="3" %)** PLC Word Address** 63 63 |(% rowspan="2" %)PLC Address|(% colspan="2" %)MODBUS Address 64 64 |Hex|Decimal 65 65 |D0 ~~ D8255|0 ~~ 0x203F|0 ~~ 8255 ... ... @@ -67,9 +67,9 @@ 67 67 |C0 ~~ C199|0xF400 ~~ 0xF4C7|62464 ~~ 62663 68 68 |C200 ~~ C255|0xF700 ~~ 0xF7FF|63232 ~~ 63487 69 69 70 -== **MODBUS functioncodeintroduction** ==67 +== **1.4 MODBUS Function Code Introduction** == 71 71 72 -**Function code 0x01(01): read coil (bit address)** 69 +**(1) Function code 0x01(01): read coil (bit address)** 73 73 74 74 Frame format: Station number of slave&0x01 + start address + number of coils + CRC 75 75 ... ... @@ -81,7 +81,7 @@ 81 81 |4|(% style="width:352px" %)Number of coils|(% style="width:252px" %)2 bytes| 82 82 |5|(% style="width:352px" %)CRC|(% style="width:252px" %)2 bytes| 83 83 84 -**Function code 0x03(03): read register (word address)** 81 +**(2) Function code 0x03(03): read register (word address)** 85 85 86 86 Frame format: Station number of slave&0x03 + start address+ number of registers + CRC 87 87 ... ... @@ -93,7 +93,7 @@ 93 93 |4|Number of registers|2 bytes| 94 94 |5|CRC|2 bytes| 95 95 96 -**Function code 0x05(05): write single coil** 93 +**(3) Function code 0x05(05): write single coil** 97 97 98 98 Frame format: Station number of slave&0x05 + address + state of coil + CRC 99 99 ... ... @@ -105,7 +105,7 @@ 105 105 |4|State of coil|2 bytes| 106 106 |5|CRC|2 bytes| 107 107 108 -**Function code 0x06 (06): Write single register** 105 +**(4) Function code 0x06 (06): Write single register** 109 109 110 110 Frame format: Station number of slave&0x06 + address + value + CRC 111 111 ... ... @@ -117,7 +117,7 @@ 117 117 |4|Value of register|2 bytes| 118 118 |5|CRC|2 bytes| 119 119 120 -**Function code 0x0f(15): Write continuous coils** 117 +**(5) Function code 0x0f(15): Write continuous coils** 121 121 122 122 Frame format: Station number of slave&0x0f + start address + number of coils + length + state of coil + CRC 123 123 ... ... @@ -131,7 +131,7 @@ 131 131 |6|State of coils|[(N+7)/8] bytes| 132 132 |7|CRC|2 bytes| 133 133 134 -**Function code 0x10 (10): Write continuous registers** 131 +**(6) Function code 0x10 (10): Write continuous registers** 135 135 136 136 Frame format: Station number of slave&0x10 + start address + number of registers + length + value of register + CRC 137 137 ... ... @@ -145,61 +145,66 @@ 145 145 |6|Value of register|N*2 bytes| 146 146 |7|CRC|2 bytes| 147 147 148 -== **Example** == 145 +== **1.5 Example** == 149 149 150 -**Read bit address from device** 147 +**(1) Read bit address from device** 151 151 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.)** 150 + 152 152 (% style="text-align:center" %) 153 -[[image:1641781999957-637.png||height="390" width="750" class="img-thumbnail"]]152 +[[image:1641781999957-637.png||class="img-thumbnail" height="390" width="750"]] 154 154 155 -**Read word address from device** 154 +**(2) Read word address from device** 156 156 157 157 (% style="text-align:center" %) 158 -[[image:1641782024282-424.png||height="439" width="750" class="img-thumbnail"]]157 +[[image:1641782024282-424.png||class="img-thumbnail" height="439" width="750"]] 159 159 160 -**Write single coil** 159 +**(3) Write single coil** 161 161 162 162 (% style="text-align:center" %) 163 -[[image:1641782057319-761.png||height="440" width="750" class="img-thumbnail"]]162 +[[image:1641782057319-761.png||class="img-thumbnail" height="440" width="750"]] 164 164 165 -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.)164 +**Tip:** 166 166 167 -**Writ esingle register**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 168 168 +**(4) Write single register** 169 + 169 169 (% style="text-align:center" %) 170 -[[image:1641782078927-432.png||height="442" width="750" class="img-thumbnail"]]171 +[[image:1641782078927-432.png||class="img-thumbnail" height="442" width="750"]] 171 171 172 -**Write continuous coils** 173 +**(5) Write continuous coils** 173 173 174 174 (% style="text-align:center" %) 175 -[[image:1641782101687-540.png||height="452" width="750" class="img-thumbnail"]]176 +[[image:1641782101687-540.png||class="img-thumbnail" height="452" width="750"]] 176 176 177 -**Write continuous registers** 178 +**(6) Write continuous registers** 178 178 179 179 (% style="text-align:center" %) 180 -[[image:1641782118748-978.png||height="448" width="750" class="img-thumbnail"]]181 +[[image:1641782118748-978.png||class="img-thumbnail" height="448" width="750"]] 181 181 182 -**PLC is slave devic** 183 183 184 +**(7) PLC is slave devic** 185 + 184 184 [[image:1641782203514-616.png||height="230" width="746"]] 185 185 186 186 187 -**WECON PLC Protocol (COM2)** 189 +**(8) WECON PLC Protocol (COM2)** 188 188 189 189 [[image:1641782240401-942.png||height="161" width="754"]] 190 190 191 -= (% style="color:inherit; font-family:inherit" %)**N:N network**(%%) = 193 += (% style="color:inherit; font-family:inherit" %)**2 N:N network**(%%) = 192 192 193 193 **LX3VP COM2 N:N Application** 194 194 195 -== **LX3VP COM2 N:N Connection** == 197 +== **2.1 LX3VP COM2 N:N Connection** == 196 196 197 -PLC built-in N:N connection protocol provides a neffective 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).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). 198 198 199 199 (% style="text-align:center" %) 200 -[[image:9.Communication example_html_8c43baa1ae891689.jpg||height="142" width="500" class="img-thumbnail"]]202 +[[image:9.Communication example_html_8c43baa1ae891689.jpg||class="img-thumbnail" height="142" width="500"]] 201 201 202 -== **COM2 N:N Instructions ** == 204 +=== **2.1.1 COM2 N:N Instructions ** === 203 203 204 204 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. 205 205 ... ... @@ -230,12 +230,12 @@ 230 230 Communication between each PLC (up to 8 PLC), please see the connection construction below (For 3 PLC interconnection). 231 231 232 232 (% style="text-align:center" %) 233 -[[image:9.Communication example_html_b805bca9e1166337.jpg||height="93" width="600" class="img-thumbnail"]]235 +[[image:9.Communication example_html_b805bca9e1166337.jpg||class="img-thumbnail" height="93" width="600"]] 234 234 235 -== ** Special devices in N: N network** ==237 +=== **2.1.2 The special devices in N: N network** === 236 236 237 237 (% border="1" %) 238 -| =**Register**|=**Description**240 +|**Register**|**Description** 239 239 |D8120|Communication format settings 240 240 |D8126|COM2 communication protocol settings, 40h means N:N Master Device, 04h means N:N Slave device 241 241 |D8176|Station number, from 0 to 7, 0 means master device ... ... @@ -261,10 +261,10 @@ 261 261 ))) 262 262 |M8191|Processing sending data 263 263 264 -== **Communications format** == 266 +=== **2.1.3 Communications format:** === 265 265 266 266 (% border="1" %) 267 -| =**Item**|=(% style="width:;" %)**Parameters**|=(% style="width:;" %)**b15(RS2)**|=**b14-b8**|=**b7**|=**b6**|=**b5**|=**b4**|=**b3**|=**b2**|=**b1**|=**b0**269 +|**Item**|(% style="width:115px" %)**Parameters**|(% style="width:239px" %)**b15(RS2)**|**b14-b8**|**b7**|**b6**|**b5**|**b4**|**b3**|**b2**|**b1**|**b0** 268 268 |(% rowspan="2" %)**Bit mode**|(% style="width:115px" %)8 bit|(% style="width:239px" %)0|(% rowspan="15" %)Retention|-|-|-|-|-|-|-|- 269 269 |(% style="width:115px" %)16-bit|(% style="width:239px" %)1|-|-|-|-|-|-|-|- 270 270 |(% rowspan="6" %)**Baud rate (Bps)**|(% style="width:115px" %)115200|(% style="width:239px" %)-|1|1|0|0|-|-|-|- ... ... @@ -281,49 +281,32 @@ 281 281 |(% rowspan="2" %)**Data bit**|(% style="width:115px" %)7 bit|(% style="width:239px" %)-|-|-|-|-|-|-|-|0 282 282 |(% style="width:115px" %)8 bit|(% style="width:239px" %)-|-|-|-|-|-|-|-|1 283 283 284 -== ** Communicationerrorcode(D8211~~D8218)** ==286 +=== **2.1.4 Program example** === 285 285 286 -|=(% style="width: 195px;" %)**Error code**|=(% style="width: 881px;" %)**Description** 287 -|(% style="width:195px" %)1|(% style="width:881px" %)The monitoring period has elapsed, and the slave station has not responded to requests from the master station yet. 288 -|(% style="width:195px" %)2|(% style="width:881px" %)The other slave stations have responded to requests sent by the master station. 289 -|(% style="width:195px" %)3|(% style="width:881px" %)The count values in the parameter data do not match those responded by the slave stations. 290 -|(% style="width:195px" %)4|(% style="width:881px" %)The response messages from the slave stations are incorrect. 291 -|(% style="width:195px" %)17|(% style="width:881px" %)The monitoring period has elapsed,the master station has not sent a request to the next slave station yet. 292 -|(% style="width:195px" %)20|(% style="width:881px" %)The messages from the master station are incorrect. 293 -|(% style="width:195px" %)33|(% style="width:881px" %)The slave station is unresponsive. 294 -|(% style="width:195px" %)34|(% style="width:881px" %)The other slave stations have responded to requests sent by the master station. 295 -|(% style="width:195px" %)35|(% style="width:881px" %)The count values in the parameter data do not match those responded by the slave stations. 296 -|(% style="width:195px" %)49|(% style="width:881px" %)The slave station received requests from the master station before receiving the parameters. 297 - 298 -== **Program example** == 299 - 300 300 LX3VP COM2 port communication parameters: 9600, 1, 8, NONE. Register block mode: 3 301 301 302 302 **PLC as master** 303 303 304 304 (% style="text-align:center" %) 305 -[[image:9.Communication example_html_a3fdef81ab69639.jpg||height="448" width="750" class="img-thumbnail"]]293 +[[image:9.Communication example_html_a3fdef81ab69639.jpg||class="img-thumbnail" height="448" width="750"]] 306 306 307 - **PLC as slave**295 +PLC as slave 308 308 309 309 (% style="text-align:center" %) 310 -[[image:9.Communication example_html_cc8af72b56d9c539.jpg||height="236" width="750" class="img-thumbnail"]]298 +[[image:9.Communication example_html_cc8af72b56d9c539.jpg||class="img-thumbnail" height="236" width="750"]] 311 311 312 -(% class="box infomessage" %) 313 -((( 314 -✎**Note:** 300 +**Note for use** 315 315 316 316 * 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). 317 317 * 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. 318 -))) 319 319 320 -= (% style="color:inherit; font-family:inherit" %)**RS485-BD and ETH-BD communiaction**(%%) = 305 +== (% style="color:inherit; font-family:inherit" %)**3 RS485-BD and ETH-BD communiaction**(%%) == 321 321 322 322 Please kindly check the link as below. 323 323 324 -(% class="box in fomessage" %)309 +(% class="box warningmessage" %) 325 325 ((( 326 - ✎**Note:**311 +**Note:**at present 5V PLC can not support RS485-BD and ETH-BD 327 327 ))) 328 328 329 329 [[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/]]