[etherlab-users] Question on use of EL3064 (Beckhoff ADC)

Graeme Foot Graeme.Foot at touchcut.com
Wed Jul 10 00:48:23 CEST 2019


Hi,

Please post questions to the etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org> forum.

For simple slaves:
1) plug the slave into the ethercat fieldbus
2) run the "ethercat cstruct" command, with the -p parameter for the new slave
3) copy and paste the pdo structures into your code.  (I rename mine with the slaves product code for better reuse.)
4) to use a configuration for a slave use the following functions:
                ecrt_master_slave_config()
     ecrt_slave_config_pdos()
5) to get pdo domain offsets for particular entries use the following function:
                ecrt_slave_config_reg_pdo_entry()
6) to configure slave settings use the following functions:
                ecrt_slave_config_sdo()
     ecrt_slave_config_sdo8()
     ecrt_slave_config_sdo16()
     ecrt_slave_config_sdo32()
7) if DC is supported use:
                ecrt_slave_config_dc()
                Note: you can find the assign active value from the slaves ESI xml file or documentation.

For slaves with multiple configuration options:
1) locate the matching module and revision Device entry
2) check for AlternativeSmMapping options
Option 1) if the default configuration is the one you want, follow the steps above
Option 2) continue with the steps below
3) check the RxPdo / TxPdo options that match the Sm Mapping that you want to use
4) build your own cstruct's based on items 2 & 3
                (this can be hard)
5) follow steps 4-7 from the simple slave

For slaves that allow custom pdo configurations:
1) get the default cstruct and if it doesn't have what you want modify it with parameters that are allowed to be PDO items until it is
                (you need to do a lot of reading of the slave documentation)
2) follow steps 4-7 from the simple slave


As for the EL3064, it is a slave that supports multiple configuration options.  I wanted to use the Standard configuration, which is the default configuration, so I followed the "Slave with multiple configuration options, Option 1" approach.


Regards,
Graeme.

From: Sy Meshkat <sy.meshkat at dspcg.com>
Sent: Wednesday, 10 July 2019 6:01 AM
To: Graeme Foot <Graeme.Foot at touchcut.com>
Subject: RE: Question on use of EL3064 (Beckhoff ADC)

Dear Graeme,

Thanks a lot for your great help - it worked!

In order for us not to bother you with emails, asking a similar question about various Beckhoff slaves, could you kindly tell me: In order to come up with the PDO structure you used for EL3064 (below), did you use an existing source OR you conceived the solution from scratch yourself?

It will help us to know where this source is OR how you approached the solution from the basic Beckhoff (EL3064) xml file.  We want to know if we can formulate the process rather than look at each case as a new one.

Thanks a lot again!

Best regards,
 Sy Meshkat
 [cid:image001.jpg at 01D53708.E5341740]
DSP Control Group, Inc.
4445 W 77th Street
Minneapolis, MN 55435

general .           t:  1 + ( 952 ) 831 - 9556
fax                     f:  1 + ( 952 ) 831 - 4697
cell                     c:  1 + ( 612 ) 309 - 5478
direct                e:  1 + ( 952 ) 831 - 2349
website             i:   www.dspcg.com<http://www.dspcg.com/>
 -----------------------------------------------------------------------------------------------------------------
