Cannot use ethercat terminals sending more than 1 byte.

More
5 years 4 months ago - 5 years 4 months ago #211133 by Stormholt
Dear forum

I have been trying to use more ethercat terminals. A lot of them do not have drivers implemented for them. The ones i have that dont have drivers are EL2014, El3004, EL3202, EL3314. I have created the driver using the mighty Grotius forum.linuxcnc.org/27-driver-boards/3559...-how-to-installguide . The drivers work fine on their own, verified by using twincat in windows. The problems occur when the terminals are connected serially in the EK1100.
Lets say I have the terminals connected like this: Ek1100, EL2004(1byte of data), EL2014(4byte of data), EL1002(1byte of data), I will only receive 5 bytes. Additionally the EL1002 will have its hal values controlled by what the first terminal shows.
By testing with different terminals i have found the pattern to be: All devices after a device that sends more than 1 byte will not have its data sent/read, but rather show values based on the very first terminal. If i had a stack like this:EL2014(4byte of data), EL2004(1byte of data), EL1002(1byte of data) i would get 4 bytes, and like this: EL2004(1byte of data), EL1002(1byte of data), EL2014(4byte of data) i will get 6 bytes and every thing working fine.

All devices go into OP state and there are no error messages. I have looked a little in the linuxcnc-ethercat source code and inserted some print calls to see that the pdo_entry_count is correct, every slaves is iterated through, but the master process data length is not correct.

I suspect the drivers i have written to create some kind of issue, but i have stared myself blind trying to find the root of the problem.

Any help is appreciated! I have attached the drivers i have written
Last edit: 5 years 4 months ago by Stormholt.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #211310 by db1981
Hello Stormholt,

i have taken a few look on your code and can't see nothing what is obivousily wrong.
(its hard to look only at the code and to not be able to test it.....)

I would have seperated the channel data and build it to react dynamic on the channel count, to cover all el201X.

dmesg tells nothing? Did you set "ethercat debug 1" ?

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #211346 by Grotius
Hi Stormhold,

In file el2202.h there is a error. It misses the lcec.h include.
Maybe that will fix the rest in the compile sequence.

And a idea can be. Just compile the lcec.so lib with only the drivers you actually use. It this works oke. You know a little more.

attached a lcec.so and lcec.conf with only inside :
Code:
obj-m += lcec.o lcec-objs := \ lcec_main.o \ lcec_class_enc.o \ lcec_generic.o \ lcec_el2xxx.o \ lcec_el2014.o

I hope this works.
To test in a stack like : EL2014(4byte of data), EL2004(1byte of data).
Last edit: 5 years 4 months ago by Grotius.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #211483 by Stormholt
@db1981 yes indeed no info from dmesg have used both ethercat debug 1 and 2.
I will try with seperated channel data!

@Grotius: good spot! i will try compiling as you have specified!

Thank you both for you help on this!

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #211484 by Stormholt
When modifying the Kbuild to only the device used, like your example, get an error :
Code:
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefned symbol: lcec_ax5200_init
and after adding lcec_ax5200.o \ to the compile:
Code:
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefned symbol: lcec_el1152_init

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #211487 by db1981
compiling only single modules in this way will not work..

you have to delete the unused driver data_types in lcec_conf.c and .h .

Did you add your types to lcec_conf? i forgot this to ask before...

Please Log in or Create an account to join the conversation.

Time to create page: 0.340 seconds
Powered by Kunena Forum