<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
I find I have to fire up TwinCAT System Manager on a Windows VM and go through how it would configure the card for the more complicated slaves. If you check the right boxes, it will list the entire raw process you need for initializing the card properly.
<div class=""><br class="">
</div>
<div class="">Based on that, here’s what I do for the EL7041 and EP7041 (they configure the same). I’ve used it with dozens of them; it’s my go-to stepper card. Word of caution: put an EL9100 in front of the card, or position will be reset every time someone
 presses E-Stop, then control power is restored. There is no software solution to this. What I have my company do is put the EL9100 then EL7041 at the end of the rack. We leave the EL9100 powered at all times, then E-Stop breaks the motor power.
<div class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">//<span class="Apple-tab-span" style="white-space:pre"> </span>vendor id, product id</div>
<div class="">#define BECKHOFF_EL7041 0x00000002, 0x1b813052</div>
<div class="">#define BECKHOFF_EP7041 0x00000002, 0x1b814052</div>
<div class=""><br class="">
</div>
<div class="">#define EL70X1_STEPPERTYPE BECKHOFF_EP7041</div>
<div class=""><br class="">
</div>
<div class="">#define EL70X1_STEPSPERREV<span class="Apple-tab-span" style="white-space:pre">
</span>200</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">/////////////////////////////////////////////////////////////////////</div>
<div class="">// Private Variables</div>
<div class="">/////////////////////////////////////////////////////////////////////</div>
<div class=""><br class="">
</div>
<div class="">static ec_pdo_entry_info_t el7041_pdo_entries_[] = {</div>
<div class="">    </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>///////////////////////</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Output PDOS</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// PDO 0x1601</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7000, 0x01, 1}, /* Enable latch C */</div>
<div class="">    {0x7000, 0x02, 1}, /* Enable latch extern on positive edge */</div>
<div class="">    {0x7000, 0x03, 1}, /* Set counter */</div>
<div class="">    {0x7000, 0x04, 1}, /* Enable latch extern on negative edge */</div>
<div class="">    {0x0000, 0x00, 4}, /* Gap */</div>
<div class="">    {0x0000, 0x00, 8}, /* Gap */</div>
<div class="">    {0x7000, 0x11, 32}, /* Set counter value */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// PDO 0x1602</div>
<div class="">    {0x7010, 0x01, 1}, /* Enable */</div>
<div class="">    {0x7010, 0x02, 1}, /* Reset */</div>
<div class="">    {0x7010, 0x03, 1}, /* Reduce torque */</div>
<div class="">    {0x0000, 0x00, 5}, /* Gap */</div>
<div class="">    {0x0000, 0x00, 8}, /* Gap */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// PDO 0x1606</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x01, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Control_Execute</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x02, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Emergency Stop</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x0000, 0x00, 6},<span class="Apple-tab-span" style="white-space:pre">
</span>// Gap</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x0000, 0x00, 8},<span class="Apple-tab-span" style="white-space:pre">
</span>// Gap</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x11, 32},<span class="Apple-tab-span" style="white-space:pre">
</span>// Target Position</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x21, 16},<span class="Apple-tab-span" style="white-space:pre">
</span>// Velocity</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x22, 16},<span class="Apple-tab-span" style="white-space:pre">
</span>// Start type</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x23, 16},<span class="Apple-tab-span" style="white-space:pre">
</span>// Acceleration </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x7020, 0x24, 16},<span class="Apple-tab-span" style="white-space:pre">
</span>// Deceleration </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//////////////////////////</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Input PDOs</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// PDO 0x1A01</div>
<div class="">    {0x6000, 0x01, 1}, /* Latch C valid */</div>
<div class="">    {0x6000, 0x02, 1}, /* Latch extern valid */</div>
<div class="">    {0x6000, 0x03, 1}, /* Set counter done */</div>
<div class="">    {0x6000, 0x04, 1}, /* Counter underflow */</div>
<div class="">    {0x6000, 0x05, 1}, /* Counter overflow */</div>
<div class="">    {0x0000, 0x00, 2}, /* Gap */</div>
<div class="">    {0x6000, 0x08, 1}, /* Extrapolation stall */</div>
<div class="">    {0x6000, 0x09, 1}, /* Status of input A */</div>
<div class="">    {0x6000, 0x0a, 1}, /* Status of input B */</div>
<div class="">    {0x6000, 0x0b, 1}, /* Status of input C */</div>
<div class="">    {0x0000, 0x00, 1}, /* Gap */</div>
<div class="">    {0x6000, 0x0d, 1}, /* Status of extern latch */</div>
<div class="">    {0x1c32, 0x20, 1}, /* Sync error */</div>
<div class="">    {0x0000, 0x00, 1}, /* Gap */</div>
<div class="">    {0x1801, 0x09, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status TxPDO Toggle</div>
<div class="">    {0x6000, 0x11, 32}, /* Internal Counter value */</div>
<div class="">    {0x6000, 0x12, 32}, /* Latch value */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// PDO 0x1A03</div>
<div class="">    {0x6010, 0x01, 1}, /* Ready to enable */</div>
<div class="">    {0x6010, 0x02, 1}, /* Ready */</div>
<div class="">    {0x6010, 0x03, 1}, /* Warning */</div>
<div class="">    {0x6010, 0x04, 1}, /* Error */</div>
<div class="">    {0x6010, 0x05, 1}, /* Moving positive */</div>
<div class="">    {0x6010, 0x06, 1}, /* Moving negative */</div>
<div class="">    {0x6010, 0x07, 1}, /* Torque reduced */</div>
<div class="">    {0x0000, 0x00, 1}, /* Gap */</div>
<div class="">    {0x0000, 0x00, 3}, /* Gap */</div>
<div class="">    {0x6010, 0x0c, 1}, /* Digital input 1 */</div>
<div class="">    {0x6010, 0x0d, 1}, /* Digital input 2 */</div>
<div class="">    {0x1c32, 0x20, 1}, /* Sync error */</div>
<div class="">    {0x0000, 0x00, 1}, /* Gap */</div>
<div class="">    {0x1803, 0x09, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status TxPDO Toggle</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// PDO 0x1A06</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x01, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status Busy</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x02, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status In Target</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x03, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status Warning</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x04, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status Error</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x05, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status Calibrated</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x06, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status Accelerate</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x07, 1},<span class="Apple-tab-span" style="white-space:pre">
</span>// Status Decelerate</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x0000, 0x00, 1},
<span class="Apple-tab-span" style="white-space:pre"></span>// GAP</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x0000, 0x00, 8},<span class="Apple-tab-span" style="white-space:pre">
</span>// GAP</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x11, 32},<span class="Apple-tab-span" style="white-space:pre">
</span>// Actual Position</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x21, 16},<span class="Apple-tab-span" style="white-space:pre">
</span>// Actual Velocity</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x6020, 0x22, 32},<span class="Apple-tab-span" style="white-space:pre">
</span>// Actual drive time</div>
<div class="">};</div>
<div class=""><br class="">
</div>
<div class="">static ec_pdo_info_t el7041_pdos_[] = {</div>
<div class="">    {0x1601, 7, el7041_pdo_entries_ + 0}, /* ENC RxPDO-Map Control compact */</div>
<div class="">    {0x1602, 5, el7041_pdo_entries_ + 7}, /* STM RxPDO-Map Control */</div>
<div class="">    {0x1606, 9, el7041_pdo_entries_ + 12}, /* STM RxPDO-Map Velocity */</div>
<div class="">    {0x1a01, 17, el7041_pdo_entries_ + 21}, /* ENC TxPDO-Map Status compact */</div>
<div class="">    {0x1a03, 14, el7041_pdo_entries_ + 38}, /* STM TxPDO-Map Status */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0x1a06, 12, el7041_pdo_entries_ + 52}, /* STM TxPDO-Map Status */</div>
<div class="">};</div>
<div class=""><br class="">
</div>
<div class="">static ec_sync_info_t el7041_syncs_[] = {</div>
<div class="">    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},</div>
<div class="">    {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},</div>
<div class="">    {2, EC_DIR_OUTPUT, 3, el7041_pdos_ + 0, EC_WD_DISABLE},</div>
<div class="">    {3, EC_DIR_INPUT, 3, el7041_pdos_ + 3, EC_WD_DISABLE},</div>
<div class="">    {0xff}</div>
<div class="">};</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">//</div>
<div class="">// Configure the slave into the EtherCAT network</div>
<div class="">//</div>
<div class="">BOOL</div>
<div class="">el70X1_ecConfigure(</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>EL70X1StepperInterface* el,</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ec_master_t* master,</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>unsigned int slavePosDomain,</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>unsigned int slavePosIndex)</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class="">{</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ec_slave_config_t* sc;</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>PRINTF( CTSMSG_INFO "Begin el70X1_ecConfigure...\n") ;</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Create the slave configuration</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>if ( !(sc = ecrt_master_slave_config(</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>master, </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>slavePosDomain, slavePosIndex,
<span class="Apple-tab-span" style="white-space:pre"></span>// Bus position</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>EL70X1_STEPPERTYPE<span class="Apple-tab-span" style="white-space:pre">
</span>// Slave type</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>)) ) </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>PRINTF(CTSMSG_INFO</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>"el70X1_ecConfigure -- Failed to get slave configuration.\n");</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>   return FALSE;</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>}<span class="Apple-tab-span" style="white-space:pre">
</span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Map the PDOs</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Pre-configured PDO mappings</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Use the complete position mapping</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class="">    ecrt_slave_config_sdo8( sc, 0x1C12, 0, 0 ); /* clear sm pdo 0x1c12 */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x1C12, 1, 0x1601 ); /* download pdo 1C12 index */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x1C12, 2, 0x1602 ); /* download pdo 1C12 index */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x1C12, 3, 0x1606 ); /* download pdo 1C12 index */</div>
<div class="">    ecrt_slave_config_sdo8( sc, 0x1C12, 0, 3 ); /* set number of RxPDO */</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo8( sc, 0x1C13, 0, 0 ); /* clear sm pdo 0x1c12 */<span class="Apple-tab-span" style="white-space:pre">
</span></div>
<div class="">    ecrt_slave_config_sdo16( sc, 0x1C13, 1, 0x1A01 ); /* download pdo 1C13 index */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x1C13, 2, 0x1A03 ); /* download pdo 1C13 index */</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x1C13, 3, 0x1A06 ); /* download pdo 1C13 index */</div>
<div class="">    ecrt_slave_config_sdo8( sc, 0x1C13, 0, 3 ); /* set number of TxPDO */<span class="Apple-tab-span" style="white-space:pre">
</span></div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Register startup configuration for the hardware</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set the maximum current for the drive</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Unit: 1 mA</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x8010, 0x01, 4630 );</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set the holding current</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Unit: 1 mA</div>
<div class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>ecrt_slave_config_sdo16( sc, 0x8010, 0x02, 500 );</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set the nominal voltage</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Unit: 1 mv / 1000</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x8010, 0x03, 48000 );</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set motor coil resistance</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Unit: 0.01 ohm</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x8010, 0x04, 104 );</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set Motor full steps per revolution</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// unit: steps</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x8010, 0x06, EL70X1_STEPSPERREV );</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set Kp Factor</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Unit: 0.001</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x8011, 0x01, 200);</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set filter limit frequencey of the current controller (low-pass)</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Unit: 1hz</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>ecrt_slave_config_sdo16( sc, 0x8011, 0x06, 0);</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Configure the hardware's PDOs</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>if (ecrt_slave_config_pdos(sc, EC_END, el7041_syncs_)) </div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>   PRINTF(CTSMSG_INFO</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>"el70X1_ecConfigure -- Failed to configure PDOs.\n");</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>   return FALSE;</div>
<div class="">    }<span class="Apple-tab-span" style="white-space:pre"> </span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Set the initial state</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>el->fsm = &stateReset;</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>PRINTF(CTSMSG_INFO "el70X1_ecConfigure was SUCCESSFUL...\n");</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>return TRUE;</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class="">}</div>
</div>
<div class=""><br class="">
</div>
<div class="">Also, somewhere in your PDO registry list, you’ll need:</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>// Stepper Drive Y   EP7041-0002</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>//</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7000, 0x03, &pgbl_stepperY.off_controlSetCounter, &pgbl_stepperY.off_controlSetCounter_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7000, 0x11, &pgbl_stepperY.off_setCounterValue, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7010, 0x01, &pgbl_stepperY.off_controlEnable, &pgbl_stepperY.off_controlEnable_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7010, 0x02, &pgbl_stepperY.off_controlReset, &pgbl_stepperY.off_controlReset_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space: pre;"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x01, &pgbl_stepperY.off_controlExecute, &pgbl_stepperY.off_controlExecute_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x02, &pgbl_stepperY.off_controlEmergencyStop, &pgbl_stepperY.off_controlEmergencyStop_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x11, &pgbl_stepperY.off_targetPosition, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x21, &pgbl_stepperY.off_velocity, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x22, &pgbl_stepperY.off_startType, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x22, &pgbl_stepperY.off_acceleration, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x7020, 0x22, &pgbl_stepperY.off_deceleration, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space: pre;"></span>{0,7, EL70X1_STEPPERTYPE, 0x6000, 0x03, &pgbl_stepperY.off_statusSetCounterDone, &pgbl_stepperY.off_statusSetCounterDone_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6000, 0x11, &pgbl_stepperY.off_internalCounterValue, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6010, 0x01, &pgbl_stepperY.off_readyToEnable, &pgbl_stepperY.off_readyToEnable_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6010, 0x02, &pgbl_stepperY.off_ready, &pgbl_stepperY.off_ready_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6010, 0x0c, &pgbl_stepperY.off_input1, &pgbl_stepperY.off_input1_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6010, 0x0d, &pgbl_stepperY.off_input2, &pgbl_stepperY.off_input2_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6010, 0x05, &pgbl_stepperY.off_movingPositive, &pgbl_stepperY.off_movingPositive_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6010, 0x06, &pgbl_stepperY.off_movingNegative, &pgbl_stepperY.off_movingNegative_bit},<span class="Apple-tab-span" style="white-space:pre">
</span></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><span class="Apple-tab-span" style="white-space: pre;"></span>{0,7, EL70X1_STEPPERTYPE, 0x6020, 0x01, &pgbl_stepperY.off_busy, &pgbl_stepperY.off_busy_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6020, 0x02, &pgbl_stepperY.off_inTarget, &pgbl_stepperY.off_inTarget_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6020, 0x03, &pgbl_stepperY.off_warning, &pgbl_stepperY.off_warning_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6020, 0x04, &pgbl_stepperY.off_error, &pgbl_stepperY.off_error_bit},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6020, 0x11, &pgbl_stepperY.off_actualPosition, 0},</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>{0,7, EL70X1_STEPPERTYPE, 0x6020, 0x21, &pgbl_stepperY.off_actualVelocity, 0},<span class="Apple-tab-span" style="white-space:pre">
</span></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Obviously, you’ll have different position numbers and you’ll be storing your byte and bit offsets in different variables, but the above setup should get you going.</div>
<div class=""><br class="">
</div>
<div class="">Thanks!</div>
<div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="font-family: Calibri, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt;" class="">
<font face="Helvetica Neue" class=""><span style="font-size: 12px;" class="">Thomas C. Bitsky Jr. | Lead Developer</span></font></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt;" class="">
<font face="Helvetica Neue" class=""><span style="font-size: 12px;" class=""><span style="color: rgb(102, 0, 0);" class="">ADC | <a href="http://automateddesign.com/" target="_blank" style="color: rgb(149, 79, 114);" class=""><span style="color: blue;" class="">automateddesign.com</span></a></span><o:p class=""></o:p></span></font></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt;" class="">
<font face="Helvetica Neue" class=""><span style="font-size: 12px;" class="">P: 630-783-1150 F: 630-783-1159 M: 630-632-6679</span></font></div>
</div>
</div>
</div>
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On May 8, 2015, at 2:15 PM, Jakob Flierl <<a href="mailto:jakob.flierl@gmail.com" class="">jakob.flierl@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Hi,<br class="">
<br class="">
I'm trying to write a driver for EL7041-1000 for LinuxCNC, I'm getting in dmesg:<br class="">
<br class="">
[19022.235581] EtherCAT ERROR 0-3: Failed to set SAFEOP state, slave<br class="">
refused state change (PREOP + ERROR).<br class="">
[19022.239594] EtherCAT ERROR 0-3: AL status message 0x001E: "Invalid<br class="">
input configuration".<br class="">
<br class="">
The PDO mapping source code of the driver is here:<br class="">
<br class="">
<a href="https://github.com/koppi/linuxcnc-ethercat/blob/add-el7041-1000/src/lcec_el7041_1000.c#L146-L228" class="">https://github.com/koppi/linuxcnc-ethercat/blob/add-el7041-1000/src/lcec_el7041_1000.c#L146-L228</a><br class="">
<br class="">
Can't find the root cause and the drive refuses to go into OP:<br class="">
<br class="">
$ ethercat slaves<br class="">
0  0:0  OP     +  EK1100 EtherCAT-Koppler (2A E-Bus)<br class="">
1  0:1  OP     +  EL2004 4K. Dig. Ausgang 24V, 0.5A<br class="">
2  0:2  OP     +  EL1004 4K. Dig. Eingang 24V, 3ms<br class="">
3  0:3  PREOP  E  EL7041-1000 1K. Schrittmotor-Endstufe (50V, 5A, standard)<br class="">
<br class="">
For reference:<br class="">
<br class="">
$ ethercat -p3 cstruct<br class="">
/* Master 0, Slave 3, "EL7041-1000"<br class="">
* Vendor ID:       0x00000002<br class="">
* Product code:    0x1b813052<br class="">
* Revision number: 0x001403e8<br class="">
*/<br class="">
<br class="">
ec_pdo_entry_info_t slave_3_pdo_entries[] = {<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x7000, 0x02, 1},<br class="">
   {0x7000, 0x03, 1},<br class="">
   {0x7000, 0x04, 1},<br class="">
   {0x0000, 0x00, 4},<br class="">
   {0x0000, 0x00, 8},<br class="">
   {0x7000, 0x11, 16},<br class="">
   {0x7020, 0x01, 1},<br class="">
   {0x7020, 0x02, 1},<br class="">
   {0x7020, 0x03, 1},<br class="">
   {0x0000, 0x00, 5},<br class="">
   {0x0000, 0x00, 8},<br class="">
   {0x7020, 0x21, 16},<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x6000, 0x02, 1},<br class="">
   {0x6000, 0x03, 1},<br class="">
   {0x6000, 0x04, 1},<br class="">
   {0x6000, 0x05, 1},<br class="">
   {0x0000, 0x00, 2},<br class="">
   {0x6000, 0x08, 1},<br class="">
   {0x6000, 0x09, 1},<br class="">
   {0x6000, 0x0a, 1},<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x6000, 0x0d, 1},<br class="">
   {0x1c32, 0x20, 1},<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x1800, 0x09, 1},<br class="">
   {0x6000, 0x11, 16},<br class="">
   {0x6000, 0x12, 16},<br class="">
   {0x6020, 0x01, 1},<br class="">
   {0x6020, 0x02, 1},<br class="">
   {0x6020, 0x03, 1},<br class="">
   {0x6020, 0x04, 1},<br class="">
   {0x6020, 0x05, 1},<br class="">
   {0x6020, 0x06, 1},<br class="">
   {0x6020, 0x07, 1},<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x0000, 0x00, 3},<br class="">
   {0x6020, 0x0c, 1},<br class="">
   {0x6020, 0x0d, 1},<br class="">
   {0x1c32, 0x20, 1},<br class="">
   {0x0000, 0x00, 1},<br class="">
   {0x1806, 0x09, 1},<br class="">
   {0x6020, 0x11, 16},<br class="">
   {0x6020, 0x12, 16},<br class="">
};<br class="">
<br class="">
ec_pdo_info_t slave_3_pdos[] = {<br class="">
   {0x1600, 7, slave_3_pdo_entries + 0}, /* ENC RxPDO-Map Control compact */<br class="">
   {0x1604, 5, slave_3_pdo_entries + 7}, /* STM RxPDO-Map Velocity */<br class="">
   {0x1606, 1, slave_3_pdo_entries + 12},<br class="">
   {0x1a00, 17, slave_3_pdo_entries + 13}, /* ENC TxPDO-Map Status compact */<br class="">
   {0x1a06, 14, slave_3_pdo_entries + 30},<br class="">
   {0x1a07, 2, slave_3_pdo_entries + 44},<br class="">
};<br class="">
<br class="">
ec_sync_info_t slave_3_syncs[] = {<br class="">
   {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},<br class="">
   {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},<br class="">
   {2, EC_DIR_OUTPUT, 3, slave_3_pdos + 0, EC_WD_DISABLE},<br class="">
   {3, EC_DIR_INPUT, 3, slave_3_pdos + 3, EC_WD_DISABLE},<br class="">
   {0xff}<br class="">
};<br class="">
_______________________________________________<br class="">
etherlab-users mailing list<br class="">
etherlab-users@etherlab.org<br class="">
http://lists.etherlab.org/mailman/listinfo/etherlab-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>