[etherlab-users] AL States

BUSSIERES Vincent vincent.bussieres at hemeria-group.com
Fri Jul 3 15:45:04 CEST 2020


Hi Graeme,

Thanks for all the information. It's more clear for me.

Regards

Vincent BUSSIERES
Responsable Technique Logiciel

[1572337113342]
ZE Ma Campagne
36, Impasse Félix Nadar
16000 ANGOULEME
Tel: 33 (0)9.72.40.35.08
www.hemeria-group.com<https://webmail.nexeya.fr/owa/redir.aspx?C=GK_BqKCZef7LtPZnqnd_LGYr1NG9sz4Smy3iKIwO-pXqtJC7VgzXCA..&URL=http%3a%2f%2fwww.hemeria-group.com%2f>
P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel qu'en cas de nécessité.
Ce message et les fichiers pouvant être attachés sont confidentiels, réservés à l'usage unique des destinataires et n'engagent HEMERIA sous aucune forme que ce soit.
This email and any files transmitted with it are confidential, intented solely for the unique use of the recipients and don't commit HEMERIA.



De : Graeme Foot <Graeme.Foot at touchcut.com>
Envoyé : vendredi 3 juillet 2020 01:13
À : BUSSIERES Vincent <vincent.bussieres at hemeria-group.com>; etherlab-users at etherlab.org
Objet : RE: AL States

Hi Vincent,

If the master operational state is different to each slaves operational state.  If the master phase is in Operation (via the "ethercat master" command) it means that ecrt_master_activate() has been called and the master can activate the slaves that have been configured and realtime operation has begun.

If a slave is not configured the master does not know about it so it will stay in PREOP.
If a slave has a different alias to the one configured the master can not correctly connect to it so it will stay in PREOP.

For all slaves the master does know about, and can connect to, the master will attempt to bring them into OP mode.  However, each slave needs to be brought to OP mode via a state machine that takes a little time.  If you are not using Gavin Lamberts patchset the master will do so one slave at a time.  If you are using his patchset then it will do ~ 16 slaves in parallel at a time, so somewhat faster.

Conversely, when you call ecrt_master_deactivate() all known and connected slaves are returned to PREOP and then the master goes to the Idle phase.

Also, just to add a little extra, if the master is idle you can use the "ethercat states" command to manually request a state on a particular slave.  So a slave could actually be in OP state while the master is idle.



So to directly answer your question "Can master be considered as OP state if at least one slave is in OP state?": No.





If you have called ecrt_master_activate(), and it returned success, your master is operational, until you call ecrt_master_deactivate().  However, whether you consider your system ready to use will probably depend in whether all your required slaves are up and running at the OP state.



And for extra credit, slaves can be hot connected and comms can be interrupted.  If the master is active it will handle slaves disappearing and appearing and, for configured slaves, run through their state machines to get them back to OP mode automatically.  So if you have a group of slaves that can be disconnected (on purpose), put them in a separate domain and use ecrt_domain_state() to check the wc_state parameter to ensure that group of slaves is fully operational for the functions they need to perform.


Regards,
Graeme.


From: BUSSIERES Vincent <vincent.bussieres at hemeria-group.com<mailto:vincent.bussieres at hemeria-group.com>>
Sent: Friday, 3 July 2020 8:15 AM
To: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: RE: AL States


Hi,



Indeed, some slaves are not in OP state. There are 6 slaves on my network, two of them are in PREOP state.

I can get their states using ethercat slaves -v command but when I run ethercat master command, master is in OP state.

Can master be considered as OP state if at least one slave is in OP state?



Best reagards

________________________________
De : Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>
Envoyé : lundi 29 juin 2020 00:12
À : BUSSIERES Vincent; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Objet : RE: AL States


Hi,



If you are using ecrt_master_state() the al_states parameter is filled in by all slaves with an OR operation.  So for each bit that is set you can interpret that as at least one slave was in that state.  If there is a state bit set you are not happy with (or expecting) then you will need to interrogate each slave individually to find out which slave(s) are in that state, using ecrt_slave_config_state().



On startup (or comms interruption and recovery) you can expect to see slaves at different stages on the way to OP mode.  If you are fully operational and you have a PREOP bit set, then you likely have a device that is not known so is not configured, or has the wrong address so it is not being attached to correctly.  If a slave stays in SAFEOP then you probably have a configuration error, check the logs to figure out the problem.



Regards,

Graeme.



From: etherlab-users <etherlab-users-bounces at etherlab.org<mailto:etherlab-users-bounces at etherlab.org>> On Behalf Of BUSSIERES Vincent
Sent: Friday, 26 June 2020 9:25 PM
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] AL States



Hello,



I'd like to display AL state in my HMI.



AL states are :
·        Bit0 : INIT
·        Bit1 : PREOP
·        Bit2 : SAFEOP
·        Bit3 : OP



But when I read AL states, states are respetively :


·        0x02      (0010)
·        0x03      (0011)
·        0x0a      (1010)
·        0x0e      (1110)
·        0x0a      (1010)



So, in some cases I don't know in which state I am ?

How can I determine AL State ?



Regards



Vincent BUSSIERES

Responsable Technique Logiciel



[1572337113342]

ZE Ma Campagne

36, Impasse Félix Nadar

16000 ANGOULEME

Tel: 33 (0)9.72.40.35.08

www.hemeria-group.com<https://webmail.nexeya.fr/owa/redir.aspx?C=GK_BqKCZef7LtPZnqnd_LGYr1NG9sz4Smy3iKIwO-pXqtJC7VgzXCA..&URL=http%3a%2f%2fwww.hemeria-group.com%2f>
P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel qu'en cas de nécessité.

Ce message et les fichiers pouvant être attachés sont confidentiels, réservés à l'usage unique des destinataires et n'engagent HEMERIA sous aucune forme que ce soit.
This email and any files transmitted with it are confidential, intented solely for the unique use of the recipients and don't commit HEMERIA.






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200703/304df617/attachment-0004.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5034 bytes
Desc: image001.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200703/304df617/attachment-0005.png>


More information about the Etherlab-users mailing list