[etherlab-users] Beckhoff EL2809 (16 digital outputs) initialization issue

BUSSIERES Vincent vincent.bussieres at hemeria-group.com
Thu Apr 23 12:43:24 CEST 2020


Hello everybody,

You can find syslog output below.
As you can see, everything seems to be correct until « ecrt_domain_reg_pdo_entry_list » function call (5 last lines of syslog output).

[  462.210073] EtherCAT DEBUG 0 0:3: ecrt_slave_config_reg_pdo_entry(sc = 0xffff8ca7d60ce000, index = 0x7000, subindex = 0x01, domain = 0xffff8ca7d895a840, bit_position = 0xffffb9f703843d64)
[  462.210075] EtherCAT DEBUG 0: Domain 0: Added 1 bytes at 0.
[  462.210076] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xffff8ca7d58d0000, alias = 0, position = 3, vendor_id = 0x00000002, product_code = 0x0af93052)
[  462.210077] EtherCAT DEBUG 0 0:3: ecrt_slave_config_reg_pdo_entry(sc = 0xffff8ca7d60ce000, index = 0x7010, subindex = 0x01, domain = 0xffff8ca7d895a840, bit_position = 0xffffb9f703843d64)

The first entry seems to be register correctly, but function « ecrt_domain_reg_pdo_entry_list » exit with -14 error code for the second entry.

I think PDOs for EL2809 module are already configured, I don't know if I need to call « ecrt_master_slave_config » and « ecrt_slave_config_pdos » functions.
In mini.c example, when the  #define CONFIGURE_PDOS is comment these functions are not called. I tried to comment them but it didn't work too.

Regard

