First Tests with ethercat

More
11 months 1 week ago #339055 by kor
I finally insalled my ethercat master. and when running "ethercat slaves"
I see my beckhoff devices:
Code:
bf20@bf20:~$ ethercat slaves 0  0:0  PREOP  +  EK1100 EtherCAT-Koppler (2A E-Bus) 1  0:1  PREOP  +  EL1014 4K. Dig. Eingang 24V, 10�s 2  0:2  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A 3  0:3  PREOP  +  EL3102 2K. Ana. Eingang +/-10V, Diff.

So next I created a standard axis-sym conf
I modified the axis.ini by adding a new halfile:
Code:
HALFILE = ethercat.hal

This is my ethercat.hal:
Code:
# EtherCat loadusr -W lcec_conf /home/bf20/linuxcnc/configs/sim.axis/ethercat-conf.xml loadrt lcec add lcec.read-all servo-thread add lcec.write-all servo-thread net mon halui.machine.on lcec.0.EL1014.din-2 net mon halui.machine.off lcec.0.EL1014.din-3

and here is my xml file:
Code:
<masters>     <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">              <slave idx=0" type="EK1100" name="EK1100"/>         <slave idx=1" type="EL1014" name="EL1014"/>         <slave idx=2" type="EL2004" name="EL2004"/>         <slave idx=3" type="EL3102" name="EL3102"/>     </master> </masters>

when starting linuxcnc I get this error message:
Code:
Note: Using POSIX realtime lcec_conf: ERROR: Parse error at line 4: not well-formed (invalid token) ./ethercat.hal:3: waitpid failed lcec_conf lcec_conf ./ethercat.hal:3: lcec_conf exited without becoming ready 6791 Stopping realtime threads Unloading hal components Note: Using POSIX realtime
which does not really help me to figure out what is wrong. My guess is that I did something wrong in the xml, but I can not figure out what.

Thanks for your help.

Please Log in to join the conversation.

More
11 months 1 week ago #339058 by onceloved
Replied by onceloved on topic First Tests with ethercat
# EtherCat
loadusr -W lcec_conf /home/bf20/linuxcnc/configs/sim.axis/ethercat-conf.xml
loadrt lcec
add lcec.read-all servo-thread

add lcec.write-all servo-thread
net mon halui.machine.on lcec.0.EL1014.din-2
net mon halui.machine.off lcec.0.EL1014.din-3

Please Log in to join the conversation.

More
11 months 1 week ago #339064 by kor
Replied by kor on topic First Tests with ethercat
the linebreak was a copy paste error. still same error message

 file information:
Note: Using POSIX realtime
lcec_conf: ERROR: Parse error at line 4: not well-formed (invalid token)
./ethercat.hal:2: waitpid failed lcec_conf lcec_conf
./ethercat.hal:2: lcec_conf exited without becoming ready
9917
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

 

Please Log in to join the conversation.

More
11 months 1 week ago #339067 by Hakan
Replied by Hakan on topic First Tests with ethercat
Unbalanced """s
should be idx="0", not idx=0"

Please Log in to join the conversation.

More
11 months 1 week ago #339084 by kor
Replied by kor on topic First Tests with ethercat
That was a stupid mistake. geany did color it like I expected. and I am using a small monitor.
just for reference if someone reads this thread later here are my working files:
ethercat.hal:
Code:
 # EtherCat loadusr -W lcec_conf /home/bf20/linuxcnc/configs/sim.axis/ethercat-conf.xml loadrt lcec addf lcec.read-all servo-thread addf lcec.write-all servo-thread net mon halui.machine.on lcec.0.EL1014.din-2 net moff halui.machine.off lcec.0.EL1014.din-3 

ethercat-conf.xml:
Code:
<masters>     <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">              <slave idx="0" type="EK1100" name="EK1100"/>         <slave idx="1" type="EL1014" name="EL1014"/>         <slave idx="2" type="EL2004" name="EL2004"/>         <slave idx="3" type="EL3102" name="EL3102"/>     </master> </masters>

Please Log in to join the conversation.

Time to create page: 0.320 seconds
Powered by Kunena Forum