[etherlab-users] Using K Bus ethercat coupler and slaves

Bilko AS, Oguz Dilmac odilmac at bilko-automation.com
Wed Apr 12 13:54:47 CEST 2017


Hi,

Is there any example code about how to configure and use K bus digital 
outputs?

For a little background:

About two years ago I tried to support Kbus ethercat coupler and slaves. 
Specifically Kollmorgen AKT-ACT-000 coupler and AKT-DNH-xxx digital 
inputs and AKT-DT-xxx digital outputs. Thanks to Mr Wilhelm, I managed 
to read the configuration from address 0x4012 and it's sub indexes and 
construct the necessary pdo_entry, pdo_info and sync_info structures 
automatically. Now I can read digital inputs. But somehow I can't set a 
digital output.

Since than I had to abandon that work due to other pressing works. Now 
for a new project I have to open that work again. For a week I've been 
searching internet but I couldn't find any solution. It looks I'm doing 
something wrong but I can't figure it out.

Any help will be appreciated.

By the way, the pseudo code of what I did is below:

1. call ecrt_master_slave_config() to get the slave config.

2. Fill PDO entries:
     a. Read the number of devices attached to the coupler from 0x4012:0x0
     b. Read Structure of the cards after coupler...
         * For each device read device description from 0x4012:0x0+i.
         * Check the 15th bit of the description to see if the device is 
intelligent (ie analog) or not (digital)
         * If it is digital, get the number of the bits from bits 8th to 
14th of the description.
         * Record  these info to a device list
    c. Fill pdo entries using the device list.
         * Add Analog and Digital Outputs.
             - Read number of mapped objects from 0x1600+i:0x0
             - Add all the mapped objects to pdo_entry list of the 
ethercat library. Read the objects from 0x1600+i:1+j.
         * Add gap for alignment considering total number of digital bits.
         * Add Coupler State entry
         * Add Analog and Digital Inputs.
             - Read number of mapped objects from 0x1A00+i:0x0
             - Add all the mapped objects to pdo_entry list of the 
ethercat library. Read the objects from 0x1A00+i:1+j.
         * Add gap for alignment considering total number of digital bits.

2. Fill PDO_info entries:
     a. Add coupler and output devices info
         * Read the number of pdo info from 0x1c12:0x0
         * For each pdo info read 0x1c12:0x1+i to get the object indices
     b. Add coupler and input devices info
         * Read the number of pdo info from 0x1c13:0x0
         * For each pdo info read 0x1c13:0x1+i to get the object indices

3. Fill Sync info:
     a. Fill four sync channels using the PDO_info structure.
     b. Terminate the structure with -1.

4. Call ecrt_slave_config_pdos with the new constructed sync_info structure
5. For each device attached to the coupler call 
ecrt_slave_config_reg_pdo_entry to get the pdo entry offsets.

I use different domains for read and write.

Again, any help will be appreciated.
Best regards,
Oguz.



-- 
Oguz Dilmac
ARGE Bolumu

Bilko AS, R&D Department
====================================
Perpa Ticaret Merkezi B Blok Kat 13 Nr. 2568
TR-34384 Okmeydani Istanbul Turkey
Tel : +90 212 220 07 40  Fax :   +90 212 210 47 01
e-mail : odilmac at bilko-automation.com
web site : http://www.bilko-automation.com




More information about the Etherlab-users mailing list