Hello all,

I am using Beckhoff AX5201(2 channel servo drive), the cstruct is:

 #/opt/etherlab/bin/ethercat cstruct  -p1
ec_pdo_entry_info_t slave_1_pdo_entries[] = {
{0x0086, 0x00, 16}, /* Master control word */
{0x0024, 0x00, 32}, /* Velocity command value */
{0x0086, 0x00, 16}, /* Master control word */
{0x0024, 0x00, 32}, /* Velocity command value */
{0x0087, 0x00, 16}, /* Drive status word */
{0x0033, 0x00, 32}, /* Position feedback 1 value */
{0x0087, 0x00, 16}, /* Drive status word */
{0x0033, 0x00, 32}, /* Position feedback 1 value */
};
ec_pdo_info_t slave_1_pdos[] = {
{0x0018, 2, slave_1_pdo_entries + 0}, /* MDT 1 */
{0x1018, 2, slave_1_pdo_entries + 2}, /* MDT 2 */
{0x0010, 2, slave_1_pdo_entries + 4}, /* AT 1 */
{0x1010, 2, slave_1_pdo_entries + 6}, /* AT 2 */
};
ec_sync_info_t slave_1_syncs[] = {
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
{2, EC_DIR_OUTPUT, 2, slave_1_pdos + 0, EC_WD_DISABLE},
{3, EC_DIR_INPUT, 2, slave_1_pdos + 2, EC_WD_DISABLE},
{0xff}
};

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?
I also try to write them like this:
ecrt_master_write_idn(master, 0, 0, 0x86, pdata0, 2, error_code);  //for
channel 1    drive_no=0
ecrt_master_write_idn(master, 0, 1, 0x86, pdata0, 2, error_code);  //for
channel 2    drive_no=1
but when I put them in cycle, I got an error "Failed to write
IDN:Iput/output error", then the drive stayed in INIT.  Why I got this
error? What's the best solution for my problem?

Best Regards
Maggie
_______________________________________________
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to