Hi Etherlab-dev.

During development and testing of the Etherlab EtherCAT C master I found a 
minor bug which has been fixed in our version.
I tested with version 1.5-pre and the new 1.5.2.

Bug description :
When the C master adds slaves to a domain there is a problem with LRD/LWR/LRW 
assignment if the last slave alone expands to a new EtherCAT telegram because 
the first one is full.

Example:
We have a slave that has 284 bytes inputs and 264 bytes output

BAD SETUP: (6 slaves, 284 byte WRITE, 264 READ)

SLAVE READ DOMAIN
Feb 27 09:37:06 kernel: [ 2560.537230] EtherCAT 0: Domain1: Logical address 
0x00000006, 1704 byte, expected working counter 6.
Feb 27 09:37:06 kernel: [ 2560.537256] EtherCAT 0: Datagram domain1-6: Logical 
offset 0x00000006, 1420 byte, type LRD. <-- (first 5 slaves 284*5 = 1420, READ)
Feb 27 09:37:06 kernel: [ 2560.537280] EtherCAT 0: Datagram domain1-1426: 
Logical offset 0x00000592, 284 byte, type LRD. <-- (last slave, READ)

SLAVE WRITE DOMAIN
Feb 27 09:37:06 kernel: [ 2560.537325] EtherCAT 0: Domain2: Logical address 
0x000006ae, 1584 byte, expected working counter 6.
Feb 27 09:37:06 kernel: [ 2560.537351] EtherCAT 0: Datagram domain2-1710: 
Logical offset 0x000006ae, 1320 byte, type LWR. <-- (first 5 slaves 264*5 = 
1320, WRITE)
Feb 27 09:37:06 kernel: [ 2560.537375] EtherCAT 0: Datagram domain2-3030: 
Logical offset 0x00000bd6, 264 byte, type LRD. <-- (last slave, WRITE became 
READ which is a error)

OK SETUP: (7 slaves, 284byte WRITE, 264 READ)

SLAVE READ DOMAIN
Feb 27 09:55:40 kernel: [ 3674.831832] EtherCAT 0: Domain1: Logical address 
0x00000006, 1988 byte, expected working counter 7.
Feb 27 09:55:40 kernel: [ 3674.831858] EtherCAT 0: Datagram domain1-6: Logical 
offset 0x00000006, 1420 byte, type LRD. <-- (first 5 slaves 284*5 = 1420, READ)
Feb 27 09:55:40 kernel: [ 3674.831882] EtherCAT 0: Datagram domain1-1426: 
Logical offset 0x00000592, 568 byte, type LRD. <-- (last 2 slaves 284*2=568, 
READ)

SLAVE WRITE DOMAIN
Feb 27 09:55:40 kernel: [ 3674.831930] EtherCAT 0: Domain2: Logical address 
0x000007ca, 1848 byte, expected working counter 7.
Feb 27 09:55:40 kernel: [ 3674.831955] EtherCAT 0: Datagram domain2-1994: 
Logical offset 0x000007ca, 1320 byte, type LWR. <-- (first 5 slaves 264*5 = 
1320, WRITE)
Feb 27 09:55:40 kernel: [ 3674.831980] EtherCAT 0: Datagram domain2-3314: 
Logical offset 0x00000cf2, 528 byte, type LWR. <-- (last 2 slaves, 264*2=528, 
READ error was corrected to correct WRITE again when we added a extra slave)
I found the problem in master/domain.c and fixed it and have included a git 
patch that you can evaluate.

Best regards,
Johnny Rasmussen
DEIF Wind Power Technology
Software Developer

Attachment: multiple_domains.patch
Description: multiple_domains.patch

_______________________________________________
etherlab-dev mailing list
etherlab-dev@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev

Reply via email to