Wiki source code of Siemens

Version 51.1 by Joe on 2024/06/11 18:41

Hide last authors
Theodore Xu 16.1 1 == **S7-200 Smart Serial** ==
2
Theodore Xu 31.1 3 **V-BOX setting**
Theodore Xu 27.1 4
Theodore Xu 33.1 5 (% style="width:1323.87px" %)
Theodore Xu 37.1 6 |**Items**|**Settings**|**Note**
7 |Protocol|(% style="width:783px" %)Siemens S7-200 CPU22x/Smart PPI|
8 |Connection|(% style="width:783px" %)RS485|
9 |Baud rate|(% style="width:783px" %)9600|
10 |Data bit|(% style="width:783px" %)8|
11 |Parity|(% style="width:783px" %)EVEN|
12 |Stop bit|(% style="width:783px" %)1|
13 |PLC station No.|(% style="width:783px" %)2|
Theodore Xu 27.1 14
15 (% style="text-align:center" %)
16 [[image:西门子200串口.png]]
17
Theodore Xu 31.1 18 **Address List **
Theodore Xu 27.1 19
Theodore Xu 39.1 20 |**Type**|**Device register**|**Format**|**Range**|**Note**
21 |(% rowspan="9" %)Bit|I|I ddddd.o|0.0~~99999.7|
22 |Q|Q ddddd.o|0.0~~99999.7|
23 |V|VWbit ddddd.o|0.0~~99999.7|
24 |V|V ddddd.o|0.0~~99999.7|
25 |M|M ddddd.o|0.0~~99999.7|
26 |SM|ddddd.o|0.0~~99999.7|
27 |S|ddddd.o|0.0~~99999.7|Read only
28 |T|ddddd|0~~99999|Timer state, read only
29 |C|ddddd|0~~99999|Counter state, read only
30 |(% rowspan="12" %)Word|I|IW ddddd|0~~99999|
31 |Q|QW ddddd|0~~99999|
32 |AI|AIW ddddd|0~~99999|
33 |AQ|VB ddddd|0~~99999|
34 |V|VW ddddd|0~~99998|(((
Theodore Xu 26.1 35 VW0=VB (0~~1)
36
37 VW2=VB (2~~3)
38
39 Address value is a multiple of 2
40 )))
Theodore Xu 39.1 41 |V|VD ddddd|0~~99998|(((
Theodore Xu 26.1 42 VD0=VB (0~~3)
43
44 VD2=VB (4~~7)
45
46 Address value is a multiple of 4
47 )))
Theodore Xu 39.1 48 |M|MB ddddd|0~~99999|
49 |M|MW ddddd|0~~99999|(((
Theodore Xu 26.1 50 MW0=MB(0~~1)
51
52 MW2=MB(2~~3)
53
54 Address value is a multiple of 2
55 )))
Theodore Xu 39.1 56 |M|MD ddddd|0~~99999|(((
Theodore Xu 26.1 57 MD0=MB(0~~3)
58
59 MD4=MB(4~~7)
60
61 Address value is a multiple of 4
62 )))
Theodore Xu 39.1 63 |T|TW ddddd|0~~99999|Value of timer
64 |C|CW ddddd|0~~99999|Value of counter
65 |W|SW ddddd|0~~99999|
Theodore Xu 26.1 66
Theodore Xu 31.1 67 **PLC setting**
Theodore Xu 20.1 68
69 (% style="text-align:center" %)
70 [[image:西门子软件版本.png]]
71
72 (% style="text-align:center" %)
73 [[image:485通讯配置.png]]
74
Theodore Xu 31.1 75 **Connect and Download**
Theodore Xu 20.1 76
77 (% style="text-align:center" %)
78 [[image:以太网 PC和PLC连接.png]]
79
80 (% style="text-align:center" %)
81 [[image:以太网下载.png]]
82
Theodore Xu 31.1 83 **Cable Wiring**
Theodore Xu 20.1 84
85 (% style="text-align:center" %)
86 [[image:485接线.png]]
87
Theodore Xu 14.1 88 == **S7-200 Smart Ethernet ** ==
Leo Wei 2.1 89
Theodore Xu 32.1 90 **V-BOX setting**
Theodore Xu 16.1 91
Theodore Xu 34.1 92 |**Items**|**Settings**
93 |Protocol|Siemens S7-200 Smart(Ethernet)
94 |Connection|Ethernet
95 |Port No.|102
96 |PLC station No.|2
Theodore Xu 29.1 97
Theodore Xu 16.1 98 (% style="text-align:center" %)
99 [[image:西门子200smart 以太网.png]]
100
Theodore Xu 32.1 101 **PLC setting**
Theodore Xu 14.1 102
103 (% style="text-align:center" %)
104 [[image:西门子软件版本.png]]
105
106 (% style="text-align:center" %)
107 [[image:以太网通讯配置.png]]
108
Theodore Xu 32.1 109 **Connect and Download**
Theodore Xu 14.1 110
111 (% style="text-align:center" %)
Theodore Xu 19.1 112 [[image:以太网 PC和PLC连接.png]]
113
114 (% style="text-align:center" %)
Theodore Xu 14.1 115 [[image:以太网下载.png]]
116
Theodore Xu 32.1 117 **Cable Wiring**
Theodore Xu 15.1 118
119 V-Box : RJ45 Ethernet interface
120
121 PLC : RJ45 Ethernet interface
122
123 (% style="text-align:center" %)
124 [[image:以太网连接.png]]
125
Theodore Xu 41.1 126 == **S7-300 Ethernet ** ==
Leo Wei 2.1 127
128 Supported Series: Siemens S7-300 series PLC
129
Theodore Xu 41.1 130 **V-BOX setting**
Leo Wei 2.1 131
132 |**Items**|**Settings**|**Note**
133 |Protocol|Simens S7-300 Ethernet|
134 |Connection|Ethernet|
135 |Port No.|102|
136 |PLC station No.|2|Need to be same as the PLC setting
137
Theodore Xu 41.1 138 **Address List**
Leo Wei 2.1 139
Theodore Xu 40.1 140 |**Type**|**Device register**|**Format**|**Range**|**Note**
141 |(% rowspan="4" %)Bit|I|I ddddd.o|0.0~~99999.7|
142 |Q|Q ddddd.o|0.0~~99999.7|
143 |M|M ddddd.o|0.0~~99999.7|
144 |DB0.DB~~DB99.DB|DBxDB nndddd.o|0.0~~99999999.7|(((
Leo Wei 2.1 145 nn: block number;
146
147 dddd: address;
148 )))
Theodore Xu 40.1 149 |(% rowspan="8" %)Word|I|IW ddddd|0~~99999|
150 |Q|QW ddddd|0~~99999|
151 |(% rowspan="3" %)M|MB ddddd|0~~99999|
152 |MW ddddd|0~~99999|(((
Leo Wei 2.1 153 MW0=MB(0~~1)
154
155 MW2=MB(2~~3)
156
157 Address value is a multiple of 2
158 )))
Theodore Xu 40.1 159 |MD ddddd|0~~99999|(((
Leo Wei 2.1 160 MD0=MB(0~~3)
161
162 MD4=MB(4~~7)
163
164 Address value is a multiple of 4
165 )))
Theodore Xu 40.1 166 |(% rowspan="3" %)DB0.DB~~DB99.DB|DBxDBB nndddd|0~~99999999|(% rowspan="3" %)(((
Leo Wei 2.1 167 nn: block number;
168
169 dddd: address
170 )))
Theodore Xu 40.1 171 |DBxDBW nndddd|0~~99999999
172 |DBxDBD nndddd|0~~99999999
Leo Wei 2.1 173
Theodore Xu 41.1 174 **Configure the communication protocol**
Leo Wei 2.1 175
Theodore Xu 41.1 176 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_8e00ed9483ddb629.png||alt="image-20220824161345-1.png" height="1011" width="1920"]]
Leo Wei 2.1 177
Theodore Xu 41.1 178 **Cable Wiring**
Leo Wei 2.1 179
Theodore Xu 41.1 180 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_ac8ece9a26719fda.png||alt="image-20220824161450-2.png" height="170" width="401"]]
Leo Wei 2.1 181
Theodore Xu 45.1 182 == **S7-1200 Ethernet ** ==
Leo Wei 2.1 183
184 [[download link>>url:https://ftp.we-con.com.cn/Download/WIKI/V-BOX/Demo/%E9%80%9A%E8%AE%AF%E6%A1%88%E4%BE%8B/Communicate%20with%20S7-1200%20via%20Ehernet.zip]]
185
Theodore Xu 45.1 186 **V-BOX Setting**
187
188 |**Items**|**Settings**|**Note**
189 |Protocol|Siemens S7-1200|
190 |Connection|Ethernet|
191 |Port No.|102|
192 |PLC station No.|2|
193
Theodore Xu 46.1 194 (% style="text-align:center" %)
195 [[image:西门子1200协议参数.png]]
196
Theodore Xu 45.1 197 **Address List**
198
199 |**Type**|**Device register**|**HMI register**|**Format**|**Range**|**Note**
200 |(% rowspan="4" %)Bit|I|I|M d.o|(((
201 d:0~-~-9999
202
203 o:0-7
204 )))|
205 |Q|Q|Q d.o|(((
206 d:0~-~-9999
207
208 o:0-7
209 )))|
210 |M|M|M d.o|(((
211 d:0~-~-9999
212
213 o:0-7
214 )))|
215 |DB0.DB-DB99.DB|DBxDB|DBxDBnndddd.o|(((
216 nn:0-9999,
217
218 dddd:0-9999,
219
220 o:0-7
221 )))|(((
222 nn:DB No.
223
224 dddd:address value
225
226 o: digit address
227 )))
228 |(% rowspan="8" %)Word|M|MB|MB d|d:0-99999|
229 |M|MW|MW d|d:0-99999|(((
230 MW0=MB(0~~1)
231
232 MW2=MB(2~~3)
233
234 Address value is a multiple of 2
235 )))
236 |M|MD|MD d|d:0-99999|(((
237 MD0=MB(0~~3)
238
239 MD4=MB(4~~7)
240
241 Address value is a multiple of 4
242 )))
243 |I|IW|IW d|d:0-99999|
244 |Q|QW|QW d|d:0-99999|
245 |DB0.DB-DB99.DB|DBxDBB|DBxDBBnndddd|(((
246 nn:0-9999
247
248 dddd:0-9999
249 )))|(((
250 nn:DB No.
251
252 dddd:address value
253 )))
254 |DB0.DB-DB99.DB|DBxDBW|DBxDBWnndddd|(((
255 nn:0-9999
256
257 dddd:0-9999
258 )))|(((
259 nn:DB No.
260
261 dddd:address value
262
263 Address value is a multiple of 2
264 )))
265 |DB0.DB-DB99.DB|DBxDBD|DBxDBDnndddd|(((
266 nn:0-9999
267
268 dddd:0-9999
269 )))|(((
270 nn:DB No.
271
272 dddd:address value
273
274 Address value is a multiple of 4
275 )))
276
Theodore Xu 46.1 277 {{info}}
278 ✎Note:
Theodore Xu 45.1 279
Theodore Xu 46.1 280 * The S7-1200 supports simultaneous connection of three devices.
281 * V-BOX access PLC, use S7 protocol, access PLC TSAP 02.01 (S7-1200 PROFINET interface only supports three connections, the default support), detailed reference to the system manual of S7-1200.
282 * S7-1200 String type, the default first two bytes are used to store the maximum character and valid characters, so the text data will be shifted back one word address. When interacting with the data, what way this address plc is displayed with is unknown. And because of an extra word of data causes us to display the wrong. The solution is if we use String, then the actual data address we want to operate on is actually shifted back two bytes, so as long as the address on the project is shifted back 2 bits to correspond with the actual data address.
283 {{/info}}
Theodore Xu 45.1 284
Theodore Xu 46.1 285 **PLC Settings**
286
287
Joe 51.1 288 In the Project tree [PLC project]→Right-click[PLC-1]→[Properties]→[General]→[PROFINE interface]→[Add new subnet]→[IP address]192.168.40.20,[Subnet mask]255.255.255.0→[OK]
Theodore Xu 46.1 289
290 (% style="text-align:center" %)
Joe 51.1 291 [[image:图片1.png]]
Theodore Xu 46.1 292
Joe 51.1 293 Open [Properties] again→[General]→[Protection&Security]→[Connection mechanisms]→Check [Permit access with PUTIGET communication remote partner ]→[OK]
294
295 (% style="text-align:center" %)
296 [[image:图片2.png]]
297
298
Theodore Xu 46.1 299 Address settings, using BD2 as example.
300
301 * DB×DBB2xxxx, DB×DBW2xxxx, DB×DBD2xxxx for accessing data of DB2 in B1.
302 * 2 represent DB block number
303 * xxxx represent address
304
305 **Such as:**
306
307 * DBxDBB20000 = DB2.DBB0
308 * DBxDBW20004 = DB2.DBW4
309
310 (% style="text-align:center" %)
311 [[image:xwiki_PIStudio_12.PLC+protocols_WebHome_8ee8d3ac3637bfc4.png]]
312
Joe 49.3 313 **How to setting String in PLC and V-net**
314 PLC configuration
315
316 choosing Data type~-~-String→add"[]" after String and input data length
317
318 (% style="text-align:center" %)
319 [[image:yUYuRVmMcL.png]]
320
321 V-box configuration
322
323 (% style="text-align:center" %)
324 [[image:BSRBeEWL0O.png]]
325
Joe 49.4 326 choosing Word and DBxDBW →input  Register Main No. →Data format is String →input data length you want to use → choosing Byte order~-~-Little-endian
Joe 49.3 327
Joe 49.4 328 (% class="box infomessage" %)
329 (((
330 Note: Register Main No. = offset in PLC + 2
331 For example, the image above has an offset of 4, so the register Main No. is 10006
332 If an offset is 8, the register Main No. is 10010
333 )))
334
Theodore Xu 46.1 335 **How to connect with S7-1200 Firmware V4.0**
336
337 PLC configuration
338
339 * Double click [device configuration] in Siemens via software
340 * Double click [protection] to enter protection configuration screen
341
342 (% style="text-align:center" %)
343 [[image:xwiki_PIStudio_12.PLC+protocols_WebHome_664a826cd356c830.png]]
344
345 * Check [Permit access with PUT / GET communication from remote partner (PLC, HMI, OPC, ...)]
346
347 (% style="text-align:center" %)
348 [[image:xwiki_PIStudio_12.PLC+protocols_WebHome_78026942a88f0fdb.png]]
349
350 DB settings
351
352 * Right click [DB], select [properties]
353 * Uncheck [optimized block access]
354
355 **Cable Wiring**
356
357 (% style="text-align:center" %)
358 [[image:xwiki_PIStudio_12.PLC+protocols_WebHome_ac8ece9a26719fda.png]]
359
Leo Wei 25.2 360 == **S7-XXX Ethernet** ==
Leo Wei 2.1 361
362 Supported Series: Siemens S7-400, S7-1200 and S7-1500
363
Theodore Xu 44.1 364 **V-BOX setting**
Leo Wei 2.1 365
366 |=**Items**|=**Settings**|=**Note**
367 |Protocol|Siemens S7-XXX|
368 |Connection|Ethernet|
369 |Port No.|102|
370 |Device No.|Slot (Default 1 for S7-1500/ 2 for S7-1200/ 3 for S7-400)|
371 |HMI No.|Rack (Default as 0)|
372
373 Slot from TIA Portal is equal to Device No. of V-net
374
375 Rack from TIA Portal is equal to HMI No. of V-net
376
Theodore Xu 44.1 377 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_d78bc267e5fc6394.png||alt="image-20220824162459-3.png" height="503" width="798"]]
Leo Wei 2.1 378
Theodore Xu 44.1 379 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_c9ae84ef5d418580.png||alt="image-20220824163305-2.png" height="1009" width="1920"]]
Leo Wei 2.1 380
Theodore Xu 44.1 381 **Address List**
Leo Wei 2.1 382
Theodore Xu 42.1 383 |**Type**|**Device register**|**Format**|**Range**|**Note**
384 |(% rowspan="4" %)Bit|I|M d.o|(((
Leo Wei 2.1 385 d:0~-~-9999
386
387 o:0-7
388 )))|
Theodore Xu 42.1 389 |Q|Q d.o|(((
Leo Wei 2.1 390 d:0~-~-9999
391
392 o:0-7
393 )))|
Theodore Xu 42.1 394 |M|M d.o|(((
Leo Wei 2.1 395 d:0~-~-9999
396
397 o:0-7
398 )))|
Theodore Xu 42.1 399 |DB0.DB-DB99.DB|DBxDBnndddd.o|(((
Leo Wei 2.1 400 nn:0-9999,
401
402 dddd:0-9999,
403
404 o:0-7
405 )))|(((
406 nn:DB No.
407
408 dddd:address value
409
410 o: digit address
411 )))
Theodore Xu 42.1 412 |(% rowspan="8" %)Word|M|MB d|d:0-99999|
413 |M|MW d|d:0-99999|(((
Leo Wei 2.1 414 MW0=MB(0~~1)
415
416 MW2=MB(2~~3)
417
418 Address value is a multiple of 2
419 )))
Theodore Xu 42.1 420 |M|MD d|d:0-99999|(((
Leo Wei 2.1 421 MD0=MB(0~~3)
422
423 MD4=MB(4~~7)
424
425 Address value is a multiple of 4
426 )))
Theodore Xu 42.1 427 |I|IW d|d:0-99999|
428 |Q|QW d|d:0-99999|
429 |DB0.DB-DB99.DB|DBxDBBnndddd|(((
Leo Wei 2.1 430 nn:0-9999
431
432 dddd:0-9999
433 )))|(((
434 nn:DB No.
435
436 dddd:address value
437 )))
Theodore Xu 42.1 438 |DB0.DB-DB99.DB|DBxDBWnndddd|(((
Leo Wei 2.1 439 nn:0-9999
440
441 dddd:0-9999
442 )))|(((
443 nn:DB No.
444
445 dddd:address value
446
447 Address value is a multiple of 2
448 )))
Theodore Xu 42.1 449 |DB0.DB-DB99.DB|DBxDBDnndddd|(((
Leo Wei 2.1 450 nn:0-9999
451
452 dddd:0-9999
453 )))|(((
454 nn:DB No.
455
456 dddd:address value
457
458 Address value is a multiple of 4
459 )))
460
Theodore Xu 44.1 461 **Configure the communication protocol**
Leo Wei 2.1 462
Theodore Xu 44.1 463 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_9e740a8bf83ea3bf.png||alt="image-20220824163448-3.png" height="557" width="974"]]
Leo Wei 2.1 464
465 **✎Note:**
466
467 * The S7-1200 supports simultaneous connection of three devices, so the driver supports simultaneous access to PLC by three V-BOX.
468 * V-BOX access PLC, use S7 protocol, access PLC TSAP 02.01 (s7-1200 PROFINET interface only supports three connections, the default support), detailed reference to the system manual of S7-1200.
469
Theodore Xu 44.1 470 **Cable Wiring**
Leo Wei 2.1 471
Theodore Xu 44.1 472 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_ac8ece9a26719fda.png||alt="image-20220824162342-2.png" height="170" width="401"]]
Leo Wei 2.1 473
474 == {{id name="HLOGOEthernet"/}}**LOGO Ethernet ** ==
475
476 Supported Series: Siemens Logo 0BA0, 0BA1 series
477
478 **V-BOX Settings**
479
480 |**Items**|**Settings**|**Note**
481 |Protocol|Siemens LOGO|
482 |Connection|Ethernet|
483 |Port No.|102|
484 |PLC station No.|2|
485
486 **Address List**
487
488 |**Number**|**Address Type**|**Data Type**|**Range**|**DB Address**|**PLC Address**
489 |1|RTC|Word|1-7|DB1.DBX984.0|0x001ec0
490 |2|VB|Byte|0-1469|DB1.DBX0.0|0x000000
491 |3|VD|Double Word|0-1466|DB1.DBX0.0|0x000000
492 |4|VW|Word|0-1468|DB1.DBX0.0|0x000000
493 |5|NAQ|Word|1-32|DB1.DBX1406.0|0x002bf0
494 |6|NAI|Word|1-64|DB1.DBX1262.0|0x002770
495 |7|AM|Word|1-64|DB1.DBX1118.0|0x0022f0
496 |8|AQ|Word|1-16|DB1.DBX1072.0|0x002180
497 |9|AI|Word|1-16|DB1.DBX1032.0|0x002040
498 |10|I|Bit|1-64|DB1.DBX1024.0|0x002000
499 |11|Q|Bit|1-64|DB1.DBX1064.0|0x002140
500 |12|M|Bit|1-112|DB1.DBX1104.0|0x002280
501 |13|NI|Bit|1-128|DB1.DBX1246.0|0x0026f0
502 |14|NQ|Bit|1-128|DB1.DBX1390.0|0x002b70
503 |15|V|Bit|0-14697|DB1.DBX0.0|0x000000
504
505 **PLC Settings in LOGO Software:**
506
507 Click [Tools]~-~-[Ethernet Connections],shown as below.
508
Theodore Xu 46.1 509 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_d13df637bfedcc52.png||alt="12.PLC Protocol_html_8b9d2322edf89519.png" height="641" width="423"]]
Leo Wei 2.1 510
511 Set Ethernet connection parameter. IP, Subnet Mask, shown as below.
Joe 50.2 512
Leo Wei 2.1 513
Joe 48.2 514 (% style="text-align:center" %)
Joe 50.2 515 [[image:1iZSZTpAdk.png]]
Leo Wei 2.1 516
Joe 50.2 517 **TSAP set**: The value set by local TSAP is the remote TSAP set in HMI. PLC's remote TSAP is the opposite, shown as below.
Leo Wei 2.1 518
Theodore Xu 46.1 519 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_facc6ee1af05162f.png||alt="image-20221228143047-5.png" height="626" width="1088"]]
Leo Wei 2.1 520
521 **Download Project**: Click "Address book" to add the IP address to be downloaded (fi."Detect" to check whether the IP address can be detected. Then click “ok”, and the system will prompt that PLC will be "STOP" mode. Click “YES” to start download.
522
Theodore Xu 46.1 523 [[image:xwiki_V-BOX_V-Net_Training_1+Communication_WebHome_d43d2b7b2599ee64.png||alt="image-20221228143246-6.png" height="698" width="688"]]
Leo Wei 2.1 524
525 **V-BOX Communication Settings**
526
527 Set PLC IP in [IP Address] settings;
528
Theodore Xu 47.1 529 (% style="text-align:center" %)
Theodore Xu 48.1 530 [[image:V-NET_Client logo.png]]
Leo Wei 2.1 531
532 TSAP setting
533
534 * The initialization script needs to set the source TSAP address and the target TSAP address, otherwise the communication will not be successful.
535
Joe 48.2 536 You can copy the following script into V-net directly.
537
538 (% class="box successmessage" %)
539 (((
Leo Wei 2.1 540 **function** **init**.main()
541 addr_setword("@W_0#HSW1200",8192) //~-~- Set the source TSAP address//
542 addr_setword("@W_0#HSW1201",4096) //~-~- Set the destination TSAP address//
Theodore Xu 17.1 543 **end**
Joe 48.2 544 )))
Leo Wei 2.1 545
Joe 48.2 546 (% class="box infomessage" %)
547 (((
548 Note:
549 The name of the test script must be “init”, 8192 and 4096 are the data used for the test, there is no HSW address in the register option, but you can directly set the value of the corresponding address through the code.
550 )))
Leo Wei 2.1 551
552 **✎Note:**
553
554 * **Communication port configuration: **
555 ** Continuous length needs to be set to 0.
556 ** Integration interval needs to be set to 1. (no change may result in data errors)
557 ** Set Port and Device Station NO.
558 ** Other set as defaulted.
559 * **Notes on the use of registers:**
560 ** Register VD: Use only registers that are multiples of 4, such as 0, 4, 8, etc.
Joe 48.2 561 ** Register VW: Use only registers they are multiples of 2, such as 0, 2, 4 etc. (Using an odd-length register may result in data errors, such as 2 3 4 )