How: Add more (Beckhoff) devices to EtherCAT HAL driver?

More
6 years 3 months ago #173415 by charly
I have my ethercat master running
I have the linuxcnc 2.9 compiled and running
but i don't understand how add ethercat-hal driver support to connect both part
The publishing on github.com/wrightsh/linuxcnc-ethercat must be added to ethercat master or linuxcnc and compiled
Thanks

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

More
6 years 3 months ago #173554 by Grotius
@Wrightsh,

#define LCEC_EL3162_PID 0x0C5A3052

The adres or id 0x0C5A3052 is given a easyer name by the command #define into LCEC_EL3162
Both names will work anyway when a define is done.

another example : #define PI 3.14
now you can type "double result=PI*2;"

@Jerry,
* I am basically confused how the HAL pins are defined for servo drive? based on ESI files?
Maybe look in the lcec code.

@Charly,
The publishing on github.com/wrightsh/linuxcnc-ethercat must be added to ethercat master or linuxcnc and compiled
Thanks

It is something for the near future to make a debian 9 or 10 iso 64 bit. Including a working linuxcnc and ethercat.
A good idea is to have a additional ethercat driver download site. Now custom ethercat drivers are spreaded everywhere.

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

More
5 years 6 months ago #206783 by Stormholt
I am attempting to write a driver for the EL6021,

I have read couple of drivers, but cant quite understand how to decide which entries to use LCEC_PDO_INIT() on in the init function.
As far as i can read it is for the entries that are not a full byte in size, but i am unsure. Can anyone explain this to me ?
Thank you in advance

Stormholt

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

More
5 years 6 months ago - 5 years 6 months ago #206902 by Grotius
Hi Stormhold,

When i compare all the lcec_pdo_init's(..) of the project, i think you can maybe quess what the entry should look like.

I don't know anything about the el6021. There is some online documentation with details.

Attached some pictures, maybe it help's you.

The pdo init is to tell something about the product, the vendor, the index etc. In lcec.h :
Code:
// pdo macros #define LCEC_PDO_INIT(pdo, pos, vid, pid, idx, sidx, off, bpos) \ do { \ pdo->position = pos; \ pdo->vendor_id = vid; \ pdo->product_code = pid; \ pdo->index = idx; \ pdo->subindex = sidx; \ pdo->offset = off; \ pdo->bit_position = bpos; \ pdo++; \ } while (0); \

P.s i remember the command : "ethercat cstruct" gives this kind of info from the online slaves.
Last edit: 5 years 6 months ago by Grotius.

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

More
5 years 5 months ago - 5 years 5 months ago #208718 by Stormholt
Hello i am having trouble with writing a driver for the EL3202 2 channel input terminal pt100.

I have both the el3202 and the el3314 physically and have created drivers for both of them, and the drivers are extremely identical. The el3314 works perfectly however not the el3202. The values I get from the value pdo entry corresponds to the full status. I don't understand how the device gets this value, as the driver is mapped according to the cstruct. Every half second the value changes from 0 to -32768. In Twincat the device works perfectly.

I am hoping someone might have an idea as to why the value reads from the wrong address.

I have attached the .c .h and cstruct of the el3202 and the .c of the el3314. as well as pictures of the hal results and the twincat. lcec.0.1 is the el3314 and lcec.0.2 is the el3202

Thank you in advance

EDIT:
Also if i provoke an error like removing a pin, the error LED lights up but does not indicate error in hal.
Last edit: 5 years 5 months ago by Stormholt. Reason: Addtional info

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

More
5 years 5 months ago #208730 by Grotius
Hi Stormhold,

Can you attach the lcec_el3314.h file?

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

Time to create page: 0.105 seconds
Powered by Kunena Forum