<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Hi,</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>My AKD drive slave refuses to go to operational. Any suggestions why?</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>This is what dmesg tells me when trying:</b><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[53271.293863] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
<div>[53271.294126] EtherCAT ERROR 0-0: AL status message 0x001D: "Invalid output configuration".</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>The AKD drive is the only slave on the bus</b><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>$ sudo ethercat slaves</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
0 901:0 PREOP E AKD EtherCAT Drive (CoE)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>and I've configured it so that I get</b><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>$ sudo ethercat cstruct -p0</b>
<div>/* Master 0, Slave 0, "AKD"</div>
<div> * Vendor ID: 0x0000006a</div>
<div> * Product code: 0x00414b44</div>
<div> * Revision number: 0x00000002</div>
<div> */</div>
<div><br>
</div>
<div>ec_pdo_entry_info_t slave_0_pdo_entries[] = {</div>
<div> {0x6040, 0x00, 16},</div>
<div> {0x60c1, 0x01, 32},</div>
<div> {0x6041, 0x00, 16},</div>
<div> {0x3470, 0x04, 16},</div>
<div> {0x60fd, 0x00, 32},</div>
<div> {0x606c, 0x00, 32},</div>
<div> {0x6063, 0x00, 32},</div>
<div>};</div>
<div><br>
</div>
<div>ec_pdo_info_t slave_0_pdos[] = {</div>
<div> {0x1600, 2, slave_0_pdo_entries + 0},</div>
<div> {0x1a00, 3, slave_0_pdo_entries + 2},</div>
<div> {0x1a01, 2, slave_0_pdo_entries + 5},</div>
<div>};</div>
<div><br>
</div>
<div>ec_sync_info_t slave_0_syncs[] = {</div>
<div> {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},</div>
<div> {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},</div>
<div> {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_DISABLE},</div>
<div> {3, EC_DIR_INPUT, 2, slave_0_pdos + 1, EC_WD_DISABLE},</div>
<div> {0xff}</div>
<div>};</div>
<br>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>I've tried with the command line tool... <br>
</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>$ sudo ethercat states OP</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b><br>
</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>..and with my c-application. But the result is the same.<br>
</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b><br>
</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>One thing that puzzles me is the size of the synch managers SM2 and SM3:</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>$ sudo ethercat pdos</b>
<div>SM0: PhysAddr 0x1800, DefaultSize 1024, ControlRegister 0x26, Enable 1</div>
<div>SM1: PhysAddr 0x1c00, DefaultSize 1024, ControlRegister 0x22, Enable 1</div>
<div>SM2: PhysAddr 0x1100, DefaultSize 0, ControlRegister 0x24, Enable 1</div>
<div> RxPDO 0x1600 ""</div>
<div> PDO entry 0x6040:00, 16 bit, ""</div>
<div> PDO entry 0x60c1:01, 32 bit, ""</div>
<div>SM3: PhysAddr 0x1140, DefaultSize 0, ControlRegister 0x20, Enable 1</div>
<div> TxPDO 0x1a00 ""</div>
<div> PDO entry 0x6041:00, 16 bit, ""</div>
<div> PDO entry 0x3470:04, 16 bit, ""</div>
<div> PDO entry 0x60fd:00, 32 bit, ""</div>
<div> TxPDO 0x1a01 ""</div>
<div> PDO entry 0x606c:00, 32 bit, ""</div>
<div> PDO entry 0x6063:00, 32 bit, ""</div>
<br>
<b>Should they really have DefaultSize 0?</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>$ sudo ethercat versionIgH EtherCAT master 1.5.2 53ce5e56d511</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>$ uname -a Linux ctrlPC1 5.4.54-rt32 #1 SMP PREEMPT_RT Wed Aug 12 12:59:33 CEST 2020 x86_64 x86_64 x86_64 GNU/Linux</b><br>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Detailed dmesg printout:</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[54154.149923] EtherCAT: Master driver 1.5.2 53ce5e56d511
<div>[54154.149991] EtherCAT: 1 master waiting for devices.</div>
<div>[54154.154118] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 53ce5e56d511</div>
<div>[54154.154127] EtherCAT: Accepting 78:D0:04:27:52:E4 as main device for master 0.</div>
<div>[54154.154131] ec_generic: Binding socket to interface 4 (enp0s31f6).</div>
<div>[54154.189154] EtherCAT 0: Starting EtherCAT-IDLE thread.</div>
<div>[54154.189384] EtherCAT 0: Link state of ecm0 changed to UP.</div>
<div>[54154.197141] EtherCAT 0: 1 slave(s) responding on main device.</div>
<div>[54154.197149] EtherCAT 0: Slave states on main device: PREOP.</div>
<div>[54154.197613] EtherCAT 0: Scanning bus.</div>
<div>[54154.489005] EtherCAT 0: Bus scanning completed in 292 ms.</div>
<div>[54154.489006] EtherCAT 0: Using slave 0 as DC reference clock.</div>
<div>[54154.489007] EtherCAT 0: Starting EoE thread.</div>
<div>[54154.521934] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).</div>
<div>[54154.522227] EtherCAT ERROR 0-0: AL status message 0x001D: "Invalid output configuration".</div>
<div>[54154.525166] EtherCAT 0-0: Acknowledged state PREOP.</div>
<div><br>
</div>
<div><br>
</div>
<div>Any ideas?</div>
<div><br>
</div>
<div>Best Regards,</div>
<div><br>
</div>
<div>Joachim Sällvin</div>
<div><br>
</div>
<div>Software Developer <br>
</div>
<div>CorpowerOcean<br>
</div>
<div><b><br>
</b></div>
<div><b><br>
</b></div>
<div><b><br>
</b></div>
<div><b><br>
</b></div>
<div><br>
</div>
<br>
<br>
</div>
</body>
</html>