[etherlab-users] CX CPU as Master Linux Slave

Graeme Foot Graeme.Foot at touchcut.com
Thu May 19 00:56:31 CEST 2016


If the cstruct info below looks like what you expect then it is possibly a problem with the setup (ie the calls to ecrt_master_slave_config(), ecrt_slave_config_pdos() etc aren’t matching correctly).  It might also be that it requires some extra sdo settings on top of the standard ones.

When the ERROR state is set it should also set the reason in the Alarm Status Code register (register 0x134).  use the command:
ethercat reg_read -p0 -tuint16 0x134

Then refer to the following page to figure out what the code means:
http://infosys.beckhoff.com/english.php?content=../content/1033/em37xx/1037010571.html&id=10272
or http://infosys.beckhoff.com/english.php?content=../content/1033/el6201/html/bt_ec_ethercat_al_statuscodes.htm&id



If you have another computer with windows you could install TwinCAT on it and see what TwinCAT’s configuration is to connect to it.


Regards,
Graeme.


From: David Jiménez Mejías [mailto:david.jimenez at gtc.iac.es]
Sent: Thursday, 19 May 2016 1:20 a.m.
To: Graeme Foot; etherlab-users at etherlab.org
Subject: RE: [etherlab-users] CX CPU as Master Linux Slave

Hi,

I'm not using a CXxxxx PC as Master, it is a x64 Real Time PC with Priest Distro. It has a ESD NEt-Card compatible with EtherCAT.

I just configured the data PDOs that I would like to expose vía the EtherCAT Slave port of the CX8010.

The cstruct works ok its reply is:

