Wiki source code of 07 EtherCAT

Last modified by Wecon on 2025/09/03 21:02

Show last authors
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
65 === ** Slave station parameters** ===
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
256
257 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.
258
259
260 The execution rules for this key are:
261
262 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;
263
264 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.
265
266
267
268 === **Simple configuration instance** ===
269
270
271 When an EtherCAT device configuration exists, open the EtherCAT configuration of the corresponding slave station.
272
273 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;
274
275
276 When the link sequence corresponds, the corresponding servo can still be matched. 3Open the software device monitoring interface and observe that SM1902 is ON;
277
278 4 Open the EtherCAT configuration interface, click [Write EEprom], and write the alias to Servo;
279
280
281
282
283
284 Restart the servo and PLC can be matched by alias.
285
286
287 Then check [Device optional] in edit mode.
288
289
290
291
292 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.
293
294 In the same ladder diagram, connect the corresponding equipment, and then stop->run. The corresponding device of run PLC can be used normally.
295
296
297 === **Expert parameters** ===
298
299
300
301
302 . 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;
303
304 . 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;
305
306 . 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;
307
308 . 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.
309
310
311 === **Process Data** ===
312
313 The process data interface is basically consistent with the expert process parameter functions except that PDO content cannot be customized.
314
315
316
317 === **I/O Mapping** ===
318
319
320 For PDO content set by process parameters, you can select device or variables to map.
321
322
323 === **Start Parameters** ===
324
325
326
327 ① Add
328
329 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
330
331 After selecting the parameter content to be deleted, right-click the menu to select delete or directly click “Delete”.
332
333
334
335
336 === **Slave station information** ===
337
338
339 Display slave station information.
340
341
342
343 === **Device scanning     ** ===
344
345 EtherCAT device scanning supports direct scanning after connecting or uninstalling a device.
346
347 1 Select the EtherCAT label, and right-click to select the scanning device in the pop-up menu;
348
349
350 2 Click the "Scan device" in the pop-up window. If not connected to PLC, it will report an error, as shown in the following error message;
351
352
353 3 After the scan is completed, you can see the scanned slave devices from the left side. Only when the name and type of the scanned device are inconsistent with the current configuration device, click Copy All to update the scanned device to the currently configured configuration list, and then click Save to scan the scanned device.
354
355
356
357 Update to the configuration list of the project, click Exit to not update to the configuration list.
358
359 as shown in the figure below, after updating to the configuration list of the project, Wecon VD3E EtherCAT Servo v1.11 in the configuration will automatically associate the motion control axis and overwrite the original device and the associated control axis.
360
361
362
363 If there are unrecognized devices in the scanned devices, as shown in the figure below, "Copy all" and "Save" will be disabled to update to the existing configuration, and "Import Missing Profile" will be enabled. You can import the corresponding ESI according to the access device, and scan the device again after correct import to refresh the scan device.
364
365