[etherlab-users] about configuration of domain

li.peng li.peng at advantech.com.cn
Wed Dec 10 06:42:04 CET 2008


Hi Florian,
When i use domain1_regs as below,
const static ec_pdo_entry_reg_t domain1_regs[] = {
//    {SlavePos, Hilcher_CIF50, 0x3000, 1, &off_in1},
//    {SlavePos, Hilcher_CIF50, 0x3000, 2, &off_in2},
//    {SlavePos, Hilcher_CIF50, 0x3000, 3, &off_in3},
//    {SlavePos, Hilcher_CIF50, 0x3000, 4, &off_in4},
    {SlavePos, Hilcher_CIF50, 0x2000, 1, &off_out1},
    {SlavePos, Hilcher_CIF50, 0x2000, 2, &off_out2},
    {SlavePos, Hilcher_CIF50, 0x2000, 3, &off_out3},
    {SlavePos, Hilcher_CIF50, 0x2000, 4, &off_out4},
    {}
};

But when like this, data can not exchange with slave.
const static ec_pdo_entry_reg_t domain1_regs[] = {
    {SlavePos, Hilcher_CIF50, 0x3000, 1, &off_in1},
    {SlavePos, Hilcher_CIF50, 0x3000, 2, &off_in2},
    {SlavePos, Hilcher_CIF50, 0x3000, 3, &off_in3},
    {SlavePos, Hilcher_CIF50, 0x3000, 4, &off_in4},
    {SlavePos, Hilcher_CIF50, 0x2000, 1, &off_out1},
    {SlavePos, Hilcher_CIF50, 0x2000, 2, &off_out2},
    {SlavePos, Hilcher_CIF50, 0x2000, 3, &off_out3},
    {SlavePos, Hilcher_CIF50, 0x2000, 4, &off_out4},
    {}
};

PDO Configuration:
static ec_pdo_entry_info_t CIF50_pdo_entries[] = {
    {0x2000, 1, 8}, // channel 1 status
    {0x2000, 2, 8}, // channel 1 value
    {0x2000, 3, 8}, // channel 2 status
    {0x2000, 4, 8}, // channel 2 value
    {0x3000, 1, 8}, // channel 1 status
    {0x3000, 2, 8}, // channel 1 value
    {0x3000, 3, 8}, // channel 2 status
    {0x3000, 4, 8}, // channel 2 value
};

static ec_pdo_info_t CIF50_pdos[] = {
    {0x1A00, 4, CIF50_pdo_entries + 4},
    {0x1600, 4, CIF50_pdo_entries}
};

static ec_sync_info_t CIF50_syncs[] = {
    {2, EC_DIR_OUTPUT, 1, CIF50_pdos+1},
    {3, EC_DIR_INPUT, 1, CIF50_pdos},
    {0xff}
};

Best regards,
Li.peng


More information about the Etherlab-users mailing list