Ethercat HAL driver
- sdfzz
- Offline
- Junior Member
-
- Posts: 21
- Thank you received: 0
Would you please try typing "sudo ethercat start" on your terminal before running LinuxCNC?
Regards,
Steve
Please Log in or Create an account to join the conversation.
- kyoshiro1108
- Offline
- New Member
-
- Posts: 5
- Thank you received: 0
Hi, kyoshiro1108,
Would you please try typing "sudo ethercat start" on your terminal before running LinuxCNC?
Regards,
Steve
The ethercat run on background when I boot up the computer.
so that I can execute ethercat slaves and ethercat master command.
but the problem still exist....
Please Log in or Create an account to join the conversation.
- kyoshiro1108
- Offline
- New Member
-
- Posts: 5
- Thank you received: 0
$./configure --enable-simulator
to build linuxcnc and the error is .....
$ cd linuxcnc-add-hal-ethercat/
$ . scripts/rip-environment
$ halrun
halcmd: loadrt threads name1=master period1=1000000
halcmd: loadusr -W lcec_conf /home/oslab/Desktop/ethercat_config_my.xml
halcmd: loadrt lcec
lcec: dlopen: /home/oslab/linuxcnc-add-hal-ethercat/rtlib/lcec.so: cannot open shared object file: No such file or directory
<stdin>:3: /home/oslab/linuxcnc-add-hal-ethercat/bin/rtapi_app exited without becoming ready
<stdin>:3: insmod failed, returned -1
Please Log in or Create an account to join the conversation.
- euerka
- Offline
- New Member
-
- Posts: 5
- Thank you received: 0
Everything goes well until I try to load my configure xml, there are errors as follow:
halcmd: loadusr -W lcec_conf ethercat_config_my.xml
lcec_conf: ERROR: unexpected node master found
lcec_conf: ERROR: Parse error at line 1: parsing aborted
<stdin>:4: lcec_conf exited without becoming ready
My configure file as below:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">
<slave idx="0" type="generic" vid="00000539" pid="02200001" configPdos="true">
<syncManager idx="0" dir="out"/>
<syncManager idx="1" dir="in"/>
<syncManager idx="2" dir="out">
<pdo idx="1602">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="drivecontrol" halType="bit"/>
<pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="velocity" halType="s32"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1A02">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="drivestatus" halType="bit"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pos" halType="S32"/>
</pdo>
</syncManager>
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
<sdoConfig idx="6060" subIdx="0">
<sdoDataRaw data="08"/>
</sdoConfig
><sdoConfig idx="60C2" subIdx="1">
<sdoDataRaw data="01"/>
</sdoConfig>
<sdoConfig idx="60C2" subIdx="2">
<sdoDataRaw data="FD"/>
</sdoConfig>
</slave>
</master>
I think my configure file format should be OK, because I use it before. May I know how to test this new respository works ?
I already start ethercat,
ethercat master
ethercat slave -v
By the way
sdfzz wrote:
Sorry...one more question..
when I tried roschi's sameple hal and ini files to load linuxcnc, i got errors:
my-mill.hal:4: execv(lcec_conf): No such file or directory
my-mill.hal:4: lcec_conf exited without becoming ready
This line gives the error: loadusr -W lcec_conf /root/linuxcnc/configs/my-mill/ethercat_config_n.xml
I did place the correct xml file inside my config folder.
I saw from one of the video that you run
/etc/init.d/ethercat start
before you run linuxcnc. However, for my case, there is no ethercat file in /etc/init.d. Is there any mistakes in my installation?
Regards,
Steve
I also meet this problem when I install hal on another computer.
Can u tell me how to solve it ?
Thank U.
After you install etherlab, the default directory will be /opt/etherlab
you can use soft link
sudo ln -s /opt/etherlab/etc/init.d/ethercat /etc/init.d/ethercat
/etc/init.d/ethercat start
-Chengxi
Please Log in or Create an account to join the conversation.
- euerka
- Offline
- New Member
-
- Posts: 5
- Thank you received: 0
add
<masters>
......
</master>
Please Log in or Create an account to join the conversation.
- pavel7890
- Offline
- New Member
-
- Posts: 17
- Thank you received: 2
I finally started to work out my indradrive ethercat project. I acquired Wasino gang lathe and want to use 2 axis servo and main spindle, all controlled by ethercat.
I started with main spindle. So far so good

I guess I found a bug in sittners lcec_conf.c for scale and offset. Since I do not have any experience with git contribution i put it here:
// parse scale
if (strcmp(name, "scale") == 0) {
floatReq = 1;
p->floatScale = atof(val);
continue;
}
// parse offset
if (strcmp(name, "offset") == 0) {
floatReq = 1;
p->floatOffset = atof(val);
continue;
}
There was not continue; so it just parsed scale parameter with error.
Hope it helps.
Please Log in or Create an account to join the conversation.
- sascha
- Offline
- New Member
-
- Posts: 18
- Thank you received: 30
I've took it into master: github.com/sittner/linuxcnc-ethercat/com...7da79e3406d6d881dc8b
Please Log in or Create an account to join the conversation.
- bkt
-
- Offline
- Platinum Member
-
- Posts: 1224
- Thank you received: 113
Please Log in or Create an account to join the conversation.
- a60081
- Offline
- New Member
-
- Posts: 2
- Thank you received: 0
If only one domain, it will be synchronize error.
How could i edit it in lcec.c?
Please Log in or Create an account to join the conversation.
- narogon
- Offline
- Senior Member
-
- Posts: 48
- Thank you received: 14
I want to create two domain for pdos because the motor i used is required one domain(1600) for transfer, and another one for receive(1A00).
If only one domain, it will be synchronize error.
How could i edit it in lcec.c?
Check tutorial
step 9 parameter 4.
I think you mean sync managers when you say domains.
Please Log in or Create an account to join the conversation.