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

Thomas Nierhoff thomasnierhoff at web.de
Mon Dec 22 10:25:20 CET 2014


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

-------------- 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[] = {
    {0x6040, 0x00, 16},
    {0x6041, 0x00, 16},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 1, 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[] = {
    {0x6040, 0x00, 16},
    {0x6041, 0x00, 16},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 1, 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[] = {
    {0x6040, 0x00, 16},
    {0x6041, 0x00, 16},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 1, 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[] = {
    {0x6040, 0x00, 16},
    {0x6041, 0x00, 16},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, slave_0_pdo_entries + 0},
    {0x1a00, 1, 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 *domain1  = NULL;
static ec_slave_config_t *sc = NULL;

static uint8_t *domain1_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;

const static ec_pdo_entry_reg_t domain1_regs[] = {
	{SlavePos, BM3411, 0x6042, 0, &off_target_velocity},
	{SlavePos, BM3411, 0x6041, 0, &off_statusword},
	{SlavePos, BM3411, 0x606c, 0, &off_actual_velocity},
};

static unsigned int counter = 0;

static ec_pdo_entry_info_t foo_pdo_entries[] = {
	{0x6042, 0, 16},	
	{0x6041, 0, 16},	
	{0x606c, 0, 32},	
};

static ec_pdo_info_t foo_pdos[] = {
	{0x1600, 1, foo_pdo_entries}, 
	{0x1a00, 2, foo_pdo_entries + 1}, 
};

static ec_sync_info_t foo_syncs[] = {
	{2 , EC_DIR_OUTPUT, 1, foo_pdos,     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;

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

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

    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(domain1, domain1_regs)) {
        fprintf(stderr, "PDO entry registration failed!\n");
        return -1;
    }

    return 0;
}


More information about the Etherlab-users mailing list