NOTICE: The foregoing message (including all attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. Sections 2510-2521, is CONFIDENTIAL. If you are not the intended recipient of this message, you are hereby notified that any retention, dissemination, distribution or copying of this communication is strictly prohibited. Please reply to the sender that you have received this message in error; then delete it

________________________________
From: Graeme Foot [mailto:Graeme.Foot at touchcut.com]
Sent: Monday, July 8, 2019 5:44 PM
To: Sy Meshkat
Cc: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: RE: Question on use of EL3064 (Beckhoff ADC)

Hi,

This is the PDO structures we use for EL3064 modules (available if you run the "ethercat cstruct" command for your module):

ec_pdo_entry_info_t EL3064_pdoEntries[] = {
    // Ch.1 (0)
    {0x6000, 0x01, 1}, /* Underrange */
    {0x6000, 0x02, 1}, /* Overrange */
    {0x6000, 0x03, 2}, /* Limit 1 */
    {0x6000, 0x05, 2}, /* Limit 2 */
    {0x6000, 0x07, 1}, /* Error */
    {0x0000, 0x00, 1}, /* Gap */
    {0x0000, 0x00, 6}, /* Gap */
    {0x6000, 0x0f, 1}, /* TxPDO State */
    {0x6000, 0x10, 1}, /* TxPDO Toggle */
    {0x6000, 0x11, 16}, /* Value */

    // Ch.2 (10)
    {0x6010, 0x01, 1}, /* Underrange */
    {0x6010, 0x02, 1}, /* Overrange */
    {0x6010, 0x03, 2}, /* Limit 1 */
    {0x6010, 0x05, 2}, /* Limit 2 */
    {0x6010, 0x07, 1}, /* Error */
    {0x0000, 0x00, 1}, /* Gap */
    {0x0000, 0x00, 6}, /* Gap */
    {0x6010, 0x0f, 1}, /* TxPDO State */
    {0x6010, 0x10, 1}, /* TxPDO Toggle */
    {0x6010, 0x11, 16}, /* Value */

    // Ch.3 (20)
    {0x6020, 0x01, 1}, /* Underrange */
    {0x6020, 0x02, 1}, /* Overrange */
    {0x6020, 0x03, 2}, /* Limit 1 */
    {0x6020, 0x05, 2}, /* Limit 2 */
    {0x6020, 0x07, 1}, /* Error */
    {0x0000, 0x00, 1}, /* Gap */
    {0x0000, 0x00, 6}, /* Gap */
    {0x6020, 0x0f, 1}, /* TxPDO State */
    {0x6020, 0x10, 1}, /* TxPDO Toggle */
    {0x6020, 0x11, 16}, /* Value */

    // Ch.4 (30)
    {0x6030, 0x01, 1}, /* Underrange */
    {0x6030, 0x02, 1}, /* Overrange */
    {0x6030, 0x03, 2}, /* Limit 1 */
    {0x6030, 0x05, 2}, /* Limit 2 */
    {0x6030, 0x07, 1}, /* Error */
    {0x0000, 0x00, 1}, /* Gap */
    {0x0000, 0x00, 6}, /* Gap */
    {0x6030, 0x0f, 1}, /* TxPDO State */
    {0x6030, 0x10, 1}, /* TxPDO Toggle */
    {0x6030, 0x11, 16}, /* Value */
};

ec_pdo_info_t EL3064_pdos[] = {
    {0x1a00, 10, EL3064_pdoEntries + 0}, /* TxPDO-Map Channel 1 */
    {0x1a02, 10, EL3064_pdoEntries + 10}, /* TxPDO-Map Channel 2 */
    {0x1a04, 10, EL3064_pdoEntries + 20}, /* TxPDO-Map Channel 3 */
    {0x1a06, 10, EL3064_pdoEntries + 30}, /* TxPDO-Map Channel 4 */
};

ec_sync_info_t EL3064_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_DISABLE},
    {3, EC_DIR_INPUT, 4, EL3064_pdos + 0, EC_WD_DISABLE},
    {0xff}
};

To configure it and use it you call something like the following commands on startup:

slaveConfig = ecrt_master_slave_config(master, alias, position, vendorID, productCode);
ecrt_slave_config_pdos(slaveConfig, EC_END, EL3064_syncs);

value1Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[9].index,
                   EL3064_pdoEntries[9].subindex, domain, &bitPos);
value2Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[19].index,
                   EL3064_pdoEntries[19].subindex, domain, &bitPos);
value3Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[29].index,
                   EL3064_pdoEntries[29].subindex, domain, &bitPos);
value4Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[39].index,
                   EL3064_pdoEntries[39].subindex, domain, &bitPos);

status1Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[0].index,
                    EL3064_pdoEntries[9].subindex, domain, &bitPos);
statue2Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[10].index,
                    EL3064_pdoEntries[19].subindex, domain, &bitPos);
status3Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[20].index,
                    EL3064_pdoEntries[29].subindex, domain, &bitPos);
status4Offset = ecrt_slave_config_reg_pdo_entry(slaveConfig, EL3064_pdoEntries[30].index,
                    EL3064_pdoEntries[39].subindex, domain, &bitPos);

The module returns a value between 0 and 32767 (int16 value) to represent 0 - 10V.  From that you can figure out your scale factor.  You can use a LRW (read/write) domain.

Regards,
Graeme.

From: Sy Meshkat <sy.meshkat at dspcg.com<mailto:sy.meshkat at dspcg.com>>
Sent: Tuesday, 9 July 2019 6:33 AM
To: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>
Subject: Question on use of EL3064 (Beckhoff ADC)

Dear Graeme,

This is Sy Meshkat with DSP Control Group.  Rahul and I talked/wrote to you about Yaskawa EtherCAT Sigma drive in summer of 2017.  Thanks to your helps our application is application is working fine.

Now, the question I have is weather you have any example of Beckhoff EL3064 Analog to Digital Converter as part of Linux EtherLab application stack.  This is a simple 4 channel ADC, but we couldn't find this hardware in IgH's EtherCAT master's hardware.

