Wiki source code of 07 EtherCAT

Last modified by Iris on 2026/04/15 16:37

Hide last authors
Wecon 1.1 1 == **Description** ==
2
3 EtherCAT is an open industrial field technology based on Ethernet, which has the characteristics of short communication refresh cycle, small synchronization jitters, and low hardware cost.
4
5 == **Master station configuration** ==
6
7 Double-click the EtherCAT node of the project management tree to pop up the EtherCAT configuration, modify the configuration and save it.
8
9 [[image:1744341705534-984.png]]
10
11 == **Configuration description** ==
12
13 1. Synchronous unit cycle: how long does it take to synchronize data.
14 1. PreOP->OP timeout: the timeout from PreOP state to OP state during the initialization of OP;
15 1. Automatically restart slave station: after it is enabled, if the slave is offline or powered off, it will try to recover to OP status;
16 1. EtherCAT enables following PLC RUN status: after it is enabled, PLC RUN triggers EtherCAT to execute the process to OP;
17 1. Synchronous offset: the percentage of time offset allowed during synchronization;
18 1. Offline shutdown of EtherCAT bus: if a device is offline, the EtherCAT function will be disabled and all stations will switch to PreOP state. If automatic restart of slaves is enabled, it will be all restarted.
19
20 == **Import and add slaves** ==
21
22 === **Import configurations** ===
23
24 Right-click the EtherCAT node in the project management tree, click New, click the Import button in the pop-up Add Slave window, and select the EtherCAT xml file of the corresponding manufacturer to import.
25
26 [[image:1744341765703-669.png]]
27
28 === **Add a slave station** ===
29
30 Right-click the EtherCAT node in the project management, click New, select a slave type and click Add, a new slave node will be added to the EtherCAT node in the project management, and click Close to end the operation of adding a slave.
31
32 [[image:1744341765720-985.png]]
33
34 === **Copy to new item** ===
35
36 Right-click to select the slave node under the EtherCAT node in the project management, click “Copy to New Item”, and create a new slave node with exactly the same configuration as the selected node.
37
38 [[image:1744341765723-496.png]]
39
40 === **Slave station configuration** ===
41
42 === **Delete** ===
43
44 ① Right-click the EtherCAT node, select [Delete all], and delete all currently created slave station configurations.
45
46 [[image:1744341765723-851.png]]
47
48 ② Right-click the slave station under the EtherCAT node, select Delete, and delete the current slave station configuration.
49
50 [[image:1744341765724-681.png]]
51
52 === **Update devices** ===
53
54 ① Right-click the EtherCAT node and select [Update All Devices] to update the configuration information of the current EtherCAT node to the newly imported EtherCAT configuration file information.
55
56 [[image:1744341765725-408.png]]
57
58 [[image:1744341765725-319.png]]
59
60 ② Right-click the slave station under the EtherCAT node, select [Update equipment], and update the configuration information of the corresponding slave station node to the newly imported EtherCAT configuration file information.
61
62 [[image:1744341765726-520.png]]
63
64
Iris 4.1 65 === **Slave station parameters** ===
Wecon 1.1 66
67 [[image:1744341765727-592.png]]
68
69 Double-click the slave station under the EtherCAT node, and the EtherCAT configuration dialog box will pop up. In the slave station parameter interface, check the enable expert parameter to use the expert process data interface and the check box and edit box below.
70
71 ▪Check Vendor ID: During activation, check whether the downloaded slave configuration is consistent with the slave vendor ID connected to the PLC;
72
73 ▪Check Product ID: During activation, check whether the downloaded slave configuration is consistent with the slave product ID connected to the PLC;
74
75 ▪Check version number: Check whether the version numbers are consistent when activated;
76
77 ▪SDO access timeout: Set the SDO access time.
78
79 === **Distributed clock** ===
80
81 This part is used to set the synchronous operation mode of the slave station. The interface is as follows:
82
83 [[image:1744341789527-748.png]]
84
85 Sync unit mode: Generally, EtherCAT slave stations have FreeRun mode, running mode synchronized with input and output events (SM-Synchron), and running mode synchronized with distributed clock (DC-Synchron). Depending on the selected slave station, the options supported by the synchronous unit mode will be different.
86
87 Take the Wecon VD3E EtherCAT Servo V1.11 module as an example. This module supports SM-Synchron mode, and neither SYNC0 nor SYNC1 can be set. There is only one interrupt of data input and output events inside the clock slave station. The processing logic inside the slave station is shown in the following figure:
88
89 [[image:1744341789530-451.png]]
90
91 At the same time, this module also supports DC-Synchron mode. In this mode, the Sync interrupt of the slave station can be configured. DC synchronization events are enabled by default, and SYNC0 interrupt is enabled. The cycle of SYNC0 interrupt is the same as the synchronization cycle of the EtherCAT master station. SYNC1 interrupt is not enabled.
92
93 [[image:1744341789531-717.png]]
94
95 When "Enable expert parameters" is checked, select DC mode in the drop-down box, such as "DC-Synchron", and check "Enable cycle synchronization event". SYNC0 and SYNC1 groups will be restored from the disabled state to the enabled status, and SYNC0 enable button will be checked by default. The configuration is shown in the figure below:
96
97
98 [[image:1744341789531-396.png]]
99
100 The drop-down box selects a non-DC mode, such as "SM-Synchron", the SYNC0 and SYNC1 groups are all grayed out, and the cycle time and offset time are both 0.
101
102 [[image:1744341789532-901.png]]
103
104
105
106 === **Alias settings** ===
107
108 Check "Enable expert parameters" to set the slave alias, or check "Equipment optional" to force the slave to configure the alias. To use the site alias function correctly, please follow the following steps:
109
110 ~1. Create the configuration, uncheck "Alias Enable", and wait for the slave station to start normally after downloading the program.
111
112 2. Check "Enable expert parameters" or "equipment optional" and enter an alias.
113
114 [[image:1744341789533-378.png]]
115
116 3. In monitoring mode, click the "Write EEPROM" button and wait for the writing to complete.
117
118 [[image:1744341789534-367.png]]
119
120
121 4. After the writing is completed, re-power the slave station and check whether the alias was really written successfully through automatic scanning.
122
123
124 === **Expert parameters** ===
125
126 [[image:1744341789534-573.png]][[image:1744341789535-883.png]]
127
128 ▪Select ① the synchronization manager table area, select input and output, and ② the PDO allocation table area will be updated with the PDO allocation list corresponding to the output or input of the synchronization manager;
129
130 ▪Check or uncheck to enable the ②PDO allocation form area, which will be fed back to the ③PDO list;
131
132 ▪Select the checked row in the ③PDO list, and the contents of the ④PDO content table will be updated;
133
134 ▪In the ④PDO content table, right-click the menu and select Add or click the ⑤Add button, select the content to be added in the Add PDO content interface, and then click Add;
135
136 ▪After selecting the content to be deleted in the ④PDO content table, right-click the menu and select Delete or directly click the ⑥Delete button to delete.
137
138 === **Process data** ===
139
140 Except that the process data interface cannot customize the PDO content, other functions are basically the same as the expert process parameters.
141
142 [[image:1744341815071-354.png]]
143
144 === **I/O mapping** ===
145
146 For the PDO content set by the process parameters, user can select devices or variables for mapping.
147
148 [[image:1744341815073-664.png]]
149
150 === **Start-up parameters** ===
151
152 [[image:1744341815074-991.png]]
153
154 **① Add**
155
156 Right-click the menu to select [Add] or click [Add] directly to enter the interface for adding startup parameters, select the corresponding item, and add startup parameters.
157
158 **② Delete**
159
160 After selecting the parameter content to be deleted, right-click the menu and select delete or directly click the delete button to delete.
161
162 === **Slave information** ===
163
164 Display slave station information.
165
166 [[image:1744341815074-931.png]]
167
168 == **Alias** ==
169
170 === **Alias parameter configuration** ===
171
172 Check [Enable expert parameters] and [Equipment optional] to use [Alias] function.
173
174 After [Expert parameters] enables, you can choose whether you need alias.
175
176 After [Equipment optional] enables, alias forcibly enables.
177
178
179 [Equipment optional] means that this device is an optional device and may not exist. When the device cannot be found, it will not run. If MC_POWER runs, it will not be successful and report error. [Alias enable] is forcibly turned on, that is, when the corresponding device must be found through alias and the product information must be checked, the product must be matched before it can be recognized normally.
180
181 If it is an alias set in [Expert mode], even if the alias is not found, the equipment of the corresponding model can run normally if it is found in order.
182
183 **Example**
184
185 1. 5 devices: A, B, C, D, E. The link order is E, D, A, C, B, which will be searched according to aliases, and all of them correspond to configuration order. It will run normally.
186
187 |**Configuration order**|**Alias**|**Link order**|**Alias**
188 |A|1|E|5
189 |B|2|D|4
190 |C|3|A|1
191 |D|4|C|3
192 |E|5|B|2
193
194 1. 5 devices: A, B, C, D, E. Check [Equipment optional], and the order of links is d, a, c, and b. When using e, the corresponding FB will report an error, but it will not affect the use and operation of other devices;
195
196 |**Configuration order**|**Alias**|**Link order**|**Alias**
197 |A|1|D|4
198 |B|2|A|1
199 |C|3|C|3
200 |D|4|B|2
201 |E|5| |
202
203 1. 5 devices: A, B, C, D, E. C and E turn on [Device optional], and the link order is e, d, c, b. Since a does not turn on [Device optional] and cannot be found at the same time,When OP, it cannot be OP, the error "Device not found" will be reported.
204
205 |**Configuration order**|**Alias**|**Link order**|**Alias**
206 |A|1|E|5
207 |B|2|D|4
208 |C|3|C|3
209 |D|4|B|2
210 |E|5| |
211
212 If it is an alias set in expert mode, even if the alias is not found, the device of the corresponding model can run normally if it is found in order.
213
214 **Example**
215
216 5 devices: A, B, C, D, E. The link order is e, d, a, c, b.
217
218 The aliases b, d, and e are all corresponding. At this time, a and c will be found if they do not match. (After b, d, and e are matched, pull out these three units from both sides, and then it becomes: Configure the order, a, c, and find the link sequence so that a and c can be found.
219
220 |**Configuration order**|**Alias**|**Link order**|**Alias**
221 |A|1|E|5
222 |B|2|D|4
223 |C|3|A|10
224 |D|4|C|30
225 |E|5|B|2
226
227 If the aliases of a, d, and e correspond, b and c cannot be found if they do not match. (After the same removal, configure the order, b, c, search link sequence. So, c, b can't be found.)
228
229
230 |**Configuration order**|**Alias**|**Link order**|**Alias**
231 |A|1|E|5
232 |B|2|D|4
233 |C|3|A|1
234 |D|4|C|30
235 |E|5|B|20
236
237 **Note**
238
239 If [Expert mode] and [Equipment optional] are both checked, it will run according to [Equipment optional];
240
241 l At present, the first version does not support the situation that there are more linked devices than the configured ones, and there are more devices that can be linked normally;
242
243 For example, link 5 devices configured5 units, if one of them is set with [Device Optional] but there is no correspondence, it cannot be enabled at this time;
244
245 In addition, uncheck [Manufacturer id] and [Model check], although in some cases you can only check alias correspondence, and sequential matches are forced. But there is no guarantee that it will operate normally;
246
247 Except 0 aliases, aliases that can be normally corresponded are not allowed to be duplicated. Before OP, this section will be checked (SM1900 off->on Instantaneous detection), for example, during the process, it is allowed to set two identical aliases to the slave station, but after setting OP again(instruction or STOP RUN Errors will also be reported.
248
249
250
251 === **Alias writes to servo** ===
252
253
254 In monitoring mode, click on the EtherCAT device interface in the project management interface.
255
Iris 3.1 256 (% style="text-align:center" %)
257 [[image:1774921706980-630.png||height="388" width="320"]]
Wecon 1.1 258
259 At this time, the following interface appears. Different from the non-monitoring mode, [Write EEprom] appears. This button writes the alias to the corresponding servo.
260
Iris 3.1 261 (% style="text-align:center" %)
262 [[image:1774921736912-237.png]]
Wecon 1.1 263
264 The execution rules for this key are:
265
266 After OP, (SM1902 ON) will be set according to the device corresponding to the configuration. If there is no correspondence, it will prompt that the setting failed;
267
268 Before OP, (SM1902 OFF) is aliased according to the link sequence Regardless of whether the model corresponds or not, set it directly. If there is no correspondence, the setting will fail.
269
270
Iris 3.1 271 **Simple configuration instance**
Wecon 1.1 272
273 When an EtherCAT device configuration exists, open the EtherCAT configuration of the corresponding slave station.
274
275 1Check [Start Expert Parameters] and [Alias Enable], and then configure the corresponding alias to be written into the "Alias Address"; 2 Save the configuration and download it to Run in PLC;
276
Iris 3.1 277 (% style="text-align:center" %)
278 [[image:1774921785975-984.png]]
Wecon 1.1 279
280 When the link sequence corresponds, the corresponding servo can still be matched. 3Open the software device monitoring interface and observe that SM1902 is ON;
281
Iris 3.1 282 Open the EtherCAT configuration interface, click [Write EEprom], and write the alias to Servo;
Wecon 1.1 283
Iris 3.1 284 (% style="text-align:center" %)
285 [[image:1774921849319-426.png]]
Wecon 1.1 286
Iris 3.1 287 (% style="text-align:center" %)
288 [[image:1774921877348-328.png]]
Wecon 1.1 289
290 Restart the servo and PLC can be matched by alias.
291
Iris 3.1 292 (% style="text-align:center" %)
293 [[image:1774921899334-213.png||height="228" width="362"]]
Wecon 1.1 294
295 Then check [Device optional] in edit mode.
296
Iris 3.1 297 [[image:1774921964285-625.png]]
Wecon 1.1 298
299 After removing the linked EtherCAT device and re-downloading the ladder diagram that checks the optional device, the ladder diagram can still start normally. However, MC_POWER corresponding to the axis cannot be started (but no error will be reported), and the IO mapping does not work.
300
301 In the same ladder diagram, connect the corresponding equipment, and then stop->run. The corresponding device of run PLC can be used normally.
302
303
304 === **Expert parameters** ===
305
Iris 3.1 306 (% style="text-align:center" %)
307 [[image:1774922011354-552.png]]
Wecon 1.1 308
309 . Select ① Synchronization Manager table area, select input and output, ② PDO allocation table area will be updated to synchronization manager output or the PDO allocation list corresponding to input;
310
311 . Check or uncheck “enable ② PDO allocation table area”, which will be fed back to the ③ PDO list;. Select the checked row in the ③ PDO list to update the ④ PDO content table;
312
313 . In the ④ PDO content table, right-click to select Add or click the ⑤ Add to add Select the content to be added in the PDO content interface and click Add;
314
315 . After selecting the content to be deleted in the ④ PDO content table, right-click the menu to select Delete or directly click the ⑥ Delete button to delete it.
316
317
318 === **Process Data** ===
319
320 The process data interface is basically consistent with the expert process parameter functions except that PDO content cannot be customized.
321
Iris 3.1 322 (% style="text-align:center" %)
323 [[image:1774922053648-913.png]]
Wecon 1.1 324
325 === **I/O Mapping** ===
326
327
328 For PDO content set by process parameters, you can select device or variables to map.
329
Iris 3.1 330 (% style="text-align:center" %)
331 [[image:1774922078808-508.png]]
Wecon 1.1 332
333 === **Start Parameters** ===
334
Iris 3.1 335 (% style="text-align:center" %)
336 [[image:1774922137069-776.png]]
Wecon 1.1 337
338 ① Add
339
340 Right-click the menu to select [Add] or directly click [Add] to enter the interface for adding startup parameters, select the corresponding item, and add startup parameters. ② Delete
341
342 After selecting the parameter content to be deleted, right-click the menu to select delete or directly click “Delete”.
343
344 === **Slave station information** ===
345
346 Display slave station information.
347
Iris 3.1 348 (% style="text-align:center" %)
349 [[image:1774922176699-927.png]]
Wecon 1.1 350
Iris 2.1 351 === **Device scanning** ===
Wecon 1.1 352
Iris 2.1 353 EtherCAT's device scanning supports direct scanning after connecting or unloading the device.
Wecon 1.1 354
Iris 2.1 355 * Select the EtherCAT label, right-click the mouse button and select the scanning device in the pop-up menu.
Wecon 1.1 356
Iris 2.1 357 (% style="text-align:center" %)
358 [[image:1774864251034-249.jpeg]]
Wecon 1.1 359
Iris 2.1 360 * Click the "Scan the device" button in the pop-up window. If the PLC is not connected, an error will be prompted, as shown below;
Wecon 1.1 361
Iris 2.1 362 (% style="text-align:center" %)
363 [[image:1774864251039-758.jpeg]]
Wecon 1.1 364
365
Iris 2.1 366 *
367 After waiting for the scan to complete, the scanned slave devices can be seen in the left side view.
Wecon 1.1 368
Iris 2.1 369 (% style="text-align:center" %)
370 [[image:1774864251041-292.jpeg]]
Wecon 1.1 371
Iris 2.1 372 * Click [Copy all] to update the scanned devices to the currently configured configuration list, and then click [Save] to update the scanned devices to the configuration list of the project. After saving, click [Close] to update to the configuration list.
Wecon 1.1 373
Iris 2.1 374 (% style="text-align:center" %)
375 [[image:1774864251044-226.jpeg]]
Wecon 1.1 376
Iris 2.1 377 **✎Note: **Close the window if it is not saved, the scanned devices will not be added to the configuration list of the project!
Wecon 1.1 378
Iris 2.1 379 (% style="text-align:center" %)
380 [[image:1774864251046-293.jpeg]]
Wecon 1.1 381
Iris 3.1 382 == **EtherCAT instruction** ==
383
384 === **ETC_READPARAMETER_COE** ===
385
386 [[image:1774922271272-193.png]]
387
388 This function is mainly used to read the SDO parameters of the servo.
389
390 **Content, range, data type**
391
392 |**Instruction**|**Pin type**|**Parameter**|**Variable type**|**Can be empty or not**|**Range**|**Description**
393 |(% rowspan="12" %)ETC_READPARAMETER_COE|(% rowspan="5" %)Input|Enable|BOOL|No|TRUE/FALSE|Read Servo SDO enable
394 |SlaveID|WORD|No|0 to range of EtherCAT slaves that can be linked|Set according to the ID configured in the interface. If the device is optional, an error will be reported even if the device does not actually exist
395 |Index|WORD|No|0 to 65535|Index, fill in according to the information provided by the servo
396 |SubIndex|WORD|No|0 to 65535|Sub-index, fill in according to the information provided by the servo
397 |DstLength|WORD|No|-|Data length, fill in according to the information provided by the servo.
398 |(% rowspan="7" %)Output|Done|BOOL|Yes|TRUE/FALSE|When the value is obtained, Done will be set to TRUE, and if Done is not read, it will be set to FALSE
399 |Busy|BOOL|Yes|TRUE/FALSE|Busy is TRUE during reading
400 |RelLength|WORD|Yes|-|Actual length
401 |Data|DWORD|Yes|-|Read data
402 |AbrotCode|DWORD|Yes|TRUE/FALSE|Interrupt code returned by the servo, refer to the EtherCAT standard document for information
403 |Error|BOOL|Yes|TRUE/FALSE|Error
404 |ErrorID|DWORD|Yes|See error code for details|Error code
405
406 **Device used**
407
408 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="22" %)**Device**|**Offset modification**|**Double word extension**|**Pulse-type expansion**
409 |**X**|**Y**|**M**|**S**|**SM**|**T(Bit)**|**HSC(Bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**DXX**|**XXP**
410 |(% rowspan="12" %)(((
411 ETC_READ
412
413 PARAMETER_COE
414 )))|Enable|●|●|●|●|●| | | | | | | | | | | | | | | | | | | |
415 |SlaveID| | | | | | | | | | | | | | | | | | | | | | | | |
416 |Index| | | | | | | | | | | | | | | | | | | | | | | | |
417 |SubIndex| | | | | | | | | | | | | | | | | | | | | | | | |
418 |DstLength| | | | | | | | | | | | | | | | | | | | | | | | |
419 |Done| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
420 |Busy| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
421 |RelLength| | | | | | | | | | | | | | | | | | | | | | | | |
422 |Data| | | | | | | | | | | | | | | | | | | | | | | | |
423 |AbrotCode| | | | | | | | | | | | | | | | | | | | | | | | |
424 |Error| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
425 |ErrorID| | | | | | | | | | | | | | | | | | | | | | | | |
426
427 * Used to read the address values of the servo index and subindex, with the correct length.
428 * Function:
429
430 ① When Enable is continuously set to ON, it will continuously read the SDO value into Data. Upon receiving a value, it will set Done to ON and append the new value to Data. If no value is read, Done will be set to OFF.
431
432 ② When Enable is triggered by an edge, it will read data once. During this process, Busy is TRUE. After reading the data, it will write the obtained value to Data, at which point Done will be set to ON.
433
434 ③ If the corresponding slave cannot be found after Enable is triggered, a 0x27c3 error will be reported.
435
436 ④ If the corresponding index, sub-index, or length is incorrect after Enable is triggered, an error will occur. The specific error needs to be checked according to AbrotCode.
437
438 **✎Note:**Reading data takes time, and reading too much data at once will take a long time to update the data.
439
440 **Error code**
441
442 |**Error code**|**Content**
443 |0x27c3|Axis not found (Check if the input parameters are correct)
444 |0x27D8|SDO access length error (Check the length used in SDO read and write instructions)
445 |0x27CD|SDO read error. Check the address, retry the write operation, or increase the timeout period.
446 |0x27CC|SDO write error. Check the address, retry the write operation, or increase the timeout period.
447
448 **Example**
449
450 [[image:1774922271273-764.png]]
451
452 Read the value from Index 0x6064, Subindex 0, with a length of 2, and display the read value in the Data field.
453
454
455 **ETC_WRITEPARAMETER_COE**
456
457 [[image:1774922271274-351.png]]
458
459 This function is mainly used to write SDO parameters to the servo drive.
460
461 **Content, range, data types**
462
463 |**Instruction**|**Pin type**|**Parameter**|**Variable type**|**Can be empty or not**|**Range**|**Description**
464 |(% rowspan="10" %)ETC_WRITEPARAMETER_COE|(% rowspan="5" %)Input|Enable|BOOL|No|TRUE/FALSE|Read Servo SDO enable
465 |SlaveID|WORD|No|0 to range of EtherCAT slaves that can be linked|Set according to the ID configured in the interface. If the device is optional, an error will be reported even if the device does not actually exist
466 |Index|WORD|No|0~~65535|Index, fill in according to the information provided by the servo
467 |SubIndex|WORD|No|0~~65535|Sub-index, fill in according to the information provided by the servo
468 |DstLength|WORD|No|-|Data length, fill in according to the information provided by the servo.
469 |(% rowspan="5" %)Output|Done|BOOL|Yes|TRUE/FALSE|When the value is obtained, Done will be set to TRUE, and if Done is not read, it will be set to FALSE
470 |Busy|BOOL|Yes|TRUE/FALSE|Busy is TRUE during reading
471 |AbrotCode|DWORD|Yes|TRUE/FALSE|Interrupt code returned by the servo, refer to the EtherCAT standard document for information
472 |Error|BOOL|Yes|TRUE/FALSE|Error
473 |ErrorID|DWORD|Yes|See error code for details|Error code
474
475 **Device used**
476
477 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="22" %)**Device**|**Offset modification**|**Double word extension**|**Pulse-type expansion**
478 |**X**|**Y**|**M**|**S**|**SM**|**T(Bit)**|**HSC(Bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**DXX**|**XXP**
479 |(% rowspan="10" %)(((
480 ETC_WRITE
481
482 PARAMETER_COE
483 )))|Enable|●|●|●|●|●| | | | | | | | | | | | | | | | | | | |
484 |SlaveID| | | | | | | | | | | | | | | | | | | | | | | | |
485 |Index| | | | | | | | | | | | | | | | | | | | | | | | |
486 |SubIndex| | | | | | | | | | | | | | | | | | | | | | | | |
487 |DstLength| | | | | | | | | | | | | | | | | | | | | | | | |
488 |Done| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
489 |Busy| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
490 |AbrotCode| | | | | | | | | | | | | | | | | | | | | | | | |
491 |Error| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
492 |ErrorID| | | | | | | | | | | | | | | | | | | | | | | | |
493
494 * Used to read the address values of the servo index and subindex, with the correct length.
495 * Function:
496
497 ① When Enable is continuously set to ON, it will continuously read the SDO value into Data. Upon receiving a value, it will set Done to ON and append the new value to Data. If no value is read, Done will be set to OFF.
498
499 ② When Enable is triggered by an edge, it will read data once. During this process, Busy is TRUE. After reading the data, it will write the obtained value to Data, at which point Done will be set to ON.
500
501 ③ If the corresponding slave cannot be found after Enable is triggered, a 0x27c3 error will be reported.
502
503 ④ If the corresponding index, sub-index, or length is incorrect after Enable is triggered, an error will occur. The specific error needs to be checked according to AbrotCode.
504
505 **✎Note**:Reading data takes time, and reading too much data at once will take a long time to update the data.
506
507 **Error code**
508
509 |**Error code**|**Content**
510 |0x27c3|Corresponding slave station not found (Check if the input parameters are correct)
511 |0x27D8|SDO access length error (Check the length used in SDO read and write instructions)
512 |0x27CD|SDO read error. Check the address, retry the write operation, or increase the timeout period.
513 |0x27CC|SDO write error. Check the address, retry the write operation, or increase the timeout period.
514
515 **Example**
516
517 [[image:1774922271275-534.png]]
518
519 Write the value 131072 to the address of index 0x6091, subindex 1 and data length 4, read it back via the ETC_READPARAMETER_COE.
520
521 === **IODRVETHERCAT** ===
522
523 [[image:1774922271276-492.png]]
524
525 This function is mainly used to start, restart, and shut down the EtherCAT bus.
526
527 **Content, range, data type**
528
529 |**Instruction**|**Pin type**|**Parameter**|**Variable type**|**Can be empty or not**|**Range**|**Description**
530 |(% rowspan="6" %)(((
531 IODRV
532
533 ETHERCAT
534 )))|(% rowspan="2" %)Input|Restart|BOOL|No|TRUE/FALSE|Trigger restart/start of the EtherCAT bus
535 |StopBus|BOOL|No|TRUE/FALSE|Trigger shutdown of the EtherCAT bus
536 |(% rowspan="4" %)Output|ConfigFinished|BOOL|Yes|TRUE/FALSE|Configuration completed (TRUE)
537 |DistributedClockInSync|BOOL|Yes|TRUE/FALSE|Sync clock initialization completed (TRUE)
538 |Error|BOOL|Yes|TRUE/FALSE|Error occurred (TRUE)
Iris 4.1 539 |SyncInWindow|BOOL|Yes|See error code for details   |Sync window initialization completed (TRUE)
Iris 3.1 540
541 **Device used**
542
543 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="22" %)**Device**|**Offset modification**|**Double word extension**|**Pulse-type expansion**
544 |**X**|**Y**|**M**|**S**|**SM**|**T(Bit)**|**HSC(Bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**DXX**|**XXP**
545 |(% rowspan="6" %)(((
546 IODRV
547
548 ETHERCAT
549 )))|Restart|●|●|●|●|●| | | | | | | | | | | | | | | | | | | |
550 |StopBus|●|●|●|●|●| | | | | | | | | | | | | | | | | | | |
551 |ConfigFinished| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
552 |(((
553 Distributed
554
555 ClockInSync
556 )))| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
557 |Error| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
558 |SyncInWindow| |●|●|●|●| | | | | | | | | | | | | | | | | | | |
559
560 * This function is mainly used to start, restart, and shut down the EtherCAT bus.
561 * Function:
562
563 ① Setting Restart to TRUE or triggering it on a rising edge will execute the EtherCAT bus restart procedure. ConfigFinished, DistributedClockInSync, and SyncInWindow will be set to TRUE according to the initialization order. An initialization exception (Error) will be set to TRUE.
564
565 ② Setting StopBus to TRUE will shut down the EtherCAT bus. ConfigFinished, DistributedClockInSync, and SyncInWindow will be set to FALSE.
566
567 ③ Setting both Restart and StopBus to TRUE simultaneously will be considered an exception, and Error will be set to TRUE. The error code will be output from the PLC error address.
568
569 **✎Note: **Reading data takes time, and reading too much data at once will take a long time to update the data.
570
571 **Error code**
572
573 |**Error code**|**Content**
574 |0x27c3|Corresponding slave station not found (Check if the input parameters are correct)
575 |0x27D8|SDO access length error (Check the length used in SDO read and write instructions)
576 |0x27CD|SDO read error. Check the address, retry the write operation, or increase the timeout period.
577 |0x27CC|SDO write error. Check the address, retry the write operation, or increase the timeout period.
578
579 **Example**
580
581 [[image:1774922271276-525.png]]
582
583 Setting Restart to TRUE starts the EtherCAT master, and SM1902 is set to TRUE after successful startup.
584
585 [[image:1774922271277-338.png]]
586
587 Setting StopBus to TRUE shuts down the EtherCAT master, and SM1902 is set to FALSE synchronously.
588
589 **AbrotCode exception codes**
590
591 |**AbrotCode exception codes**|**Corresponding exception**
592 |0x00000000|No SDO error
593 |0x05030000|Toggle bit not changed
594 |0x05040000|SDO timeout
595 |0x05040001|Instruction specifier unknown
596 |0x05040005|Insufficient memory event explanation
597 |0x06010000|Access not supported
598 |0x06010001|Write-only entry
599 |0x06010002|Read-only entry
600 |0x06010003|Entry cannot be written because Subindex 0 is not 0
601 |0x06010004|Object cannot be accessed
602 |0x06020000|Object does not exist
603 |0x06040041|Object cannot be mapped to PDO
604 |0x06040042|Mapped object exceeds PDO
605 |0x06040043|Parameter incompatible
606 |0x06040047|Device incompatible
607 |0x06060000|Hardware error
608 |0x06070010|Parameter length error
609 |0x06070012|Parameter too long
610 |0x06070013|Parameter too short
611 |0x06090011|Subindex (entry) does not exist
612 |0x06090030|Value exceeded
613 |0x06090031|Value too large
614 |0x06090032|Threshold too small
615 |0x06090033|Detected module identification list (0xF030) does not match configured module identification list
616 |0x06090036|Less than minimum value
617 |0x08000000|General error
618 |0x08000020|Data not readable/writable event explanation
619 |0x08000021|Data inaccessible due to local control
620 |0x08000022|Event explanation: unable to read or write data in current state
621 |0x08000023|Object not in object dictionary