/* Master 0, Slave 0, "CX8010 EtherCAT slave"
 * Vendor ID:       0x00000002
 * Product code:    0x1f4a6032
 * Revision number: 0x00110000
 */
ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x7000, 0x01, 1}, /* Relay 1 signal*/
    {0x0000, 0x00, 7}, /* Gap */
    {0x7000, 0x02, 1}, /* Relay 2 Signal*/
    {0x0000, 0x00, 7}, /* Gap */
    {0x6000, 0x01, 16},/*Temp1*/
    {0x6000, 0x02, 16}, /*Temp2*/
};
ec_pdo_info_t slave_0_pdos[] = {
    {0x1600, 4, slave_0_pdo_entries + 0}, /* Output Mapping */
    {0x1a00, 2, slave_0_pdo_entries + 4}, /* Input Mapping */
};
ec_sync_info_t slave_0_syncs[] = {
    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
    {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
    {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
    {0xff}
};

and the slave reply:

0  0:0  PREOP  E  CX8010 EtherCAT slave

I don`t know if this show you something more ....

Thank you very much

Best regards

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Jiménez Mejías




-----Original Message-----
From: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>
To: David Jiménez Mejías <david.jimenez at gtc.iac.es<mailto:david.jimenez at gtc.iac.es>>, "etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>" <etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>>
Date: Sun, 15 May 2016 22:19:19 +0000
Subject: RE: [etherlab-users] CX CPU as Master Linux Slave

Hi,

What type of computer are you using as the Linux master?  If it is a Beckhoff CXxxxx computer via the EBus module it will need the CCAT (or similar) network card driver.  However, it sounds like your Linux master is not a CXxxxx computer and you already have the EtherCAT networking running.

I have not used the CX8010 so can’t offer too much advice but from what I understand it ring fences all of the IO on its EBus with its own logic to control it.  You then have to choose what IO (or interface) you want to expose via its slave interface that the Linux EtherCAT master will access.

What does the ethercat cstruct command return?


Regards,
Graeme.

From: David Jiménez Mejías [mailto:david.jimenez at gtc.iac.es]
Sent: Friday, 13 May 2016 11:12 p.m.
To: Graeme Foot; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: RE: [etherlab-users] CX CPU as Master Linux Slave

Hi Graeme,

thanks for your answer.
I'm trying to use a CX8010 as TwinCAT Master of its own net. Over it is a Linux PC running the Master Linux 1.5.2. We would like to have the CX8010 as slave from the Master Linux sharing In/Outs PDOs.

By the moment I keep running the CX8010 as normal, with the slave pdo configuration just done.

From the Master Linux I see the slave at PREOP (with Error), with this dmesg outputs:

[2061710.482018] EtherCAT 0: 0 slave(s) responding on main device.
[2061710.482020] EtherCAT 0: Stopping EoE thread.
[2061710.482038] EtherCAT 0: EoE thread exited.
[2061710.499211] EtherCAT 0: 1 slave(s) responding on main device.
[2061710.499214] EtherCAT 0: Slave states on main device: PREOP.
[2061710.499718] EtherCAT 0: Scanning bus.
[2061710.640237] EtherCAT 0: Bus scanning completed in 141 ms.
[2061710.640240] EtherCAT 0: Using slave 0 as DC reference clock.
[2061710.640242] EtherCAT 0: Starting EoE thread.
[2061710.655820] IPv6: ADDRCONF(NETDEV_UP): eoe0s0: link is not ready
[2061710.666862] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[2061710.667536] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[2061710.670956] EtherCAT 0-0: Acknowledged state PREOP.
[2061713.541497] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[2061713.664881] EtherCAT WARNING 0-0: CoE Emergency Request received:
Error code 0xA000, Error register 0x02, data:
[2061713.664885] EtherCAT DEBUG: 0E 04 00 04 00
[2061713.848637] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:01!
[2061713.848641] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.852689] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:02!
[2061713.852693] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.856649] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:03!
[2061713.856653] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.860720] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:04!
[2061713.860724] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.864652] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:05!
[2061713.864655] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.868724] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:06!
[2061713.868728] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.872634] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:07!
[2061713.872645] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.876712] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:08!
[2061713.876716] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.880657] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:09!
[2061713.880660] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.884698] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:0A!
[2061713.884701] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.888636] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:0B!
[2061713.888640] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.892574] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:0C!
[2061713.892577] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.896793] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:0D!
[2061713.896797] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061713.900671] EtherCAT WARNING 0-0: SDO information error response while fetching SDO entry 0xF100:0E!
[2061713.900674] EtherCAT ERROR 0-0: SDO abort message 0x06090011: "Subindex does not exist".
[2061716.623870] EtherCAT WARNING 0: 1 datagram TIMED OUT!


Some months a go I get to configure correctly typical cards with the EK1100 bus coupler. But the way to proceed looks diferent.

About the CCAT driver ... i just compile all without this enable, it isn't on the pdf manual. Then could be help us recompiling with that flag on?

Thank you very much

King regards

David Jiménez Mejías



-----Original Message-----
From: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>
To: David Jiménez Mejías <david.jimenez at gtc.iac.es<mailto:david.jimenez at gtc.iac.es>>, "etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>" <etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>>
Date: Tue, 10 May 2016 22:28:49 +0000
Subject: RE: [etherlab-users] CX CPU as Master Linux Slave

Hi,

We use a Beckhoff CX2020 with a CX2100-0004 power module with EBus.  What do you mean by slave CPU?  Are you referring to the CX2100 module?

What version of the master are you using?  There is a CCAT driver written by Patrick Bruenn in the “stable-1.5” branch, but it is not in the “default” branch.  Are you using this?  If not, to use it you will need to build it with the master with the ENABLE_CCAT config flag (I think).

I don’t use this driver as I wrote my own before it was available but I assume you use it in the same fashion as any of the other network card drivers, where you load the network driver modules you want to load (eg with modprobe).  If you load the CCAT module first then the master should use it by preference (when you use the generic MAC address of FF:FF:FF:FF:FF:FF) rather than needing to specify a fixed MAC address.


If you are not using the CCAT driver above, are you writing your own?


I have attached a patch for the driver I use.  It is written for EtherCat master revision 2526 (stable-1.5) and Linux Kernel 2.6.32.  It may be useful as a reference.

Regards,
Graeme.



From: etherlab-users [mailto:etherlab-users-bounces at etherlab.org] On Behalf Of David Jiménez Mejías
Sent: Wednesday, 11 May 2016 1:24 a.m.
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] CX CPU as Master Linux Slave

Hi everyone!

I would like to share some data from a Beckhoff CPU, CX line, by the slave EtherCAT Port. Using a EtherLab Master Linux.
Is there someone with some experience on that issue?

I configure the TxPDO and RxPDO in the Slave CPU, and the only way that I get the Linux Master reads its PDOs is with the slave CPU on config mode. I'm studing this procedure from zero, then, if there is someone with some informatuion about it I will so grateful.

Thanks in advance


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

David Jiménez Mejías






----------
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Protección de Datos, acceda a http://www.gtc.iac.es/gtc/legal_es.php
WARNING: For more information on privacy and fulfilment of the Law concerning the Protection of Data, consult http://www.gtc.iac.es/gtc/legal_es.php

----------
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Protección de Datos, acceda a http://www.gtc.iac.es/gtc/legal_es.php
WARNING: For more information on privacy and fulfilment of the Law concerning the Protection of Data, consult http://www.gtc.iac.es/gtc/legal_es.php

----------
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Protección de Datos, acceda a http://www.gtc.iac.es/gtc/legal_es.php
WARNING: For more information on privacy and fulfilment of the Law concerning the Protection of Data, consult http://www.gtc.iac.es/gtc/legal_es.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20160518/f3aa653f/attachment-0004.htm>


More information about the Etherlab-users mailing list