[  406.335563] EtherCAT 0: Master debug level set to 1.
[  424.104061] EtherCAT: Requesting master 0...
[  424.104062] EtherCAT DEBUG 0: IDLE -> OPERATION.
[  424.104063] EtherCAT: Successfully requested master 0.
[  425.296046] EtherCAT DEBUG 0: ecrt_master_create_domain(master = 0xffff8ca7d58d0000)
[  425.296047] EtherCAT DEBUG 0: Created domain 0.
[  426.496343] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xffff8ca7d58d0000, alias = 0, position = 3, vendor_id = 0x00000002, product_code = 0x0af93052)
[  426.496344] EtherCAT DEBUG 0: Creating slave configuration for 0:3, 0x00000002/0x0AF93052.
[  426.496346] EtherCAT DEBUG 0 0:3: Attached slave main-3.
[  445.305381] EtherCAT DEBUG 0 0:3: ecrt_slave_config_sync_manager(sc = 0xffff8ca7d60ce000, sync_index = 0, dir = 1, watchdog_mode = 1)
[  445.305384] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_clear(sc = 0xffff8ca7d60ce000, sync_index = 0)
[  445.305388] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1600)
[  445.305389] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1600.
[  445.305390] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 1".
[  445.305391] EtherCAT DEBUG 0 0:3: Entry 0x7000:01.
[  445.305392] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1600)
[  445.305394] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1600, entry_index = 0x7000, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305395] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1601)
[  445.305396] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1601.
[  445.305396] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 2".
[  445.305397] EtherCAT DEBUG 0 0:3: Entry 0x7010:01.
[  445.305398] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1601)
[  445.305400] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1601, entry_index = 0x7010, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305401] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1602)
[  445.305401] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1602.
[  445.305402] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 3".
[  445.305403] EtherCAT DEBUG 0 0:3: Entry 0x7020:01.
[  445.305404] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1602)
[  445.305405] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1602, entry_index = 0x7020, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305406] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1603)
[  445.305407] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1603.
[  445.305407] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 4".
[  445.305410] EtherCAT DEBUG 0 0:3: Entry 0x7030:01.
[  445.305411] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1603)
[  445.305412] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1603, entry_index = 0x7030, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305413] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1604)
[  445.305413] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1604.
[  445.305414] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 5".
[  445.305415] EtherCAT DEBUG 0 0:3: Entry 0x7040:01.
[  445.305416] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1604)
[  445.305417] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1604, entry_index = 0x7040, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305418] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1605)
[  445.305419] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1605.
[  445.305419] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 6".
[  445.305420] EtherCAT DEBUG 0 0:3: Entry 0x7050:01.
[  445.305421] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1605)
[  445.305422] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1605, entry_index = 0x7050, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305423] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1606)
[  445.305424] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1606.
[  445.305424] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 7".
[  445.305425] EtherCAT DEBUG 0 0:3: Entry 0x7060:01.
[  445.305426] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1606)
[  445.305427] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1606, entry_index = 0x7060, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305429] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 0, pdo_index = 0x1607)
[  445.305429] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1607.
[  445.305430] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 8".
[  445.305430] EtherCAT DEBUG 0 0:3: Entry 0x7070:01.
[  445.305431] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1607)
[  445.305433] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1607, entry_index = 0x7070, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305434] EtherCAT DEBUG 0 0:3: ecrt_slave_config_sync_manager(sc = 0xffff8ca7d60ce000, sync_index = 1, dir = 1, watchdog_mode = 1)
[  445.305435] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_clear(sc = 0xffff8ca7d60ce000, sync_index = 1)
[  445.305438] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x1608)
[  445.305438] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1608.
[  445.305439] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 9".
[  445.305440] EtherCAT DEBUG 0 0:3: Entry 0x7080:01.
[  445.305441] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1608)
[  445.305442] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1608, entry_index = 0x7080, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305443] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x1609)
[  445.305443] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x1609.
[  445.305444] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 10".
[  445.305445] EtherCAT DEBUG 0 0:3: Entry 0x7090:01.
[  445.305446] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x1609)
[  445.305447] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x1609, entry_index = 0x7090, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305448] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x160A)
[  445.305449] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x160A.
[  445.305449] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 11".
[  445.305450] EtherCAT DEBUG 0 0:3: Entry 0x70A0:01.
[  445.305451] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x160A)
[  445.305452] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x160A, entry_index = 0x70A0, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305453] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x160B)
[  445.305454] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x160B.
[  445.305454] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 12".
[  445.305455] EtherCAT DEBUG 0 0:3: Entry 0x70B0:01.
[  445.305456] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x160B)
[  445.305457] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x160B, entry_index = 0x70B0, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305458] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x160C)
[  445.305459] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x160C.
[  445.305459] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 13".
[  445.305460] EtherCAT DEBUG 0 0:3: Entry 0x70C0:01.
[  445.305461] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x160C)
[  445.305463] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x160C, entry_index = 0x70C0, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305464] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x160D)
[  445.305464] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x160D.
[  445.305465] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 14".
[  445.305466] EtherCAT DEBUG 0 0:3: Entry 0x70D0:01.
[  445.305467] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x160D)
[  445.305468] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x160D, entry_index = 0x70D0, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305469] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x160E)
[  445.305469] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x160E.
[  445.305470] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 15".
[  445.305471] EtherCAT DEBUG 0 0:3: Entry 0x70E0:01.
[  445.305472] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x160E)
[  445.305473] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x160E, entry_index = 0x70E0, entry_subindex = 0x01, entry_bit_length = 1)
[  445.305474] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_assign_add(sc = 0xffff8ca7d60ce000, sync_index = 1, pdo_index = 0x160F)
[  445.305475] EtherCAT DEBUG 0 0:3: Loading default mapping for PDO 0x160F.
[  445.305476] EtherCAT DEBUG 0 0:3: Found PDO name "Channel 16".
[  445.305476] EtherCAT DEBUG 0 0:3: Entry 0x70F0:01.
[  445.305477] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_clear(sc = 0xffff8ca7d60ce000, pdo_index = 0x160F)
[  445.305479] EtherCAT DEBUG 0 0:3: ecrt_slave_config_pdo_mapping_add(sc = 0xffff8ca7d60ce000, pdo_index = 0x160F, entry_index = 0x70F0, entry_subindex = 0x01, entry_bit_length = 1)
[  462.210065] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xffff8ca7d58d0000, alias = 0, position = 3, vendor_id = 0x00000002, product_code = 0x0af93052)
[  462.210073] EtherCAT DEBUG 0 0:3: ecrt_slave_config_reg_pdo_entry(sc = 0xffff8ca7d60ce000, index = 0x7000, subindex = 0x01, domain = 0xffff8ca7d895a840, bit_position = 0xffffb9f703843d64)
[  462.210075] EtherCAT DEBUG 0: Domain 0: Added 1 bytes at 0.
[  462.210076] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xffff8ca7d58d0000, alias = 0, position = 3, vendor_id = 0x00000002, product_code = 0x0af93052)
[  462.210077] EtherCAT DEBUG 0 0:3: ecrt_slave_config_reg_pdo_entry(sc = 0xffff8ca7d60ce000, index = 0x7010, subindex = 0x01, domain = 0xffff8ca7d895a840, bit_position = 0xffffb9f703843d64)


