[etherlab-users] working counter question

Florian Pose fp at igh-essen.com
Mon Oct 27 09:34:16 CET 2008


Hi Quirino,

On Thu, Oct 23, 2008 at 01:12:59PM +0200, Quirino Nardin wrote:
> with 152 slaves, the values are not equal, it ends with the following 
> output:  (incomplete)
>  ./ethercat domains
> Domain0: LogBaseAddr 0x00000000, Size 1794, WorkingCounter 237/67

there was a problem calculating the expected working counter value for
multiple datagrams. Please try the attached patch.

-- 
Best regards,
Florian Pose

http://etherlab.org
-------------- next part --------------
Index: master/domain.c
===================================================================
--- master/domain.c	(Revision 1551)
+++ master/domain.c	(Arbeitskopie)
@@ -161,20 +161,20 @@
         }
         // If LRW is used, output FMMUs increment the working counter by 2,
         // while input FMMUs increment it by 1.
-        domain->expected_working_counter =
+        domain->expected_working_counter +=
             used[EC_DIR_OUTPUT] * 2 + used[EC_DIR_INPUT];
     } else if (used[EC_DIR_OUTPUT]) { // outputs only
         if (ec_datagram_lwr(datagram, logical_offset, data_size, data)) {
             kfree(datagram);
             return -1;
         }
-        domain->expected_working_counter = used[EC_DIR_OUTPUT];
+        domain->expected_working_counter += used[EC_DIR_OUTPUT];
     } else { // inputs only (or nothing)
         if (ec_datagram_lrd(datagram, logical_offset, data_size, data)) {
             kfree(datagram);
             return -1;
         }
-        domain->expected_working_counter = used[EC_DIR_INPUT];
+        domain->expected_working_counter += used[EC_DIR_INPUT];
     }
 
     list_add_tail(&datagram->list, &domain->datagrams);


More information about the Etherlab-users mailing list