Connecting TURCK B20 Gateway through EtherLab EtherCat

More
10 Apr 2025 14:21 #326035 by hellvetica
Hi, this question might be a bit displaced on this forum because my current issue doesn't regard linuxcnc. I plan to ultimately connect this to linuxcnc but ran into some trouble. Since this is a forum with plenty of supportive automation experts i figured i'd ask here.

I have this TURCK ethercat gateway.
www.turck.se/sma/product/100037881
With 3 I/0 Modules:
BL20-E-16DI-24VDC-P
BL20-E-16DO-24VDC-0.5A-P 
BL20-E-8AI-U/I-4PT/NI 

My ultimate goal is to use ethercat to add analog and digital IO to linuxcnc. However, configuring the device has turned out to be quite a pain. On windows it's quite easy using the CODESYS software that manages everything but there's no equivalent for linux. 
I'm trying to use the EtherLab ethercat backend to write configuration data to the BL20. It needs to receive the information about what modules are connected to it. I put together this C program (in atachment) that's supposed to send the required data but the device still doesn't go into operational mode.
I feel like this process should not be this involved. Am I missing something? Are there tools that allow me to do this more easily?
Any guidance here would be appreciated, thanks.
Attachments:

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

More
11 Apr 2025 21:50 #326121 by Grotius
Hi,

Here is a example project how to read & write to ethercat-master from any device.
I called the project twincat, because it is able to get and send info to the bus system.

The  ethercat-master source is slightly updated, It can print out more info as normal.
And the source had a nasty bug related to c code configuration wich i found.

This bug is still not resolved in etherlab master. I did tell them the bug, but i did not do a push request.

I think with this project you will be able to figur out how to use the TURCK device.
The project can print all details of the TURCK device. And you can send any data you want to the TURCK device.
1 bit send . Or 8bit, 16bit, and you can add more types if you need.

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

More
18 Apr 2025 09:41 #326583 by hellvetica
Hi,
thanks for the help.
I've been messing around with the project but can't seem to get it to work.
I compiled ethercat_twincat and ran it but it's not reading any ports from my ethercat device. There are no input/outputs. Is there somthing else i need to configure?
My device is in PREOP mode and erroring because of:
"The current and the projected module list do not match. The data
exchange is still in progress." or
"The gateway is still in INIT status, the module list has not yet been
written to the gateway."

I should be actively writing something to the gateway to configure it i guess...

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

Time to create page: 0.097 seconds
Powered by Kunena Forum