Vincent BUSSIERES
Responsable Technique Logiciel

[1572337113342]
ZE Ma Campagne
36, Impasse Félix Nadar
16000 ANGOULEME
Tel: 33 (0)9.72.40.35.08
www.hemeria-group.com<https://webmail.nexeya.fr/owa/redir.aspx?C=GK_BqKCZef7LtPZnqnd_LGYr1NG9sz4Smy3iKIwO-pXqtJC7VgzXCA..&URL=http%3a%2f%2fwww.hemeria-group.com%2f>
P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel qu'en cas de nécessité.
Ce message et les fichiers pouvant être attachés sont confidentiels, réservés à l'usage unique des destinataires et n'engagent HEMERIA sous aucune forme que ce soit.
This email and any files transmitted with it are confidential, intented solely for the unique use of the recipients and don't commit HEMERIA.



De : Gavin Lambert <gavin.lambert at tomra.com>
Envoyé : jeudi 23 avril 2020 01:17
À : BUSSIERES Vincent <vincent.bussieres at hemeria-group.com>; etherlab-users at etherlab.org
Objet : RE: [etherlab-users] Beckhoff EL2809 (16 digital outputs) initialization issue

If ecrt_domain_reg_pdo_entry_list returns an error, it has nothing to do with the slave itself, it means you're passing inconsistent data.

