[etherlab-users] Failed to register PDO entry: No such file or directory

Thomas Nierhoff thomasnierhoff at web.de
Thu Jan 8 16:48:14 CET 2015


Hi,

thanks, sounds logical indeed. I played around with the shell script as 
described in the link and succeeded in a proper PDO mapping, yet the 
error stays the same. Attached you will find the shell script that works 
fine, the PDO mapping for all agents and slaves and the modified C code. 
Any idea what else could be the reason?

Best regards,

Thomas


Am 24.12.2014 um 14:15 schrieb Sebastien BLANCHET:
> Hi,
>
> The PDO mapping in main.c does not match the servo drive PDO mapping.
>
> ethercat cstruct says there are 2 pdo entries
> ec_pdo_entry_info_t slave_0_pdo_entries[] = {
>     {0x6040, 0x00, 16},
>     {0x6041, 0x00, 16},
> };
>
> but in main.c you try to map 3 pdos entries
> static ec_pdo_entry_info_t foo_pdo_entries[] = {
>     {0x6042, 0, 16},
>     {0x6041, 0, 16},
>     {0x606c, 0, 32},
> };
>
> You have to send a SDO startup sequence to define the PDO mapping you 
> want on the servo drive.
>
> see example in the following message:
> http://lists.etherlab.org/pipermail/etherlab-users/2012/001684.html
>
> regards
> ---
> Sebastien BLANCHET
>
> On 12/22/2014 10:25 AM, Thomas Nierhoff wrote:
>>
>> Hi,
>>
>> I'm using EtherLab 1.5.2. and am encountering slight problems when
>> interfacing a Baumüller servo controller via ethercat.
>>
>> The problem occurs with the "ecrt_domain_reg_pdo_entry_list" and even
>> though I compared my program with other similar ones, I can't figure out
>> where the error is. Tiny as it (hopefully) is, it's been driving me nuts
>> for the last few hours...
>>
>> Attached you will find a minimalistic C example and the ethercat cstruct
>> output. Hope it helps. The kernel message is
>>
>> [331325.826445] EtherCAT: Requesting master 0...
>> [331325.826448] EtherCAT: Successfully requested master 0.
>> [331325.826506] EtherCAT ERROR 0 6913:15107: PDO entry 0xFB30:FF is not
>> mapped.
>> [331325.826715] EtherCAT 0: Releasing master...
>> [331325.826718] EtherCAT 0: Released.
>>
>> Thanks in advance,
>>
>> Thomas
>>
>>
>>
>> _______________________________________________
>> etherlab-users mailing list
>> etherlab-users at etherlab.org
>> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>>
>

-------------- next part --------------
/* Master 0, Slave 0, "bmaXX 3400"
 * Vendor ID:       0x0000015a
 * Product code:    0x03010001
 * Revision number: 0x00010000
 */

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x6042, 0x00, 16},
    {0x6041, 0x00, 16},
    {0x606c, 0x00, 32},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 2, slave_0_pdo_entries + 1},
};

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_DISABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
    {0xff}
};

/* Master 1, Slave 0, "bmaXX 3400"
 * Vendor ID:       0x0000015a
 * Product code:    0x03010001
 * Revision number: 0x00010000
 */

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x6042, 0x00, 16},
    {0x6041, 0x00, 16},
    {0x606c, 0x00, 32},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 2, slave_0_pdo_entries + 1},
};

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_DISABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
    {0xff}
};

/* Master 2, Slave 0, "bmaXX 3400"
 * Vendor ID:       0x0000015a
 * Product code:    0x03010001
 * Revision number: 0x00010000
 */

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x6042, 0x00, 16},
    {0x6041, 0x00, 16},
    {0x606c, 0x00, 32},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 2, slave_0_pdo_entries + 1},
};

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_DISABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
    {0xff}
};

/* Master 3, Slave 0, "bmaXX 3400"
 * Vendor ID:       0x0000015a
 * Product code:    0x03010001
 * Revision number: 0x00010000
 */

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x6042, 0x00, 16},
    {0x6041, 0x00, 16},
    {0x606c, 0x00, 32},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 2, slave_0_pdo_entries + 1},
};

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_DISABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
    {0xff}
};

-------------- next part --------------
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ecrt.h>

static ec_master_t *master   = NULL;
static ec_domain_t *domain   = NULL;
static ec_slave_config_t *sc = NULL;

static uint8_t *domain_pd;	

#define SlavePos 0, 0
#define BM3411 0x0000015a, 0x03010001

static unsigned int off_target_velocity;
static unsigned int off_statusword;
static unsigned int off_actual_velocity;

/* (alias, position), (VID, PID), PDO entry index, PDO entry subindex, pointer, bit position */
const static ec_pdo_entry_reg_t domain_regs[] = {
	{SlavePos, BM3411, 0x6042, 0, &off_target_velocity},
	{SlavePos, BM3411, 0x6041, 0, &off_statusword},
	{SlavePos, BM3411, 0x606c, 0, &off_actual_velocity},
};

