[etherlab-users] Can we access the slave by physical addressing from the master?

Richard Hacker ha at igh.de
Fri Apr 15 18:24:31 CEST 2016


Hi Paul,

The way to do this is to use aliases. Every slave can store an alias 
(which is a number) in EEPROM. To set the alias of a slave, use
# ethercat alias -p10 100
This will set the alias of slave 10 to 100.

The master can address a slave at an absolute position or relative to an 
aliassed slave. In fact, absolute addressing is actually relative 
addressing to alias 0 which is the very first slave, no matter what its 
alias is.

When the master scans the bus, every time it encounters a non-zero alias 
in a slave it reinitializes its alias counter to zero.

With this setup, you can address the third slave after slave alias 100 
using:
ec_pdo_entry_reg_t->alias = 100
ec_pdo_entry_reg_t->position = 3

You have the option of setting the alias of every slave, but this does 
not scale very well, especially after replacing a slave with a new one.

In a changing topology, we typically set the slave alias of a coupler 
(e.g. EL1100) and then address the slaves relative thereto.

Just a hint, although I may be wrong on this: you get special couplers 
(EK1101) that have an ID switch which is mapped to the alias as far as I 
know. Then you can replace a broken coupler in the field without 
actually setting the alias manually.

- Richard

On 15.04.2016 15:38, Paul Mulligan wrote:
> Hi,
>
> If I want to access a slave on the Ethercat bus, we use the position of
> the slave on the bus to access it with ecrt_master_slave_config(). If we
> then put a new slave on the bus before this slave for example, this
> means that the position number of the first slave will change and we
> need to reconfigure our code.? This presents problems.
>
> My question is, can we not access the slave via their physical addresses
> instead of this incremental position addressing, therefore not needing
> to update the position address every time there is a change?
>
> Thanks
>
>
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>



More information about the Etherlab-users mailing list