Dear All, I have successfully communicate with elmo drive using Igh Ethercat
master (written source code in C-lang). I am new to C++ and willing to make a
class for ethercat communication but I got stuck in PDO mapping. Could some
body help me out how can I initialize PDO mapping in a class.
ec_pdo_entry_info_t slave_0_pdo_entries[] = {
{0x607a, 0x00, 32}, // Target position int32
{0x60ff, 0x00, 32}, // Target velocity int32
{0x6071, 0x00, 16}, // Target torque int16
{0x6072, 0x00, 16}, // Max. Torque uint16
{0x6040, 0x00, 16}, // Control word uint16
{0x6060, 0x00, 8}, // Mode of operation uint8
{0x0002, 0x00, 8}, // Dummy Byte
{0x6064, 0x00, 32}, // Position actual value int32
{0x6077, 0x00, 16}, // Torque actual value int16
{0x6041, 0x00, 16}, // Status word uint16
{0x6061, 0x00, 8}, // Mode of operation display uint8
{0x0002, 0x00, 8}, // Dummy Byte
{0x20a0, 0x00, 32}, //absolute encoder
};
ec_pdo_info_t slave_0_pdos[] = {
{0x1605, 7, slave_0_pdo_entries + 0}, /* RPDO1 Mapping */
{0x1a02, 5, slave_0_pdo_entries + 7}, /* TPDO1 Mapping */
{0x1a1e, 1, slave_0_pdo_entries + 12}, /* TPDO2 Mapping */
};
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, 2, slave_0_pdos + 1, EC_WD_ENABLE},
{0xff}
};
I am willing to initialize above in a class because I have 25 drivers and all
have same PDO mapping.
Thank you
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users