[etherlab-users] PDO entry registration failed

Holly ffuller331 at aol.com
Mon Jul 25 20:25:32 CEST 2011



Hello,

I'm currently trying to free map a Kollmorgen AKD servo drive and having difficulties with the ecrt_domain_reg_pdo_entry_list call. Using your 
RTAI example code as a baseline...with etherlab1.5

static ec_master_t *master = NULL;
static ec_master_state_t master_state = {};
spinlock_t master_lock = SPIN_LOCK_UNLOCKED;

// process data
static uint8_t *domain1_pd; // process data memory
static ec_domain_t *domain1 = NULL;
static ec_domain_state_t domain1_state = {};

#define AKD_ID 0x0000006A, 0x00414B44
static unsigned int akd_in ,  in_nada; // offsets for PDO entries
static unsigned int akd_out, out_nada;

ec_slave_config_state_t ss;

const static ec_pdo_entry_reg_t domain1_regs[] = {
  {0, 0, AKD_ID, 0x1600, 0, &akd_out , &out_nada },  //0x1600
  {0, 0, AKD_ID, 0x1A00, 0, &akd_in  , &in_nada  },  //0x1A00
  {}
};

static ec_pdo_entry_info_t akd_outputs[] = {
  {0x6040, 0, 16},   // Control Word
  {0x6074, 0, 16},   // Torque Demand 6074, 
  {0x60FE, 1, 32}    // Aux DO's
};

static ec_pdo_info_t akd_out_pdos[] = {
    {0x1600, 3, akd_outputs}
};

static ec_pdo_entry_info_t akd_inputs[] = {
    {0x6064, 0, 32}, // position actual //6064
    {0x6041, 0, 16}, // status
    {0x3470, 0, 16}  // Aux Ai
};

static ec_pdo_info_t akd_in_pdos[] = {
    {0x1A00, 3, akd_inputs}
};

static ec_sync_info_t akd_syncs[] = {
  {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
  {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
  {2, EC_DIR_OUTPUT, 1, akd_out_pdos, EC_WD_DISABLE},
  {3, EC_DIR_INPUT , 1, akd_in_pdos, EC_WD_DISABLE },
  {0xff}


int init_module(void)
//------------------------------------------------------------------------------
{
  RTIME tick_period;
 

  ec_slave_config_t *sc;
 
  
    /*.... Open the shared memory partition ...*/
    if ((dp = rt_shm_alloc(nam2num("SHM"),sizeof(struct datapool),USE_VMALLOC)) == 0)
    {
      printk("jumplist.c-init_module - Could not start JUMPLIST, error opening shared memory.\n");
      rt_task_delete(&rt_task);
      return 1;
    }
    rt_sem_init(&master_sem, 1);

    
    if (!(master = ecrt_request_master(0))) {
      printk("Requesting master 0 failed!\n");
      goto out_return;
    }

    
    ecrt_master_callbacks(master, send_callback, receive_callback, master);
    printk("Registering domain...\n");
    if (!(domain1 = ecrt_master_create_domain(master))) {
      printk("Domain creation failed!\n");
      goto out_release_master;
    }


  printk("Configure get slave configuration 0 0 .\n");
    if (!(sc = ecrt_master_slave_config(master, 0, 0, AKD_ID) ) )
     {
      printk("Failed to get slave configuration.\n");
      goto out_release_master;
     }

    printk("Configuring PDOs...\n");
    if ( ecrt_slave_config_pdos(sc, EC_END, akd_syncs) )
    {
        printk("Failed to configure PDOs.\n");
        goto out_release_master;
    }

    
#if 1
    printk("Registering PDO entries...\n");
    if ( ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs) )
    {
        printk("PDO entry registration failed!\n");
        goto out_release_master;
    }
#endif


   printk("Activating master...\n");
    if ( ecrt_master_activate(master) )
    {
        printk("Failed to activate master!\n");
        goto out_release_master;
    }
   
    // Get internal process data for domain
    domain1_pd = ecrt_domain_data(domain1);


    // Setup tasks
    rt_set_periodic_mode();
    
    rt_task_init(&rt_task, jumplist, 1, STACK_SIZE, TASK_PRIORITY, 1, 0);
    tick_period = start_rt_timer(nano2count(TICK_PERIOD));
    rt_task_make_periodic(&sct_rt_task, rt_get_time() + tick_period*10, tick_period);
    
  return 0;

 out_release_master:
    printk("Releasing master...\n");
    ecrt_release_master(master);
 out_return:
    rt_sem_delete(&master_sem);
    printk("Failed to load. Aborting.\n");
    return 99;
}

PDO entry 0x1600:00 is not mapped while attempting to run the code above. Any help would be much appreciated. I have seen threads from users with
similar problems with Yaskawa and Parker drives 







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20110725/39f2516d/attachment-0003.htm>


More information about the Etherlab-users mailing list