[etherlab-users] reg_read ==> Failed to read register

Joachim Sällvin joachim.sallvin at corpowerocean.com
Thu Apr 16 11:08:47 CEST 2020


Thank you, clearly I have misunderstood this.

ethercat -p1 upload -t uint32  0x6004 0x00 answers with

0x00000000 0 (encoder position value) which is not what I expect. It all works fine with TwinCAT and I get resonable values.

When I run my application I can not  make any of my slaves go into OP state and I can not read the process data. This works fine with TwinCAT.

Any suggestions where to start debugging this?

When I run my application:

$ ethercat slaves
0  701:0  PREOP        +  EP3174-0002 4K. Ana. Eingang +/-10V, 0-10V, 0/4-20mA konfigurie
1  601:0  PREOP+ERROR  E  LeineAndLinde Encoder

My dmesg printout (debug level 1 rather long I'm afraid):

[160715.196194] EtherCAT 0: 1 slave(s) responding on main device.
[160715.230681] EtherCAT 0: Scanning bus.
[160731.152010] EtherCAT 0: Bus scanning completed in 15952 ms.
[160731.152013] EtherCAT 0: Using slave main-0 as DC reference clock.
[160731.172030] EtherCAT WARNING 0: No app_time received up to now, abort DC time offset calculation.
[160756.175539] e1000e: enp11s0 NIC Link is Down
[160756.180245] EtherCAT 0: Link state of ecm0 changed to DOWN.
[160756.191321] EtherCAT WARNING 0: 2 datagrams TIMED OUT!
[160756.191333] EtherCAT ERROR 0-main-0: Failed to receive AL state datagram: Datagram error.
[160756.207260] EtherCAT 0: 0 slave(s) responding on main device.
[160758.383706] EtherCAT 0: Releasing master...
[160758.383740] EtherCAT 0: Master thread exited.
[160758.383748] EtherCAT 0: Starting EtherCAT-IDLE thread.
[160758.383788] EtherCAT 0: Released.
[160758.415495] EtherCAT WARNING: Datagram ffff8da6d7024340 (master-fsm) was SKIPPED 1 time.
[160778.270034] EtherCAT 0: Master thread exited.
[160778.270049] EtherCAT 0: Releasing main device 2C:94:64:00:26:63.
[160778.317206] ec_generic: Unloading.
[160778.340876] EtherCAT: Master module cleaned up.
[160815.777706] EtherCAT: Master driver 1.5.2 35e7f0841303
[160815.777955] EtherCAT: 1 master waiting for devices.
[160815.786627] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 35e7f0841303
[160815.786651] EtherCAT: Accepting 2C:94:64:00:26:63 as main device for master 0.
[160815.786661] ec_generic: Binding socket to interface 6 (enp11s0).
[160815.799994] EtherCAT 0: Starting EtherCAT-IDLE thread.
[160823.431705] EtherCAT 0: Master thread exited.
[160823.431709] EtherCAT 0: Releasing main device 2C:94:64:00:26:63.
[160823.464663] ec_generic: Unloading.
[160823.488998] EtherCAT: Master module cleaned up.
[160858.720503] e1000e: enp11s0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
[160858.720634] e1000e 0000:0b:00.0 enp11s0: 10/100 speed: disabling TSO
[160859.579559] e1000e: enp11s0 NIC Link is Down
[160861.261205] e1000e: enp11s0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
[160861.261336] e1000e 0000:0b:00.0 enp11s0: 10/100 speed: disabling TSO
[160872.605681] EtherCAT: Master driver 1.5.2 35e7f0841303
[160872.605933] EtherCAT: 1 master waiting for devices.
[160872.613974] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 35e7f0841303
[160872.613996] EtherCAT: Accepting 2C:94:64:00:26:63 as main device for master 0.
[160872.614002] ec_generic: Binding socket to interface 6 (enp11s0).
[160872.644426] EtherCAT 0: Starting EtherCAT-IDLE thread.
[160872.644577] EtherCAT 0: Link state of ecm0 changed to UP.
[160872.652413] EtherCAT 0: 1 slave(s) responding on main device.
[160872.652420] EtherCAT 0: Slave states on main device: PREOP.
[160872.653254] EtherCAT 0: Scanning bus.
[160873.054044] EtherCAT 0: Bus scanning completed in 400 ms.
[160873.054046] EtherCAT 0: Using slave main-0 as DC reference clock.
[160873.092391] EtherCAT 0: Slave states on main device: INIT.
[160873.140447] EtherCAT 0: Slave states on main device: PREOP.
[160945.654077] EtherCAT 0: 3 slave(s) responding on main device.
[160945.655528] EtherCAT 0: Scanning bus.
[160947.943148] EtherCAT 0: Bus scanning completed in 2288 ms.
[160947.943150] EtherCAT 0: Using slave main-0 as DC reference clock.
[160947.982211] EtherCAT 0: Slave states on main device: INIT, PREOP.
[160948.014240] EtherCAT 0: Slave states on main device: INIT.
[160948.046242] EtherCAT 0: Slave states on main device: PREOP.
[160984.085059] EtherCAT 0: 2 slave(s) responding on main device.
[160984.086367] EtherCAT 0: Scanning bus.
[160984.487953] EtherCAT 0: Bus scanning completed in 400 ms.
[160984.487955] EtherCAT 0: Using slave main-0 as DC reference clock.
[160984.517021] EtherCAT 0: Slave states on main device: INIT, PREOP.
[160984.541063] EtherCAT 0: Slave states on main device: INIT.
[160984.565093] EtherCAT 0: Slave states on main device: INIT, PREOP.
[160984.589103] EtherCAT 0: Slave states on main device: PREOP.
[161157.597419] EtherCAT: Requesting master 0...
[161157.597424] EtherCAT: Successfully requested master 0.
[161157.597587] EtherCAT 0: Domain0: Logical address 0x00000000, 36 byte, expected working counter 2.
[161157.597589] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 36 byte, type LRD at ffff8da6f70ecc18.
[161157.597601] EtherCAT 0: Master thread exited.
[161157.597603] EtherCAT 0: Starting EtherCAT-OP thread.
[161157.802764] EtherCAT WARNING 0: No app_time received up to now, abort DC time offset calculation.
[161158.602536] EtherCAT 0: Slave states on main device: INIT, PREOP.
[161159.706658] EtherCAT 0: Slave states on main device: PREOP.
[161168.507348] EtherCAT ERROR 0-main-1: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[161168.707340] EtherCAT 0: Slave states on main device: PREOP + ERROR.
[161168.707362] EtherCAT ERROR 0-main-1: AL status message 0x0050: "EEPROM No Access".
[161169.107372] EtherCAT 0-main-1: Acknowledged state PREOP.
[161169.307400] EtherCAT 0: Slave states on main device: PREOP.

Regards,

Joachim


________________________________
Från: Gavin Lambert <gavin.lambert at tomra.com>
Skickat: den 15 april 2020 01:49
Till: Joachim Sällvin <joachim.sallvin at corpowerocean.com>; etherlab-users at etherlab.org <etherlab-users at etherlab.org>
Ämne: RE: reg_read ==> Failed to read register


Err, “upload”, I mean.  Uploading is reading from the device.  I always get those ones mixed up.



Gavin Lambert
Senior Software Developer

[cid:logo_compac_5dcf97ef-52f5-498c-8b9b-728410ddffaf.png]
[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: Gavin Lambert
Sent: Wednesday, 15 April 2020 10:19
To: Joachim Sällvin <joachim.sallvin at corpowerocean.com>; etherlab-users at etherlab.org
Subject: Re: [etherlab-users] reg_read ==> Failed to read register



Register 0x6004 doesn’t exist.  All registers have addresses < 0x1000.  Perhaps you meant to use “download” instead of “reg_read”?



Gavin Lambert
Senior Software Developer

[cid:image001.png at 01D6131B.D84518A0]
[TOMRA]<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.compacsort.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699680702&sdata=hP1tqYmJd1HpvkGbckxldzGUAWXuIecxUL9TzOHK8Po%3D&reserved=0>[Facebook]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FCompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699680702&sdata=plHesJhh12oiukMTw2DVbcPaZbKxMmUECQmJhMscYR4%3D&reserved=0>[Linkedin]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fcompac-sorting-equipment%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699690694&sdata=vMCuikpZenxP7idOFcwhqu%2FioAWTIV7r51%2B%2F27uWk3c%3D&reserved=0>[Youtube]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvimeo.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699690694&sdata=400fmao%2FjOiMbR9B18p8amPElwNTaOwE%2F3TykZoyBd4%3D&reserved=0>[twitter]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699690694&sdata=GLABUfRXWz1FJ2G9IeBqPUGwReI4EchE65itaEIwlBA%3D&reserved=0>[instagram]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Fcompacsort%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699700687&sdata=hVCwb6RKESpc9p4fJgR%2BKdHurbWDlQXDVSj5v0fRzko%3D&reserved=0>

COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand
Switchboard: +64 96 34 00 88 | tomra.com<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tomra.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C9323629b714e493269ec08d7e0c1e589%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637224995699700687&sdata=udYFWAMLuZKxo1uO0DwhFsDbqsfXiyECHmnX4o1s0Mc%3D&reserved=0>

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: Joachim Sällvin
Sent: Tuesday, 14 April 2020 21:55
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] reg_read ==> Failed to read register



Hi, what could cause this? What should I try to do next, ideas?



$ ethercat -p1 reg_read 0x6004 4

Failed to read register: Input/output error



dmesg

[417280.571018] Datagram received.
[417280.571024] EtherCAT ERROR 0-main-1: Register request failed (working counter is 0).



My application fails to exchange process data so I figured I'd try the command line tool. What could cause this kind of problem?



Some info about my system:



$ ethercat version

IgH EtherCAT master 1.5.2 35e7f0841303





$ ethercat slaves

0  701:0  PREOP  +  EP3174-0002 4K. Ana. Eingang +/-10V, 0-10V, 0/4-20mA konfigurie

1  601:0  PREOP  +  LeineAndLinde Encoder





$ ethercat -p1 cstruct

/* Master 0, Slave 1, "LeineAndLinde Encoder"

 * Vendor ID:       0x00000194

 * Product code:    0x00000600

 * Revision number: 0x00000001

 */



ec_pdo_entry_info_t slave_1_pdo_entries[] = {

    {0x6004, 0x00, 32},

    {0x1001, 0x00, 16},

    {0x6503, 0x00, 16},

    {0x6505, 0x00, 16},

    {0x2060, 0x00, 32},

    {0x6030, 0x00, 16},

    {0x6040, 0x00, 16},

    {0x2100, 0x00, 16},

};



ec_pdo_info_t slave_1_pdos[] = {

    {0x1a00, 8, slave_1_pdo_entries + 0}, /* Configurable TxPDO map with max 8 PDO */

};



ec_sync_info_t slave_1_syncs[] = {

    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},

    {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},

    {2, EC_DIR_OUTPUT, 0, NULL, EC_WD_ENABLE},

    {3, EC_DIR_INPUT, 1, slave_1_pdos + 0, EC_WD_DISABLE},

    {0xff}

};



 Thanks in advance,



