[etherlab-users] what ecrt_domain_reg_pdo_entry_list is allocatin a new slave ?

Raz Ben Yehuda rbenyehuda at manz.com
Thu Jun 21 10:06:48 CEST 2012


I am trying to figure out why I am missing a slave SM.

$ ethercat domain -v
Domain0: LogBaseAddr 0x00000000, Size   2, WorkingCounter 0/1
  SlaveConfig 0:0, SM2 (Output), LogAddr 0x00000000, Size 2
    00 00 


but :

$ ethercat cstruct 
/* Master 0, Slave 0, "netX50 LOM Demo Example Packet API"
 * Vendor ID:       0xe0000044
 * Product code:    0x0000001a
 * Revision number: 0x00000000
 */

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x2003, 0x10, 16},
    {0x2003, 0x10, 16},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0}, /* RxPDO 1 */
    {0x1a00, 1, slave_0_pdo_entries + 1}, /* TxPDO 1 */
};

ec_sync_info_t slave_0_syncs[] = {
    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
    {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
    {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
    {0xff}
};


an my sample code is derived from examples/user/main.c:
const static ec_pdo_entry_reg_t domain1_regs[] = {

        {0,0, netX50_blabla, 0x2003, 0x10, &off_bytes1, &off_bits1},
        {}
};

ecrt_request_maser(0)
ecrt_master_create_domain()
ecrt_master_slave_config(master,0,0,netX50_blabla)
ecrt_slave_config_pdos(sc_ana_in, EC_END, slave_0_syncs)
ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)
ecrt_master_activate
pd = ecrt_domain_data

debugging ethercat with debug level 1, it appears that
ecrt_domain_reg_pdo_entry_list re-allocates slaves
and creates a single SM while there are 2. Thus, I am not getting any
traffic from the slave.

why do you a rellocate slave ?

what is wrong anyway ? 

thank you



-- 

http://raziebe.wix.com/ironspeedlinux#!Home/mainPage 





More information about the Etherlab-users mailing list