[etherlab-users] Question on use of EL3064 (Beckhoff ADC)
Gavin Lambert
gavin.lambert at tomra.com
Wed Jul 10 01:39:21 CEST 2019
You actually don’t need to build your own cstruct for custom configurations (although it can be a useful exercise so that you understand how it works).
With the slave attached and no application running, you can issue “ethercat download” commands to set up the PDO Assign (and optionally PDO Config) objects to select the configuration you want (or use another configuration tool such as TwinCAT), and then use “ethercat cstruct” to get the configuration while in that state. This will give you the data to make the Etherlab master replicate the equivalent PDO Assign and/or PDO Config object writes. (Any additional SDO configuration beyond these does have to be separately translated to ecrt_slave_config_sdo* calls, though.)
Although it might be debatable whether figuring out the cstruct or figuring out the download values is the easier job between the two. 😊
Gavin Lambert
Senior Software Developer
[cid:logo_compac_5dcf97ef-52f5-498c-8b9b-728410ddffaf.png]
[cid:compacicon_82e8a8c7-154a-4a32-9720-a5badb6258e0.png]<http://www.compacsort.com> [cid:facebook_fa85b924-53b9-45cc-8162-0564f64ec3a3.png] <https://www.facebook.com/Compacsort> [cid:linkedin_4ec016ad-84fa-443c-85a3-b9615a4ccef8.png] <https://www.linkedin.com/company/compac-sorting-equipment/> [cid:youtube_32142163-fc27-4aed-b14d-e8a377f98a6d.png] <https://vimeo.com/compacsort> [cid:twitter_d89338d8-98c8-4b65-9a9e-7b1333160b0d.png] <https://twitter.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: Graeme Foot
Sent: Wednesday, 10 July 2019 10:48
To: Sy Meshkat <sy.meshkat at dspcg.com>
Cc: etherlab-users at etherlab.org
Subject: Re: [etherlab-users] Question on use of EL3064 (Beckhoff ADC)
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<mailto:sy.meshkat at dspcg.com>>
Sent: Wednesday, 10 July 2019 6:01 AM
To: Graeme Foot <Graeme.Foot at touchcut.com<mailto: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 01D53712.F12B3F60]
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<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dspcg.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0dac4c25d7744cf53c0808d704bf9702%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C636983093249791285&sdata=1PW8xsCBvZd9khue2aKdL4K1gfQ7fTyZv4lrnx2xfMY%3D&reserved=0>
-----------------------------------------------------------------------------------------------------------------
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 01D53712.F12B3F60]
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<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dspcg.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0dac4c25d7744cf53c0808d704bf9702%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C636983093249791285&sdata=1PW8xsCBvZd9khue2aKdL4K1gfQ7fTyZv4lrnx2xfMY%3D&reserved=0>
-----------------------------------------------------------------------------------------------------------------
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/8c830b9c/attachment-0004.htm>
-------------- 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/8c830b9c/attachment-0005.jpg>
-------------- 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/20190709/8c830b9c/attachment-0030.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/20190709/8c830b9c/attachment-0031.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/20190709/8c830b9c/attachment-0032.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/20190709/8c830b9c/attachment-0033.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/20190709/8c830b9c/attachment-0034.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/20190709/8c830b9c/attachment-0035.png>
More information about the Etherlab-users
mailing list