[Etherlab-users] Patch for --enable-regalias

Gavin Lambert gavin.lambert at tomra.com
Tue Dec 13 02:33:51 CET 2022


I'm not sure this makes sense.

Register 0x0012 is typically used for slave identification for slaves that have hardware switches of some kind to specify the desired alias.  In almost all cases, these will have an SII alias of zero; as such it would be counterproductive to skip reading them in that case.  It is usually required to reboot the slave to change its id switch.  (See "Explicit Device Identification" in ETG1020 for more info.)

In the absence of devices that use such a hardware id selector, you should avoid using the -enable-regalias configuration option for improved scan performance.

For master-based changing of the alias (e.g. via the "ethercat alias" command), rebooting the slave is still required and (unless the slave implementation has chosen otherwise) will also be reflected in register 0x0012, so this will work regardless of whether -enable-regalias is enabled or not.

I could perhaps understand a patch to instead only read register 0x0012 if the ESI alias is zero (and trust the ESI alias otherwise), to perhaps allow changing the alias without rebooting.  However the documentation is fairly clear that the reboot is not optional.  Etherlab does bypass some of this requirement by only using the station address (not the alias) on the wire, thus making it appear as if the device is answering to an alias change without a reboot, but it's best not to rely on this sort of implementation detail.

(A slave may also choose to implement CoE object 0x10E0, which allows updating 0x0012 without a reboot, but this is not mandatory.)

Gavin Lambert

Senior Software Developer TOMRA Fresh Food



[cid:TOMRA_CMYK_final_size_times_two_cd761a01-1d1f-446e-9316-8012271820b6.png]

[cid:TOMRA_50th-Email_Signature_Food-08_ba63a226-17be-4b94-80e3-3f48ae3d72b3.jpg]

 [cid:TF-FB-icon_b77c57e4-4990-4f9d-b3a2-8e6ab45df7f2.jpg] <https://www.facebook.com/TOMRA.Food/>  [cid:TF-LinkedIn-icon_d54c4829-dcb9-450c-9187-34b26e85ebaa.jpg] <https://www.linkedin.com/company/tomra-food/>  [cid:TF-twitter-icon_65c62d2e-772c-4a2c-97c5-d84fbfc204d5.jpg] <https://twitter.com/TOMRAFood>  [cid:TF-Youtube-icon_8b2c830c-70d9-48da-a4db-db9191d346ba.jpg] <https://www.youtube.com/playlist?list=PLDD3B1A7BAE919EC6>  [cid:TOMRAinstagram_45b30c55-490a-4f32-8fd3-998c152e3494.jpg] <https://www.instagram.com/tomrafood/>
 Compac Technologies Ltd | 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | New Zealand

 Phone: +64 96 34 00 88 | https://www.compacsort.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: Tuesday, 13 December 2022 14:05
To: etherlab-users at etherlab.org
Subject: [Etherlab-users] Patch for --enable-regalias

Hi,

I have attached a patch for the --enable-regalias option.

--enable-regalias enables reading slave aliases from register 0x0012.  When enabled all slaves read 0x0012, replacing any alias value read from the SII.  However, if you set a new alias on a slave (with the "ethercat alias" function) the 0x0012 register is not updated (and is readonly to the master so can't be).  This requires the slave to be repowered/restarted for the register to update.  So if you restart the master without repowering/restarting the slave, the master will read the old alias from the 0x0012 register.

The patch will now only read register 0x0012 if the SII alias is non-zero.  This slightly shortens the slave scan for most slaves (that have aliases) and allows the master to use the correct alias on restart.  However, if you are resetting the alias (setting it to zero) the slave will still require a repower/reset.

Note you shouldn't be setting aliases via the "ethercat alias" function on slaves with dials/dipswitches, or slaves that only support 0x0012 (and not SII aliases), so we can ignore any issues these slaves could have.

The patch is based on mercurial revision 2679 (33b922ec1871) and the gavinl patchset 20171108.


Regards,
Graeme Foot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TOMRA_CMYK_final_size_times_two_cd761a01-1d1f-446e-9316-8012271820b6.png
Type: image/png
Size: 6455 bytes
Desc: TOMRA_CMYK_final_size_times_two_cd761a01-1d1f-446e-9316-8012271820b6.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TOMRA_50th-Email_Signature_Food-08_ba63a226-17be-4b94-80e3-3f48ae3d72b3.jpg
Type: image/jpeg
Size: 58287 bytes
Desc: TOMRA_50th-Email_Signature_Food-08_ba63a226-17be-4b94-80e3-3f48ae3d72b3.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0006.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TF-FB-icon_b77c57e4-4990-4f9d-b3a2-8e6ab45df7f2.jpg
Type: image/jpeg
Size: 10123 bytes
Desc: TF-FB-icon_b77c57e4-4990-4f9d-b3a2-8e6ab45df7f2.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0007.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TF-LinkedIn-icon_d54c4829-dcb9-450c-9187-34b26e85ebaa.jpg
Type: image/jpeg
Size: 10214 bytes
Desc: TF-LinkedIn-icon_d54c4829-dcb9-450c-9187-34b26e85ebaa.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0008.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TF-twitter-icon_65c62d2e-772c-4a2c-97c5-d84fbfc204d5.jpg
Type: image/jpeg
Size: 10254 bytes
Desc: TF-twitter-icon_65c62d2e-772c-4a2c-97c5-d84fbfc204d5.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0009.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TF-Youtube-icon_8b2c830c-70d9-48da-a4db-db9191d346ba.jpg
Type: image/jpeg
Size: 10218 bytes
Desc: TF-Youtube-icon_8b2c830c-70d9-48da-a4db-db9191d346ba.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0010.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TOMRAinstagram_45b30c55-490a-4f32-8fd3-998c152e3494.jpg
Type: image/jpeg
Size: 10303 bytes
Desc: TOMRAinstagram_45b30c55-490a-4f32-8fd3-998c152e3494.jpg
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20221213/0b237cd0/attachment-0011.jpg>


More information about the Etherlab-users mailing list