[etherlab-dev] PDO entry with Index 0x0000, missing PDO registration

Jürgen Kunz kunz at sim.tu-darmstadt.de
Tue Mar 12 18:33:43 CET 2013


Hello,

I had the problem with a new slave-type that only the first of four
slaves worked (OP), all others were in SAFEOP +ERROR. In the debugging
output of the master (ethercat debug 1) I saw that only some of the PDOs
of the first slave hat been registered in the domain, the PDOs of the
other slaves had not been registered.
The cause is that one of the PDOs have an entry index of 0x0000 (see
pdos.txt), which causes the ecrt_domain_reg_pro_entry_list to quit, so
all other PDO entries after that are ignored.
With the attached patch (diff.txt) I get all slaves to work.

Regards,
Jürgen Kunz
-- 
Dipl.-Inform. Jürgen Kunz

Technische Universität Darmstadt <http://www.tu-darmstadt.de>
FG Simulation, Systemoptimierung und Robotik
<http://www.sim.tu-darmstadt.de>
Hochschulstr. 10
64289 Darmstadt

Tel.: ++49 (0) 6151-16-70383
Fax: ++49 (0) 6151-16-6648
E-Mail: kunz(at)sim.tu-darmstadt.de
Homepage: http://www.sim.tu-darmstadt.de
-------------- n?chster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20130312/6b04e5fd/attachment.htm>
-------------- n?chster Teil --------------
diff -r 1e8d9fcb5100 lib/domain.c
--- a/lib/domain.c	Wed Feb 06 17:52:07 2013 +0100
+++ b/lib/domain.c	Tue Mar 12 18:16:43 2013 +0100
@@ -59,7 +59,7 @@
     ec_slave_config_t *sc;
     int ret;
 
-    for (reg = regs; reg->index; reg++) {
+    for (reg = regs; reg->index || (reg->vendor_id != 0 && reg->product_code != 0); reg++) {
         if (!(sc = ecrt_master_slave_config(domain->master, reg->alias,
                         reg->position, reg->vendor_id, reg->product_code)))
             return -ENOENT;
diff -r 1e8d9fcb5100 master/domain.c
--- a/master/domain.c	Wed Feb 06 17:52:07 2013 +0100
+++ b/master/domain.c	Tue Mar 12 18:16:43 2013 +0100
@@ -399,7 +399,7 @@
     EC_MASTER_DBG(domain->master, 1, "ecrt_domain_reg_pdo_entry_list("
             "domain = 0x%p, regs = 0x%p)\n", domain, regs);
 
-    for (reg = regs; reg->index; reg++) {
+    for (reg = regs; reg->index || (reg->vendor_id != 0 && reg->product_code != 0); reg++) {
         sc = ecrt_master_slave_config_err(domain->master, reg->alias,
                 reg->position, reg->vendor_id, reg->product_code);
         if (IS_ERR(sc))
-------------- n?chster Teil --------------
SM0: PhysAddr 0x1800, DefaultSize  192, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1c00, DefaultSize  192, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1000, DefaultSize    6, ControlRegister 0x64, Enable 1
  RxPDO 0x1600 "Torque RxPDO-Map"
    PDO entry 0x6040:00, 16 bit, ""
    PDO entry 0x6071:00, 16 bit, ""
  RxPDO 0x1603 "Mode of Op RxPDO-Map"
    PDO entry 0x6060:00,  8 bit, ""
    PDO entry 0x0000:00,  8 bit, ""
SM3: PhysAddr 0x1100, DefaultSize   14, ControlRegister 0x00, Enable 1
  TxPDO 0x1a01 "Torque Long TxPDO-Map"
    PDO entry 0x6064:00, 32 bit, ""
    PDO entry 0x606c:00, 32 bit, ""
    PDO entry 0x6077:00, 16 bit, ""
    PDO entry 0x6041:00, 16 bit, ""
  TxPDO 0x1a04 "Digital Inputs TxPDO-Map"
    PDO entry 0x60fd:00, 32 bit, ""
  TxPDO 0x1a06 "Mode TxPDO-Map"
    PDO entry 0x6061:00,  8 bit, ""
    PDO entry 0x0000:00,  8 bit, ""
  TxPDO 0x1a08 "Analog Sensor TxPDO-Map"
    PDO entry 0x2000:01, 16 bit, ""
    PDO entry 0x2000:02, 16 bit, ""
    PDO entry 0x2000:03, 16 bit, ""
    PDO entry 0x2000:04, 16 bit, ""
    PDO entry 0x2000:05, 16 bit, ""
    PDO entry 0x2000:06, 16 bit, ""
-------------- n?chster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname   : kunz.vcf
Dateityp    : text/x-vcard
Dateigr??e  : 464 bytes
Beschreibung: nicht verf?gbar
URL         : <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20130312/6b04e5fd/attachment.vcf>


More information about the etherlab-dev mailing list