<font color='black' size='2' face='arial'><FONT face="Arial, Helvetica, sans-serif"></FONT>
<div><br>
Hello,</div>
<div> </div>
<div>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 </div>
<div>RTAI example code as a baseline...with etherlab1.5</div>
<div> </div>
<div>static ec_master_t *master = NULL;<br>
static ec_master_state_t master_state = {};<br>
spinlock_t master_lock = SPIN_LOCK_UNLOCKED;</div>
<div> </div>
<div>// process data<br>
static uint8_t *domain1_pd; // process data memory</div>
<div>static ec_domain_t *domain1 = NULL;<br>
static ec_domain_state_t domain1_state = {};</div>
<div> </div>
<div>#define AKD_ID 0x0000006A, 0x00414B44</div>
<div>static unsigned int akd_in , in_nada; // offsets for PDO entries<br>
static unsigned int akd_out, out_nada;<br>
</div>
<div>ec_slave_config_state_t ss;</div>
<div> </div>
<div>const static ec_pdo_entry_reg_t domain1_regs[] = {<br>
{0, 0, AKD_ID, 0x1600, 0, &akd_out , &out_nada }, //0x1600<br>
{0, 0, AKD_ID, 0x1A00, 0, &akd_in , &in_nada }, //0x1A00<br>
{}<br>
};</div>
<div> </div>
<div>static ec_pdo_entry_info_t akd_outputs[] = {<br>
{0x6040, 0, 16}, // Control Word<br>
{0x6074, 0, 16}, // Torque Demand 6074, <br>
{0x60FE, 1, 32} // Aux DO's<br>
};</div>
<div> </div>
<div>static ec_pdo_info_t akd_out_pdos[] = {<br>
{0x1600, 3, akd_outputs}<br>
};</div>
<div> </div>
<div>static ec_pdo_entry_info_t akd_inputs[] = {<br>
{0x6064, 0, 32}, // position actual //6064<br>
{0x6041, 0, 16}, // status<br>
{0x3470, 0, 16} // Aux Ai<br>
};</div>
<div> </div>
<div>static ec_pdo_info_t akd_in_pdos[] = {<br>
{0x1A00, 3, akd_inputs}<br>
};</div>
<div> </div>
<div>static ec_sync_info_t akd_syncs[] = {<br>
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},<br>
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},<br>
{2, EC_DIR_OUTPUT, 1, akd_out_pdos, EC_WD_DISABLE},<br>
{3, EC_DIR_INPUT , 1, akd_in_pdos, EC_WD_DISABLE },<br>
{0xff}</div>
<div> </div>
<div> </div>
<div>int init_module(void)<br>
//------------------------------------------------------------------------------<br>
{</div>
<div> RTIME tick_period;<br>
</div>
<div><br>
ec_slave_config_t *sc;<br>
<br>
<br>
/*.... Open the shared memory partition ...*/</div>
<div> if ((dp = rt_shm_alloc(nam2num("SHM"),sizeof(struct datapool),USE_VMALLOC)) == 0)<br>
{<br>
printk("jumplist.c-init_module - Could not start JUMPLIST, error opening shared memory.\n");<br>
rt_task_delete(&rt_task);<br>
return 1;<br>
}</div>
<div> rt_sem_init(&master_sem, 1);</div>
<div> </div>
<div> <br>
if (!(master = ecrt_request_master(0))) {<br>
printk("Requesting master 0 failed!\n");<br>
goto out_return;<br>
}</div>
<div> </div>
<div> <br>
ecrt_master_callbacks(master, send_callback, receive_callback, master);</div>
<div> printk("Registering domain...\n");<br>
if (!(domain1 = ecrt_master_create_domain(master))) {<br>
printk("Domain creation failed!\n");<br>
goto out_release_master;<br>
}</div>
<div> </div>
<div> </div>
<div> printk("Configure get slave configuration 0 0 .\n");<br>
if (!(sc = ecrt_master_slave_config(master, 0, 0, AKD_ID) ) )<br>
{<br>
printk("Failed to get slave configuration.\n");<br>
goto out_release_master;<br>
}</div>
<div> </div>
<div> printk("Configuring PDOs...\n");<br>
if ( ecrt_slave_config_pdos(sc, EC_END, akd_syncs) )<br>
{<br>
printk("Failed to configure PDOs.\n");<br>
goto out_release_master;<br>
}</div>
<div> </div>
<div> <br>
#if 1<br>
printk("Registering PDO entries...\n");<br>
if ( ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs) )<br>
{<br>
printk("PDO entry registration failed!\n");<br>
goto out_release_master;<br>
}<br>
#endif</div>
<div> </div>
<div> </div>
<div> printk("Activating master...\n");<br>
if ( ecrt_master_activate(master) )<br>
{<br>
printk("Failed to activate master!\n");<br>
goto out_release_master;<br>
}</div>
<div> </div>
<div> // Get internal process data for domain</div>
<div> domain1_pd = ecrt_domain_data(domain1);<br>
</div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> // Setup tasks</div>
<div style="CLEAR: both"> rt_set_periodic_mode();<br>
<br>
rt_task_init(&rt_task, jumplist, 1, STACK_SIZE, TASK_PRIORITY, 1, 0);</div>
<div style="CLEAR: both"> tick_period = start_rt_timer(nano2count(TICK_PERIOD));</div>
<div style="CLEAR: both"> rt_task_make_periodic(&sct_rt_task, rt_get_time() + tick_period*10, tick_period);<br>
</div>
<div style="CLEAR: both"> return 0;</div>
<div style="CLEAR: both"><br>
out_release_master:<br>
printk("Releasing master...\n");<br>
ecrt_release_master(master);<br>
out_return:<br>
rt_sem_delete(&master_sem);<br>
printk("Failed to load. Aborting.\n");</div>
<div style="CLEAR: both"> return 99;</div>
<div style="CLEAR: both">}</div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both">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</div>
<div style="CLEAR: both">similar problems with Yaskawa and Parker drives </div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> </div>
<div style="CLEAR: both"> </div>
</font>