Having said that, at a glance I don't see any obvious issues with the code you've posted (except that you probably should have the watchdog enabled, but that's an unrelated issue).  When the error occurs, have a look at the syslog output; it should tell you more.  If that's not enlightening enough, then set "ethercat debug 1" before running your code and check the syslog again.

There is an EC_WRITE_BIT as well.  In addition to the byte offset (which is stored in &offOutput[x] in your example), you need to pass a second pointer in ec_pdo_entry_reg_t to capture the bit offset, when using data smaller than 1 byte.

(Alternatively, while this is technically not robust and may potentially break due to other network layout, given the total size of the SMs it's reasonably safe to assume that the 16 outputs will be mapped to two physical bytes, so you can just use EC_WRITE_U8 at the byte address of outputs 1 and 9, respectively.  Or even EC_WRITE_U16 just to the address of output 1.  You will have to be careful about potential bit ordering differences between your master and slave, however.)


Gavin Lambert
Senior Software Developer


[cid:image002.png at 01D6196A.29CD0C60]
[TOMRA]<http://www.compacsort.com>[Facebook]<https://www.facebook.com/Compacsort>[Linkedin]<https://www.linkedin.com/company/compac-sorting-equipment/>[Youtube]<https://vimeo.com/compacsort>[twitter]<https://twitter.com/compacsort>[instagram]<https://www.instagram.com/compacsort/>

COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand
Switchboard: +64 96 34 00 88 | tomra.com<http://www.tomra.com>

The information contained in this communication and any attachment is confidential and may be legally privileged. It should only be read by the person(s) to whom it is addressed. If you have received this communication in error, please notify the sender and delete the communication.

From: BUSSIERES Vincent
Sent: Thursday, 23 April 2020 08:50
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] Beckhoff EL2809 (16 digital outputs) initialization issue

Dear Etherlab users,

I am working with a Beckhoff EL2809 module (16 digital outputs module) and I have some difficulties to register pdo entries.
I think that for this module pdo are not assignable.

You can find some informations about this product below :

=== Master 0, Slave 3 ===
Device: Main
State: PREOP
Flag: +
Identity:
  Vendor Id:       0x00000002
  Product code:    0x0af93052
  Revision number: 0x00120000
  Serial number:   0x00000000
DL information:
  FMMU bit operation: no
  Distributed clocks: yes, delay measurement only
  DC system time transmission delay: 885 ns
Port  Type  Link  Loop    Signal  NextSlave  RxTime [ns]  Diff [ns]   NextDc [ns]
   0* EBUS  up    open    yes             2   2053620480           0         145
   1  EBUS  up    open    yes             4   2053621070         590         140
   2  N/A   down  closed  no              -            -           -           -
   3  N/C   down  closed  no              -            -           -           -
General:
  Group: DigOut
  Image name:
  Order number: EL2809
  Device name: EL2809 16K. Dig. Ausgang 24V, 0.5A
  Flags:
    Enable SafeOp: no
    Enable notLRW: no
  Current consumption: 140 mA

SM0: PhysAddr 0x0f00, DefaultSize    1, ControlRegister 0x44, Enable 9
  RxPDO 0x1600 "Channel 1"
    PDO entry 0x7000:01,  1 bit, "Output"
  RxPDO 0x1601 "Channel 2"
    PDO entry 0x7010:01,  1 bit, "Output"
  RxPDO 0x1602 "Channel 3"
    PDO entry 0x7020:01,  1 bit, "Output"
  RxPDO 0x1603 "Channel 4"
    PDO entry 0x7030:01,  1 bit, "Output"
  RxPDO 0x1604 "Channel 5"
    PDO entry 0x7040:01,  1 bit, "Output"
  RxPDO 0x1605 "Channel 6"
    PDO entry 0x7050:01,  1 bit, "Output"
  RxPDO 0x1606 "Channel 7"
    PDO entry 0x7060:01,  1 bit, "Output"
  RxPDO 0x1607 "Channel 8"
    PDO entry 0x7070:01,  1 bit, "Output"
SM1: PhysAddr 0x0f01, DefaultSize    1, ControlRegister 0x44, Enable 9
  RxPDO 0x1608 "Channel 9"
    PDO entry 0x7080:01,  1 bit, "Output"
  RxPDO 0x1609 "Channel 10"
    PDO entry 0x7090:01,  1 bit, "Output"
  RxPDO 0x160a "Channel 11"
    PDO entry 0x70a0:01,  1 bit, "Output"
  RxPDO 0x160b "Channel 12"
    PDO entry 0x70b0:01,  1 bit, "Output"
  RxPDO 0x160c "Channel 13"
    PDO entry 0x70c0:01,  1 bit, "Output"
  RxPDO 0x160d "Channel 14"
    PDO entry 0x70d0:01,  1 bit, "Output"
  RxPDO 0x160e "Channel 15"
    PDO entry 0x70e0:01,  1 bit, "Output"
  RxPDO 0x160f "Channel 16"
    PDO entry 0x70f0:01,  1 bit, "Output"

I don't know if I need to map PDOs because they are already mapped.
At the initialization, « ecrt_domain_reg_pdo_entry_list » return error -14. You can find below a part of my code for the initialization.
Moreover, each output is written on 1 bit, we can only write PDO with macro EC_WRITE_U8, how can I do to drive only one output ?

static unsigned int offOutput[16];
static ec_domain_state_t domain1_state = {};
static ec_master_state_t master_state = {};

const static ec_pdo_entry_reg_t domain1_regs[] = {
    {0, 3, 0x00000002, 0x0af93052, 0x7000, 1, &offOutput[0]},
    {0, 3, 0x00000002, 0x0af93052, 0x7010, 1, &offOutput[1]},
    {0, 3, 0x00000002, 0x0af93052, 0x7020, 1, &offOutput[2]},
    {0, 3, 0x00000002, 0x0af93052, 0x7030, 1, &offOutput[3]},
    {0, 3, 0x00000002, 0x0af93052, 0x7040, 1, &offOutput[4]},
    {0, 3, 0x00000002, 0x0af93052, 0x7050, 1, &offOutput[5]},
    {0, 3, 0x00000002, 0x0af93052, 0x7060, 1, &offOutput[6]},
    {0, 3, 0x00000002, 0x0af93052, 0x7070, 1, &offOutput[7]},
    {0, 3, 0x00000002, 0x0af93052, 0x7080, 1, &offOutput[8]},
    {0, 3, 0x00000002, 0x0af93052, 0x7090, 1, &offOutput[9]},
    {0, 3, 0x00000002, 0x0af93052, 0x70a0, 1, &offOutput[10]},
    {0, 3, 0x00000002, 0x0af93052, 0x70b0, 1, &offOutput[11]},
    {0, 3, 0x00000002, 0x0af93052, 0x70c0, 1, &offOutput[12]},
    {0, 3, 0x00000002, 0x0af93052, 0x70d0, 1, &offOutput[13]},
    {0, 3, 0x00000002, 0x0af93052, 0x70e0, 1, &offOutput[14]},
    {0, 3, 0x00000002, 0x0af93052, 0x70f0, 1, &offOutput[15]},
    {}
};

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x7000, 0x01, 1},
    {0x7010, 0x01, 1},
    {0x7020, 0x01, 1},
    {0x7030, 0x01, 1},
    {0x7040, 0x01, 1},
    {0x7050, 0x01, 1},
    {0x7060, 0x01, 1},
    {0x7070, 0x01, 1},

    {0x7080, 0x01, 1},
    {0x7090, 0x01, 1},
    {0x70a0, 0x01, 1},
    {0x70b0, 0x01, 1},
    {0x70c0, 0x01, 1},
    {0x70d0, 0x01, 1},
    {0x70e0, 0x01, 1},
    {0x70f0, 0x01, 1},
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 1, &slave_0_pdo_entries[0]},
    {0x1601, 1, &slave_0_pdo_entries[1]},
    {0x1602, 1, &slave_0_pdo_entries[2]},
    {0x1603, 1, &slave_0_pdo_entries[3]},
    {0x1604, 1, &slave_0_pdo_entries[4]},
    {0x1605, 1, &slave_0_pdo_entries[5]},
    {0x1606, 1, &slave_0_pdo_entries[6]},
    {0x1607, 1, &slave_0_pdo_entries[7]},
    {0x1608, 1, &slave_0_pdo_entries[8]},
    {0x1609, 1, &slave_0_pdo_entries[9]},
    {0x160a, 1, &slave_0_pdo_entries[10]},
    {0x160b, 1, &slave_0_pdo_entries[11]},
    {0x160c, 1, &slave_0_pdo_entries[12]},
    {0x160d, 1, &slave_0_pdo_entries[13]},
    {0x160e, 1, &slave_0_pdo_entries[14]},
    {0x160f, 1, &slave_0_pdo_entries[15]},
};

