<div>Hello all,</div><div> </div><div>I am using Beckhoff AX5201(2 channel servo drive), the cstruct is:</div><div> </div><div> #/opt/etherlab/bin/ethercat cstruct -p1 <div> ec_pdo_entry_info_t slave_1_pdo_entries[] = {<br>
{0x0086, 0x00, 16}, /* Master control word */<br>{0x0024, 0x00, 32}, /* Velocity command value */<br>{0x0086, 0x00, 16}, /* Master control word */<br>{0x0024, 0x00, 32}, /* Velocity command value */<br>{0x0087, 0x00, 16}, /* Drive status word */<br>
{0x0033, 0x00, 32}, /* Position feedback 1 value */<br>{0x0087, 0x00, 16}, /* Drive status word */<br>{0x0033, 0x00, 32}, /* Position feedback 1 value */<br>};<br>ec_pdo_info_t slave_1_pdos[] = {<br>{0x0018, 2, slave_1_pdo_entries + 0}, /* MDT 1 */<br>
{0x1018, 2, slave_1_pdo_entries + 2}, /* MDT 2 */<br>{0x0010, 2, slave_1_pdo_entries + 4}, /* AT 1 */<br>{0x1010, 2, slave_1_pdo_entries + 6}, /* AT 2 */<br>};<br>ec_sync_info_t slave_1_syncs[] = {<br>{0, <font face="arial,helvetica,sans-serif">EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE</font>},<br>
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},<br>{2, EC_DIR_OUTPUT, 2, slave_1_pdos + 0, EC_WD_DISABLE},<br>{3, EC_DIR_INPUT, 2, slave_1_pdos + 2, EC_WD_DISABLE},<br>{0xff}<br>}; </div><div> </div><div>I need to write "Master control word "of 2 channels in cycle(because 1 channel controls 1 servo). But their pdo entries is the same, if I register both of them to domain with ecrt_slave_config_reg_pdo_entry(), how to distinguish them?</div>
<div>I also try to write them like this:</div><div>ecrt_master_write_idn(master, 0, 0, 0x86, pdata0, 2, error_code); //for channel 1 drive_no=0</div><div><div>ecrt_master_write_idn(master, 0, 1, 0x86, pdata0, 2, error_code); //for channel 2 drive_no=1</div>
<div>but when I put them in cycle, I got an error "<font style="background-color:rgb(255,255,102)">Failed to write IDN:Iput/output error</font>", then the drive stayed in INIT. Why I got this error? What's the best solution for my problem?</div>
<div> </div><div>Best Regards</div><div>Maggie</div></div></div>