<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>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.<br><br><br> ec_pdo_entry_info_t slave_0_pdo_entries[] = {<br> {0x607a, 0x00, 32}, // Target position int32<br> {0x60ff, 0x00, 32}, // Target velocity int32<br> {0x6071, 0x00, 16}, // Target torque int16<br> {0x6072, 0x00, 16}, // Max. Torque uint16<br> {0x6040, 0x00, 16}, // Control word uint16<br> {0x6060, 0x00, 8}, // Mode of operation uint8<br> {0x0002, 0x00, 8}, // Dummy Byte<br> {0x6064, 0x00, 32}, // Position actual value int32<br> {0x6077, 0x00, 16}, // Torque actual value int16<br> {0x6041, 0x00, 16}, // Status word uint16<br> {0x6061, 0x00, 8}, // Mode of operation display uint8<br> {0x0002, 0x00, 8}, // Dummy Byte<br> {0x20a0, 0x00, 32}, //absolute encoder<br>};<br><br>ec_pdo_info_t slave_0_pdos[] = {<br> {0x1605, 7, slave_0_pdo_entries + 0}, /* RPDO1 Mapping */<br> {0x1a02, 5, slave_0_pdo_entries + 7}, /* TPDO1 Mapping */<br> {0x1a1e, 1, slave_0_pdo_entries + 12}, /* TPDO2 Mapping */<br>};<br><br>ec_sync_info_t slave_0_syncs[] = {<br> {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},<br> {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},<br> {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},<br> {3, EC_DIR_INPUT, 2, slave_0_pdos + 1, EC_WD_ENABLE},<br> {0xff}<br>};<br><br><br>I am willing to initialize above in a class because I have 25 drivers and all have same PDO mapping.<br><br>Thank you<br> </div></body>
</html>