[etherlab-users] problem in using BeckHoff encoder EL5101 RevisionNo= '0x03fb0000'

Jason Xu jason at motiondesign.co.nz
Mon Jul 6 05:47:06 CEST 2009


Hi:

I am a new user in Ethercat field, and have recently developed an
application using BechHoff products including encoder EL5101.

The application seems working fine with an early EL5101 encoder module
(product code= '0x13ed3052', RevisionNo='0x00010000'). However, the
application does not work with new BechHoff EL5101 encoder module (product
code='0x13ed3052', RevisionNo='0x03fb0000').

The program is running on the RTAI platform.

Can someone give help on how to solve this problem? Below are parts of
related code in my test program.

===================================
domain1_regs[0].alias = 1 ;
domain1_regs[0].position = 0;
domain1_regs[0].vendor_id = 0x00000002;
domain1_regs[0].product_code =0x13ed3052;
domain1_regs[0].index = 0x6000;
domain1_regs[0].subindex =2;
domain1_regs[0].offset = &ec_io_offset[0];


void run(long data)
{
    int j ;
    int return_value, k ;
    unsigned int index_ ;


    while (1) {

        t_last_cycle = get_cycles();
        //printk(KERN_INFO PFX "t_last_cycle: %d\n",t_last_cycle);

        // receive process data
        rt_sem_wait(&master_sem);
        ecrt_master_receive(master);
        ecrt_domain_process(domain1);
        rt_sem_signal(&master_sem);

        // check process data state (optional)
        check_domain1_state();

        if (counter) {
            counter--;
        } else { // do this at 1 Hz
            counter = FREQUENCY*60;
            // check for master state (optional)
            check_master_state();
        }

        p_ec_io_value->value[domain1_regs[0].alias] = EC_READ_U16(domain1_pd
+ ec_io_offset[0]) ;


        rt_sem_wait(&master_sem);
        ecrt_domain_queue(domain1);
        ecrt_master_send(master);
        rt_sem_signal(&master_sem);

        rt_task_wait_period();
    }
}


int __init init_mod(void)
{
    ......
    ......

    ecrt_master_callbacks(master, request_lock, release_lock, NULL);
    printk(KERN_INFO PFX "Registering domain...\n");
    if (!(domain1 = ecrt_master_create_domain(master))) {
        printk(KERN_ERR PFX "Domain creation failed!\n");

        goto out_release_master;
    }

    printk(KERN_INFO PFX "Registering Pdo entries...\n");
    if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) {
        printk(KERN_ERR PFX "Pdo entry registration failed!\n");
        goto out_release_master;
    }

    printk(KERN_INFO PFX "Activating master...\n");
    if (ecrt_master_activate(master)) {
        printk(KERN_ERR PFX "Failed to activate master!\n");
        goto out_release_master;
    }

    // Get internal process data for domain
    domain1_pd = ecrt_domain_data(domain1);

......
......
}

==================================

After loading the program, encoder slave-status changed happily from preop
--> op. However, it only reads encoder value once such as 1296 and then
locked there forever.

Thanks in advance for any help.

Jason Xu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20090706/aaabb9cc/attachment-0002.htm>


More information about the Etherlab-users mailing list