Joachim Sällvin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 11438 bytes
Desc: image001.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0056.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1629 bytes
Desc: image002.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0057.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1750 bytes
Desc: image003.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0058.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1855 bytes
Desc: image004.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0059.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1970 bytes
Desc: image005.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0060.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 20278 bytes
Desc: image006.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0061.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1506 bytes
Desc: image007.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0062.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_compac_5dcf97ef-52f5-498c-8b9b-728410ddffaf.png
Type: image/png
Size: 11438 bytes
Desc: logo_compac_5dcf97ef-52f5-498c-8b9b-728410ddffaf.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0063.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compacicon_82e8a8c7-154a-4a32-9720-a5badb6258e0.png
Type: image/png
Size: 1629 bytes
Desc: compacicon_82e8a8c7-154a-4a32-9720-a5badb6258e0.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0064.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: facebook_fa85b924-53b9-45cc-8162-0564f64ec3a3.png
Type: image/png
Size: 1750 bytes
Desc: facebook_fa85b924-53b9-45cc-8162-0564f64ec3a3.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0065.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin_4ec016ad-84fa-443c-85a3-b9615a4ccef8.png
Type: image/png
Size: 1855 bytes
Desc: linkedin_4ec016ad-84fa-443c-85a3-b9615a4ccef8.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0066.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: youtube_32142163-fc27-4aed-b14d-e8a377f98a6d.png
Type: image/png
Size: 1970 bytes
Desc: youtube_32142163-fc27-4aed-b14d-e8a377f98a6d.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0067.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: twitter_d89338d8-98c8-4b65-9a9e-7b1333160b0d.png
Type: image/png
Size: 20278 bytes
Desc: twitter_d89338d8-98c8-4b65-9a9e-7b1333160b0d.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0068.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: insta2_1cd85de9-b3a2-4971-9904-52b2481a7c82.png
Type: image/png
Size: 1506 bytes
Desc: insta2_1cd85de9-b3a2-4971-9904-52b2481a7c82.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200416/ab9a2429/attachment-0069.png>


More information about the Etherlab-users mailing list