Best regards,
 Sy Meshkat
 [cid:image001.jpg at 01D53708.E5341740]
DSP Control Group, Inc.
4445 W 77th Street
Minneapolis, MN 55435

general .           t:  1 + ( 952 ) 831 - 9556
fax                     f:  1 + ( 952 ) 831 - 4697
cell                     c:  1 + ( 612 ) 309 - 5478
direct                e:  1 + ( 952 ) 831 - 2349
website             i:   www.dspcg.com<http://www.dspcg.com/>
 -----------------------------------------------------------------------------------------------------------------
NOTICE: The foregoing message (including all attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. Sections 2510-2521, is CONFIDENTIAL. If you are not the intended recipient of this message, you are hereby notified that any retention, dissemination, distribution or copying of this communication is strictly prohibited. Please reply to the sender that you have received this message in error; then delete it
From: Rahul Deshpande [mailto:rahulgd92 at gmail.com]
Sent: Thursday, August 24, 2017 12:58 PM
To: sy.meshkat
Subject: Fwd: RE: No CoE communication

---------- Forwarded message ----------
From: "Graeme Foot" <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>
Date: Aug 23, 2017 01:49
Subject: RE: No CoE communication
To: "Rahul Deshpande" <rahulgd92 at gmail.com<mailto:rahulgd92 at gmail.com>>
Cc: "etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>" <etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>>
Hi,

I have attached a test app to have a look at.  It is a (very) cut down version of how my app works.  Of course I use RTAI, so it won't be compatible with your Xenomi environment.


In main.c at the top of runECat() I have a list of EtherCAT devices and their addresses.  It is hard coded here but can of course be loaded from a config file.  The device names match devices in the etherCATSlaves.c file.

etherCATMaster.c contains the code to configure and run the master.  etherCATSlaves.c contains each slave's code.

yaskawaSGDV_create()
- configures the device and gets the PDO command offsets

yaskawaSGDV_prepareToRun()
- calculates each commands address (after the domains are populated and allocated)
- sets cyclic synchronous position mode (optional, the mode can be set at any time while running)
- sets the control word to zero, just in case

yaskawaSGDV_run()
- is called once each scan.  add code here to control the axis

yaskawaSGDV_prepareToStop()
- is called when the app is closing.  add any code here to clean up your axis


Note: In this app the prepareToStop() functions are called once and then the app is shut down immediately.  In reality you should continue your realtime cycle until all of the devices are stopped, disabled and safe to turn off.  The app also relies on some of my patches.


I hope this helps

Regards,
Graeme.



-----Original Message-----
From: etherlab-users [mailto:etherlab-users-bounces at etherlab.org<mailto:etherlab-users-bounces at etherlab.org>] On Behalf Of Graeme Foot
Sent: Wednesday, 16 August 2017 10:42 a.m.
To: Rahul Deshpande <rahulgd92 at gmail.com<mailto:rahulgd92 at gmail.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: Re: [etherlab-users] No CoE communication

Hi,

I've been asked to let you know what master version and patches I'm using.  I'm still running an old version (2526 from the stable-1.5 branch, 12/02/2013).  The script I use to download it is attached (004-etherlab_master).

I use buildroot to create my linux system, so the script  tar's the master folder and puts it in the buildroot downloads folder.  Note: I also use a really old buildroot from 2012 with a few modifications, but I have attached the mk file that it uses.

The patches that I apply are also attached.

The build options I use are:
--with-linux-dir="<linux dir>"
--enable-cycles
--enable-rtdm
--enable-e100
--enable-e1000
--enable-e1000e
--enable-cx2100


I use RTAI, but that shouldn't make any difference.


Regards,
Graeme.


-----Original Message-----
From: etherlab-users [mailto:etherlab-users-bounces at etherlab.org<mailto:etherlab-users-bounces at etherlab.org>] On Behalf Of Graeme Foot
Sent: Tuesday, 15 August 2017 12:39 p.m.
To: Rahul Deshpande <rahulgd92 at gmail.com<mailto:rahulgd92 at gmail.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: Re: [etherlab-users] No CoE communication

Remember to reply-all to mail the forum as well.

Line 85 has: #define Yaskawa_Sigma7  0x00000539, 0x02200301 This is different to my drive, so it may still be the Sigma 7 id causing a mismatch, but it is the id being returned from the ethercat struct command.

Other than that, I've got no idea.

Graeme.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20190709/d69f6b69/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2856 bytes
Desc: image001.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20190709/d69f6b69/attachment-0001.jpg>


More information about the etherlab-users mailing list