/* PDO index, subindex, size in bits */
static ec_pdo_entry_info_t foo_pdo_entries[] = {
	{0x6042, 0, 16},	
	{0x6041, 0, 16},	
	{0x606c, 0, 32},	
};

/* PDO index, #entries, array of entries to map */
static ec_pdo_info_t foo_pdos[] = {
	{0x1600, 1, foo_pdo_entries + 0}, 
	{0x1a00, 2, foo_pdo_entries + 1}, 
};

/* Sync manager index, SM direction, #PDOs, arrays with PDOs to assign */
static ec_sync_info_t foo_syncs[] = {
    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
    {1, EC_DIR_INPUT,  0, NULL, EC_WD_DISABLE},
    {2, EC_DIR_OUTPUT, 1, foo_pdos + 0, EC_WD_DISABLE},
    {3, EC_DIR_INPUT,  1, foo_pdos + 1, EC_WD_DISABLE},
    {0xff}
};

int main(int argc, char **argv)
{
    ec_slave_config_t *sc;

    master = ecrt_request_master(0);
    if (!master) return -1;

    domain = ecrt_master_create_domain(master);
    if (!domain) return -1;

    if (!(sc = ecrt_master_slave_config(master, SlavePos, BM3411))) {
        fprintf(stderr, "Failed to get slave configuration.\n");
        return -1;
    }

    ecrt_slave_config_sdo8( sc, 0x1600, 0, 0 );           /* clear RxPdo 0x1600 */
    ecrt_slave_config_sdo8( sc, 0x1A00, 0, 0 ); 	  /* clear TxPdo 0x1A00 */
    ecrt_slave_config_sdo32( sc, 0x1600, 1, 0x60420010 ); /* 0x6042:16bits, velocity command */
    ecrt_slave_config_sdo32( sc, 0x1A00, 1, 0x60410010 ); /* 0x6041:16bits, status word */
    ecrt_slave_config_sdo32( sc, 0x1A00, 2, 0x606c0020 ); /* 0x606c:32bits, actual velocity */
    ecrt_slave_config_sdo8( sc, 0x1600, 0, 1 );           /* set number of PDO entries for RxPdo 0x1600 */
    ecrt_slave_config_sdo8( sc, 0x1A00, 0, 2 ); 	  /* set number of PDO entries for TxPdo 0x1A00 */

    ecrt_slave_config_sdo8( sc, 0x1C12, 0, 1 );           /* set number of RxPDO */
    ecrt_slave_config_sdo16( sc, 0x1C12, 1, 0x1600 );     /* list all RxPdo in 0x1C12 */

    ecrt_slave_config_sdo8( sc, 0x1C13, 0, 1 );           /* set number of TxPDO */
    ecrt_slave_config_sdo16( sc, 0x1C13, 1, 0x1A00 );     /* list all TxPdo in 0x1C13 */

    printf("Configuring PDOs...\n");
    if (ecrt_slave_config_pdos(sc, EC_END, foo_syncs)) {
        fprintf(stderr, "Failed to configure PDOs.\n");
        return -1;
    }

    if (!(sc = ecrt_master_slave_config(
                    master, SlavePos, BM3411))) {
        fprintf(stderr, "Failed to get slave configuration.\n");
        return -1;
    }

    /* error occurs here */
    if (ecrt_domain_reg_pdo_entry_list(domain, domain_regs)) {
        fprintf(stderr, "PDO entry registration failed!\n");
        return -1;
    }

    return 0;
}
-------------- next part --------------
POS=-m0

ethercat download $POS --type uint8 0x1600 0 0 # clear RxPdo 0x1600
ethercat download $POS --type uint8 0x1A00 0 0 # clear TxPdo 0x1A00

ethercat download $POS --type uint32 0x1600 1 0x60420010 # 0x6042:16bits, velocity command
ethercat download $POS --type uint32 0x1A00 1 0x60410010 # 0x6041:16bits, status word
ethercat download $POS --type uint32 0x1A00 2 0x606c0020 # 0x606c:32bits, actual velocity

ethercat download $POS --type uint8 0x1600 0 1 # set number of PDO entries for RxPdo 0x1600
ethercat download $POS --type uint8 0x1A00 0 2 # set number of PDO entries for TxPdo 0x1A00

ethercat download $POS --type uint8 0x1C12 0 1       # set number of RxPDO
ethercat download $POS --type uint16 0x1C12 1 0x1600 # list all RxPdo in 0x1C12
ethercat download $POS --type uint8 0x1C13 0 1       # set number of TxPDO
ethercat download $POS --type uint16 0x1C13 1 0x1A00 # list all TxPdo in 0x1C13

ethercat rescan
sleep 1
ethercat cstruct


More information about the Etherlab-users mailing list