PyAlarm and polling
|
|
---|---|
Hi all, I started working with the Panic-PyAlarm system but I don't understand how it works. Does PyAlarm check for events on the attributes monitored or use only polling? I have written a very simple device generating random values for an attribute with the change_event enabled.I monitor this attribute with PyAlarm but if the attribute changes more quickly than the PollingPeriod property value, I miss some alarm conditions. What I'm doing wrong? Thanks in advance fore you help! Cheers, Elisabetta |
|
|
---|---|
Dear Elisabetta, I am not an expert of PyAlarm but I think this is normal. PyAlarm probably uses Tango Events to monitor the attribute. The events are only sent as fast as the polling period (unless the attribute does a push_event in between). In this case you will miss events. Andy |
|
|
---|---|
Hi Elisabetta, if I correctly undestand the PollingPeriod property you are referring is the PyAlarm one… in this case I guess you may have a configuration issue such as incorrect TANGO_HOST (which has to be exactly the same on both server and client side) or incorrect events configuration… thus PyAlarm fallback is to poll the source devices to read attributes at the specified PollingPeriod. And, of course, anything that happens in between is lost. Ciao, Lorenzo |
|
|
---|---|
Hi Lorenzo, yes the PollingPeriod I refer to is one of the property of the PyAlarm device. The server and the client have the same setting of the TANGO_HOST environment variable, and I have configured the change event on the monitored attribute. Obviously the missing of events strongly depends on the value of PollingPeriod: if I set it to 1 sec this effect is reduced. But it was the mechanism of detection that I didn't well understand. Talking also with the PyAlarm developer,I have understood it's something related to events configuration in PyAlarm when Taurus library is installed. Thanks for you answer and help Elisabetta |
|
|
---|---|
Hi Elisabetta, Sorry for the late answer, I posted the recipe on how to setup PyAlarm listening to events on github: https://github.com/tango-controls/PANIC/blob/documentation/doc/recipes/UseEventsWithTaurus.rst I hope it will be useful to anybody trying to understand how it works. I'm progressing with the Panic documentation and I'll be adding recipes/how-tos to the project gradually. Good luck! Sergi |
|
|
---|---|
I added some links to the project page: http://www.tango-controls.org/community/projects/panic-alarm-system/ The PyAlarm User Guide has been updated in github: https://github.com/tango-controls/PANIC/blob/documentation/doc/PyAlarm.rst |