Hi Andy, I think that you’ve found a bug in last version of fandango. I’m still trying to reproduce and I’ll notify you as soon as I found the fix.
Sergi
Hi Andy, I think that you’ve found a bug in last version of fandango. I’m still trying to reproduce and I’ll notify you as soon as I found the fix.
Sergi
And regarding Ambar … I have to clarify some usage of the API.
The Alarm.severity is just a classification of the alarm in a category (ALARM,SEVERITY,DEBUG,…) ; but it doesn’t tell you if the alarm is active or not.
To know if the alarm has been activated you must use the Alarm.get_active() method; that will connect to the PyAlarm device server and return the time when the alarm was activated; or 0 if it is not active.
The Alarm.active value will cache the last get_active() result; but will not update the value unless you call get_active().
All non-callable members of the Alarm class are just passive variables, not python properties. Thus, you need to call the get_…() methods to updated them.
Hope this solved your issue,
Sergi Rubio
Hi Andy,
[quote=“Andy”]I have a problem with an alarm formula that does not work as I would like it to. The formula is
elin/master/op != ON
which evaluates to True even when the linac is ON. Any ideas why this is so? Here is the output from the report:
TAG: LINAC
Formula: elin/master/op != ON
Values are:
elin/master/op: DeviceAttribute[
name = 'State'
value = PyTango._PyTango.DevState.ON
[/quote]
Definitely this problem with the state it’s the same that you experienced with
sim/motor/1/position: an AttributeValue object is being returned instead of the attribute value itself.
The fact is that I’m completely unable to reproduce your problem.
import PyTango
adp = PyTango.DeviceProxy('test/alarms/1')
d = 'lab/cpd/temperatures'
PyTango.DeviceProxy(d).state()
Out: PyTango._PyTango.DevState.ON
adp.evaluateFormula(d)
Out: '0'
adp.evaluateFormula(d+'/State')
Out: '0'
adp.evaluateFormula(d+' == ON')
Out: 'True'
adp.evaluateFormula(d+' != ON')
Out: 'False'
I’m using PyTango 8.1.6 and a fresh checkout of fandango and PyAlarm from repository … could you confirm me if you are using exactly the same packages?
svn co https://svn.code.sf.net/p/tango-cs/code/share/fandango/trunk/fandango fandango
svn co https://svn.code.sf.net/p/tango-ds/code/DeviceClasses/SoftwareSystem/PyAlarm/trunk .
python PyAlarm.py $INSTANCE &
Sergi
Hi Sergi
Thanks for the above solution for the max function. It worked.
I have one more query
Can we set the quality of attribute using receiver ? If Yes, How ?
Thanks and Regards
TCS-GMRT Team
Sorry, but no. The quality (as a part of the value) of an attribute must be set within the device owning that attribute.
Of course you can write a value to an attribute from an alarm, but the read quality of the attribute must be set by the device (or as a combination of the value and the Tango configuration of the attribute).
Hi Sergi
I studied the document for Panic-Alarm provided.
I am not getting the meaning of following configurations:
I set the reminder = 20. It doesn’t throw the reminder after 20 second also.
Also can we set action if alarms recovers in AlarmReceiver.
Suppose rule is l/m/n/Speed>34
Lets say now value of Speed is 36. Thus rule is true. I have set the action in alarmreceiver as ACTION(alarm:attribute,l/m/n/Alarm_Status,“Alarm occured”)
Now Value of speed becomes 30. Now can I set the action to set the alarm status as “Alarm recovered”.
Thanks and Regards
TCS-GMRT Team
Meanings are:
StartupDelay: the device will wait before starting to evaluate the alarms (e.g. giving some time to the system to recover from a powercut).
Enabled: if False or 0 the PyAlarm it equals to disabling all alarm actions of the device; if it is True the behavior will be the normal expected; if it has a numeric value (e.g. 120) it means that the device will evaluate the alarms but not execute actions during the first 120 seconds (thus alarms can be activated but no action executed). It is used to prevent a restart of the device to re-execute all alarms that were already active.
EvalTimeout: The proxy timeout used when evaluating the attributes (any read attribute slower than timeout will raise exception).
AlarmThreshold: number of cycles that an alarm must evaluate to True to be considered active (to avoid alarms on “glitches”).
RethrowAttribute/RethrowState: Whether exceptions on reading attributes or states should be rethrown to higher levels, thus causing the alarm to be triggered. By default alarms are enabled if an State attribute is not readable (RethrowState=True), but when a numeric attribute is not readable its value is just replaced by None (RethowAttribute=False) and the formula evaluated normally.
Reminder: A new email will be sent every XX seconds if the alarm remains active. When AlertOnRecovery is True an email will be sent also every time when the formula result oscillates from True to False.
UseProcess: This is an experimental feature, like UseTaurus and others. In general, I advice you to not modify any parameter that is not detailed in the PyAlarm user guide as you may obtain unexpected results. Some parameters are used to test new features still under development and their behavior may vary between commits.
Regarding actions on recovery … this option is planned but not yet fully available. Actually just emails are sent when AlertOnRecovery is True. This feature may be implemented in the next 6 months or so but the syntax is still to be decided.
Sergi
ALBA Synchrotron
Hi Sergi,
I have the latest PyTango (8.1.7) and fandango and panic from SF. I can try to get the again. Anyway here is the output I get from python when I try the same as you did:
>>> import PyTango
>>> adp = PyTango.DeviceProxy('test/alarms/1')
>>> d = 'elin/master/op'
>>> PyTango.DeviceProxy(d).state()
PyTango._PyTango.DevState.ON
>>> adp.evaluateFormula(d)
"DeviceAttribute[\ndata_format = PyTango._PyTango.AttrDataFormat.SCALAR\n dim_x = 1\n dim_y = 0\n has_failed = False\n is_empty = False\n name = 'State'\n nb_read = 1\n nb_written = 0\n quality = PyTango._PyTango.AttrQuality.ATTR_VALID\nr_dimension = AttributeDimension(dim_x = 1, dim_y = 0)\n time = TimeVal(tv_nsec = 0, tv_sec = 1441902343, tv_usec = 305273)\n type = PyTango._PyTango.CmdArgType.DevState\n value = PyTango._PyTango.DevState.ON\n w_dim_x = 0\n w_dim_y = 0\nw_dimension = AttributeDimension(dim_x = 0, dim_y = 0)\n w_value = None]\n"
>>> adp.evaluateFormula(d+'/State')
"DeviceAttribute[\ndata_format = PyTango._PyTango.AttrDataFormat.SCALAR\n dim_x = 1\n dim_y = 0\n has_failed = False\n is_empty = False\n name = 'State'\n nb_read = 1\n nb_written = 0\n quality = PyTango._PyTango.AttrQuality.ATTR_VALID\nr_dimension = AttributeDimension(dim_x = 1, dim_y = 0)\n time = TimeVal(tv_nsec = 0, tv_sec = 1441902343, tv_usec = 305273)\n type = PyTango._PyTango.CmdArgType.DevState\n value = PyTango._PyTango.DevState.ON\n w_dim_x = 0\n w_dim_y = 0\nw_dimension = AttributeDimension(dim_x = 0, dim_y = 0)\n w_value = None]\n"
>>> adp.evaluateFormula(d+' == ON')
'False'
>>> adp.evaluateFormula(d+' != ON')
'True'
>>>
>>> print PyTango.__version__
8.1.7
>>>
Thanks for your help!
Andy
Sergi,
I checked out the latest versions of fandango and PyAlarm and have the same result as in my previous post. If you have any other ideas how I can track down the problem let me know.
Andy
Hi Sergi
I have three devices : a/a/a/Speed
a/a/b/Speed
a/a/c/Speed
I have to group them.
Syntax is:any([t>10 for t in FIND(a/a/*/Speed)])
But now i have to group 2 of them, not 3.
I am using the below syntax
Syntax: any([t>10 for t in [a/a/a/Speed,a/a/b/Speed]])
Following error comes:
NameError: name ‘a’ is not defined
What is the correct syntax ?
Thanks and Regards
TCS-GMRT Team
Hi,
Could you try to add some spaces around device names? Maybe the parser is getting confused
any([t>10 for t in [ a/a/a/Speed , a/a/b/Speed ]])
Sergi
Hello Sergi
I tried by having space across device names. It worked
Thanks and Regards
TCS-GMRT TEAM.
Hello Sergi
1.)I have around 150 alarms in my list. When I try to disable single/multiple alarms, its not disabling the selected alarms but when the alarm number is less, then I am able to perform the disable action. Same problem is with acknowledging single/multiple alarms.
2.)I am trying to import from .csv file. It has around 150 alarms, so the window which opens which says"Choose alarms to import" doesn’t have scrollbar attached and I am unable to browse through the lower alarms. Similarly, the problem is with disable and delete button. If you try to delete and disable around 150 alarms, the scrollbar doesnt come. So you couldnt see ok button. I have attached the screenshot of the same problem
Any Suggestions ??
Thanks and Regards
TCS-GMRT TEAM
Hi TCSGMRT,
The .csv loading/exporting has not been put into production yet, so it may be buggy. The other problems with multiple selection have been already solved in development but the branch is not ready yet to merge to SVN.
I take note of your problems and I’ll try to fix it in the next release (end of october).
Sergi
Hi Andy,
[quote=“Andy”]Sergi,
I checked out the latest versions of fandango and PyAlarm and have the same result as in my previous post. If you have any other ideas how I can track down the problem let me know.
Andy[/quote]
I’m very sorry, but I did the same in two different machines and I’m not able to reproduce the problem at all.
Are you trying this on a virtual machine? If you could send me a link to the virtual machine then I’ll try to debug it there.
It is indeed very strange, as if something was weird in the pythonpath.
Sergi
Solved!!!
The bug found by Andy was caused by fandango.get_tango_host() assuming that TANGO_HOST was declared as environment variable.
Now it is corrected and working fine,
Sergi
Hello Sergi
I have created one application in taurus which have one button.I have requirement to open the Alarm_Panic_GUI(gui.py file present inside Panic Directory) on click of that button. How can I achieve this functionality?
I have tried to do it in following way in my taurus application:
def openAlarmPanicGUI(self):
self.guiObj = gui.main(sys.argv[1:] or ([os.getenv(‘PANIC_DEFAULT’)] if os.getenv(‘PANIC_DEFAULT’) else )).exec_()
But i am able to open the gui.py. But when i close the Alarm-Tool, My taurus application won’t work seamlessly. Whats the better way to meet the below requirement
def openAlarmPanicGUI(self):
“I want to call gui.py file from here”
“Object of gui.py should be created here”
Thanks and Regards
TCS_GMRT TEAM
Hi, well, I have two updates
First, to add the panic GUI to a TaurusGUI you can add it using the common PanelDescriptor object in your taurus_ui.py file; it will integrate the AlarmGUI within Taurus (update panic gui sources before doing so):
...
panic_panel = PanelDescription('PANIC','panic.gui.AlarmGUI',
sharedDataWrite={'HighlightInstruments':'devicesSelected'})
...
Second, multi-host support in alarms is finally working. You can use full-path names in attribute names and also can include the tango host in FIND(…) wildcard searches. See screenshot for an example of the syntax.
TEST_ALARM = any([t > 20
for t in FIND(controls02:10000/bl00/ct/eps-plc-01/*pt)])
To enjoy these updates you’ll need the latest sources from sourceforge:
Regards,
Sergi
Hello Sergi
I have updated the fandango,pyalarm and panic module.
When I try to run the below syntax in PC1 :
any([t>10 for t in FIND(01hw341680:10000/l/m/n/Speed)])
it works fine as 01hw341680 is host name of PC1 and L/m/n/Speed device server and attribute of PC1.
Now When I try to run the same syntax from PC2,I am encountering following error
Test/alarms/1: Type error evaluate() got an unexpected argument device.
P.S. Both Pcs are connected one to one and both have different IP address.
Thanks and Regards
TCS-GMRT TEAM
On 01/26/2016 05:21 AM, B Chitalia/TVM/TCS wrote:
Hello Sergi
The SNAP tool (as well as the java-based archivers) does not support
archiving attributes from another Tango hosts. I put Raphael Girardot
(SOLEIL) in copy to know if there’s any trick to solve that. If there’s
any solution to this problem I’d be happy to apply it.Is there any way to log the alarm when it becomes active. Because the scenario is we are developing a Taurus-GUI in which at there is a section in which we display alarm related messages. So for localhost, it used to log the alarm in snap database and we used to retrieve the info from database and show it in our GUI.For the multiple host alarm detection, it is detecting the alarm but not logging in snap database so is there any other way from where we can read the info(like if logging possible in file, if not db) when alarm becomes active and show it in our taurus gui.
Please suggest the same as it is one of our important requirements.Thanks and Regards
Balkrishna Chitalia