[etherlab-users] Please help newbie to etherlab with setting PDOs

Gavin Lambert gavin.lambert at tomra.com
Thu Mar 29 00:12:33 CEST 2018


Most of the examples show both inputs and outputs.

There's two different kinds of configuration for PDOs that you set up in advance:


  *   You need the core master library and the slave to agree on what PDOs are enabled in their Sync Managers.
     *   This is what the examples refer to as "configuring PDOs" and is done via ecrt_slave_config_pdos.
     *   This will update the PDO Assign registers, and (for the rare case of a slave that has fully reconfigurable PDOs) the PDO registers themselves.
     *   This is somewhat optional for slaves with fixed PDO assignments, but it's still a good idea to do this as it allows defining a domain for slaves that aren't yet online for whatever reason.
  *   You need your master app to know where to actually read/write the data in cyclic operation, and to associate an SM with a domain.
     *   This is what the examples refer to as "registering PDOs" and is done via ecrt_domain_reg_pdo_entry_list.
     *   It is technically sufficient to register only one entry in each PDO, as the other entries in the same PDO should always have contiguous memory layout (which you already know since you had to specify it when configuring the PDOs).  However it can be convenient to register several or all since this will give you explicit pointers to each entry.
     *   It *is* required to register at least one entry in each PDO that you will be reading/writing, as it is not safe to assume that the PDOs will actually be received/transmitted in the order that you configured.
     *   It is harmless to not register some PDO that you will not actually be reading or writing - it will still end up in the SM and domain by virtue of the PDO configuration.
     *   This also lets you associate a PDO with a domain, although note that you have to take the SM into account as well.  All PDOs in one SM must be in the same domain; PDOs in separate SMs may be either in the same or separate domains.

The ETG documentation should give you a good grounding in the fundamentals of EtherCAT (such as SMs, PDOs, entries, DC), although it can be tricky to find the right documents - the official standards are mostly impenetrable and you may have better luck reading other more informal documents.  Beckhoff also has some fairly good documents to get a good grounding in EtherCAT in general.

Though you do need that initial grounding in EtherCAT to understand Etherlab, none of those documents will directly help you with the Etherlab library; while it does of course implement an EtherCAT master and so does share the same underlying fundamentals, the exact APIs involved and how to use them are unique to Etherlab.  There is, however, a fairly good manual included with the library; some places are a little out of date but it should still give you a good idea how to get started.

From: Montgomery-Smith, Stephen [mailto:stephen at missouri.edu]
Sent: Thursday, 29 March 2018 10:15
Subject: Re: Please help newbie to etherlab with setting PDOs

Thank you for your response.  Sorry for the late response, but I was only able to try it out today because of life was so busy.

You were correct - all I had to do was activate the master, and then wait a while.

I looked at the dc_user example.  What is registering PDOs all about?  Do I just need to register one of the registers in a PDO mapping, or do I need to register all of them?  I noticed that registering just one from each PDO mapping made the domain_data_size correct.  I have one PDO mapping for input and one PDO mapping for output.  Should I create two different domains for each PDO mapping?  Or can I use both PDO mappings with one domain?

Is there an example program which involves both input and output?

Is there documentation on the Ethercat User Group website that could help me sort this all out?  (I have membership, so I can look at everything they have.)

On 03/18/2018 05:49 PM, Gavin Lambert wrote:
Your custom configuration is not applied to the slave until you activate the master.  After that you can confirm the settings using "ethercat pdos" or those methods (though note that it does not happen immediately - there will be some delay before the slave is actually configured).

Have a look at the dc_user and other example programs for examples of slave configuration.

From: Montgomery-Smith, Stephen
Sent: Saturday, 17 March 2018 09:21
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] Please help newbie to etherlab with setting PDOs


I am trying out etherlab to connect my computer to a Parker Hannifin motor controller - you can read about it here: http://www.parker.com/Literature/Electromechanical%20North%20America/CATALOGS-BROCHURES/PSeries/PSeries_UG_EtherCAT_A.pdf



I am trying to tell it to use a certain PDO, which on page 68 of the manual is called 1st PDO mapping.  I use the ecrt_slave_config_pdos function to tell it what PDO to use.  But whenever I run the program, and ask it to print out the PDO using ecrt_master_get_pdo and ecrt_master_get_pdo_entry, I get output that tells me it is using the 2nd PDO mapping (see below).  I feel like I am missing something.  Is there a good sample program that shows me how to set up something like this that I can copy?



(I have used EC-Master from Acontis, and I was able operate the controller using their software.  But I want to find an open source solution.)



Output of my program:
Output PDO 0x1601 with 4 entries:
  PDO entry 0: 0x6040 0 16
  PDO entry 1: 0x607a 0 32
  PDO entry 2: 0x60b8 0 16
  PDO entry 3: 0x60fe 1 32
Input PDO 0x1a01 with 6 entries:
  PDO entry 0: 0x6041 0 16
  PDO entry 1: 0x6064 0 32
  PDO entry 2: 0x60f4 0 32
  PDO entry 3: 0x60b9 0 16
  PDO entry 4: 0x60ba 0 32
  PDO entry 5: 0x60fd 0 32
Thanks, Stephen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20180328/610f7717/attachment-0004.htm>


More information about the Etherlab-users mailing list