ec_sync_info_t slave_0_syncs[] = {
    {0, EC_DIR_OUTPUT, 8, slave_0_pdos + 0, EC_WD_DISABLE},
    {1, EC_DIR_OUTPUT, 8, slave_0_pdos + 8, EC_WD_DISABLE},
    {0xff}
};


static ec_master_t *master = nullptr;
static ec_domain_t *domain1 = nullptr;
static uint8_t *domain1_pd = nullptr;
static ec_slave_config_t *sc_el2809 = nullptr;
static ec_slave_config_state_t sc_el2809_state = {};
static ec_slave_info_t slaveInfo;


bool Worker::init()
{
    master = ecrt_request_master(0);
    if ( !master )
        return false;
    domain1 = ecrt_master_create_domain(master);
    if ( !domain1 )
        return false;
    if ( !(sc_el2809 = ecrt_master_slave_config(master, 0, 3, 0x00000002, 0x0af93052)) )
    {
        fprintf(stderr, "Failed to get slave configuration for AKD.\n");
        return false;
    }
    if (ecrt_slave_config_pdos(sc_el2809, EC_END, slave_0_syncs))
        return false;
    //----------- return -14 ?
    if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs))
        return false;
    //-----------------------
    if ( ecrt_master_activate( master ) )
        return false;
    if (!(domain1_pd = ecrt_domain_data(domain1)))
        return false;

    return true;
}

dmesg doesn't seem report any errors.

Best regards

Vincent BUSSIERES
Responsable Technique Logiciel

[1572337113342]
ZE Ma Campagne
36, Impasse Félix Nadar
16000 ANGOULEME
Tel: 33 (0)9.72.40.35.08
www.hemeria-group.com<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebmail.nexeya.fr%2Fowa%2Fredir.aspx%3FC%3DGK_BqKCZef7LtPZnqnd_LGYr1NG9sz4Smy3iKIwO-pXqtJC7VgzXCA..%26URL%3Dhttp%253a%252f%252fwww.hemeria-group.com%252f&data=02%7C01%7Cgavin.lambert%40tomra.com%7Cf091907ede00490bbc1008d7e6febd35%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637231854094445603&sdata=xvkywGyCJdixGyXCXpkIDXCsnTJxOsVY9eZnaRuH3SU%3D&reserved=0>
P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel qu'en cas de nécessité.
Ce message et les fichiers pouvant être attachés sont confidentiels, réservés à l'usage unique des destinataires et n'engagent HEMERIA sous aucune forme que ce soit.
This email and any files transmitted with it are confidential, intented solely for the unique use of the recipients and don't commit HEMERIA.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5034 bytes
Desc: image001.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0032.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 11438 bytes
Desc: image002.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0033.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1629 bytes
Desc: image003.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0034.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1750 bytes
Desc: image004.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0035.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1855 bytes
Desc: image005.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0036.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 1970 bytes
Desc: image006.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0037.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 20278 bytes
Desc: image007.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0038.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 1506 bytes
Desc: image008.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200423/fa60e6b2/attachment-0039.png>


More information about the Etherlab-users mailing list