Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

EtherCAT Distributed clocks with Beckhoff IO

We are using Beckhoff EtherCAT IO with Labview 2016 running on Labview RT Pharlap.  

We cannot get the EtherCAT distributed clocks to work correctly using the device properties dialog.  Enabling DC causes an error stating the device does not support DC.  The device does support DC.  

 

Digging deeper, I found when setting up DC the SDO 1C33:1 is only ever set to mode 0 or 1.  The correct mode to synchronize inputs to the clock is 3.  I wrote a program to setup distributed clocks using a property node.  This also did not work correctly.  I accidentally created a configuration of the property node that will enable DC on only 1 module. If I try to enable the clock on a second identical module, it does not work.  Where the node does work, it is not sending the correct values to the slave. 

 

When Input.Mode is set to "Synchronize to EtherCAT frame" and Sync0 is enabled SDO 1C33:1 should be 1, but becomes 3.  When Input.Mode is set to "Synchronize to distributed clock" and Sync0 is enabled the DC doesn't work and gives an error.  

 

When Input.Mode is set to "Synchronize to EtherCAT frame" and Sync0 is disabled SDO 1C33:1 should be 1, but becomes 0. 

 

I have been able to get distributed clock work on all modules by a very complicated work around: 

First enable to DC on the one module where it will work, this ensures the master creates the sync packets correctly.  

Set Input.Mode is set to "Synchronize to EtherCAT frame" and Sync0.  This causes the module to not enable DC but the SDO 1C33:2-1C33:D become populated with the correct values.  

The scan engine can then be placed into Active Mode.  

After placing the scan engine into Active Mode, I use WriteSDO to write the value 3 to SDO 1C33:1.  The DC on the slave then becomes correctly enabled.  

 

While this solution works, it is not easily scale-able as each module has specific needs for correct configuration.  These needs are described in the ESI xml files which are read when opening the device properties window.  Without using the device properties window it is necessary to manually open each ESI file to read the correct DC settings.  

 

Attached is a picture of the program used to configure the modules and the device tree.  The Ethernet adapter driver is i8254x. 

Download All
0 Kudos
Message 1 of 5
(3,719 Views)

What kind of devices are you intending to synchronize? We communicate with Kollmorgen AKD drives over EtherCAT and there is the possibility to connect to the devices via Ethernet from a service port and configure them locally. Perhaps this is an option.



0 Kudos
Message 2 of 5
(3,680 Views)

We are trying to synchronize the Beckhoff IO.  Most importantly we want to synchronize the encoder inputs so we are receiving the position data from the same time.  It isn't possible to setup the modules ahead of time as the time sync configuration data is sent by the Ethercat master when the system transitions from safe operational to operational.   

0 Kudos
Message 3 of 5
(3,675 Views)

Hi bkopietz,

 

Could you share your XML file with me? I may help to address this issue.

 

Thanks!

 

0 Kudos
Message 4 of 5
(3,415 Views)

Hi, 

It applies to any of the Beckhoff XML files.  I can't upload the XML files here but this is the DC section of the XML file for the EL5101.

 

<Dc>
<OpMode>
<Name>Synchron</Name>
<Desc>FreeRun/SM-Synchron</Desc>
<AssignActivate>#x0</AssignActivate>
<CycleTimeSync0 Factor="0">0</CycleTimeSync0>
<ShiftTimeSync0>0</ShiftTimeSync0>
<CycleTimeSync1 Factor="1">0</CycleTimeSync1>
<ShiftTimeSync1>0</ShiftTimeSync1>
</OpMode>
<OpMode>
<Name>DC</Name>
<Desc>DC-Synchron</Desc>
<AssignActivate>#x320</AssignActivate>
<CycleTimeSync0 Factor="1">0</CycleTimeSync0>
<ShiftTimeSync0 Input="0">0</ShiftTimeSync0>
<CycleTimeSync1 Factor="1">0</CycleTimeSync1>
<ShiftTimeSync1>0</ShiftTimeSync1>
</OpMode>
<OpMode>
<Name>DCIN</Name>
<Desc>DC-Synchron (input based)</Desc>
<AssignActivate>#x320</AssignActivate>
<CycleTimeSync0 Factor="1">0</CycleTimeSync0>
<ShiftTimeSync0 Input="1">0</ShiftTimeSync0>
<CycleTimeSync1 Factor="1">0</CycleTimeSync1>
<ShiftTimeSync1>0</ShiftTimeSync1>
</OpMode>
</Dc>

 

0 Kudos
Message 5 of 5
(3,412 Views)