Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
10 posts • Page 1 of 1
10 posts
• Page 1 of 1
dbindernagel
Posts:161
Joined: Mon Feb 23, 2015 1:34 pm
alertSet for add_value_1 not working
Postby dbindernagel »
I have a script which should add a value to the _alert_hdl.._add_value_1 for every alarm (sieh working example below).
This works fine when the _alert_hdl config is on a bool. If the config is on a integer dpe (continuous) then I get the following error message.
I ran into the exact same problem yesterday. I will look at it early next week and will post a solution (assuming that I find one)
My first assumption is that you need to do something like:
string strAddValueDPE = dpSubStr(strAlert, DPSUB_DP_EL) + ":_alert_hdl.1._add_value_1"; OR
string strAddValueDPE = dpSubStr(strAlert, DPSUB_DP_EL) + ":_alert_hdl.2._add_value_1"; OR
string strAddValueDPE = dpSubStr(strAlert, DPSUB_DP_EL) + ":_alert_hdl.3._add_value_1";
Will let you know
An analog alarm has multiple ranges (1, 2, 3, ...). I assume that we need to specify the range. In an analog alarm, multiple alarms can be active. In a Boolean there is just one
at the example I've seen that you are using the CTRL function alertConnect() to get a hotlink when an alert is raised.
If you want to get the information when alert has changed it's state it is recommended to use the function dpQueryConnectSingle() with a query statement using "SELECT ALERT ...".
At the query statement you can exactly specfiy when the work function shall be called (FROM-clause, WHERE-condition).
Which type information shall be written to _add_value_1?
Is it always the same (static) information?
If the information is static (more or less) please try to find another solution.
When a high load situation occurs (a lot of a value changes and alerts in a short time) a script which modifies every alert will cause additional load.
Best Regards
Leopold Knipp
Senior Support Specialist
The solution from Gertjan van Schijndel works perfectly. Thanks alot.
I can now see why my previous approach could not work because I did not consider the alarm range.
Instead of:
SystemTest:AlarmTest1.AlarmInt:_alert_hdl.._add_value_1
the correct value should be (for this specific range):
SystemTest:AlarmTest1.AlarmInt:_alert_hdl.2._add_value_1
@Leopold Knipp:
The information is different for every alarm.
Right now I'm modifying a existing script from my customer which is using "alertConnect". I will look into this if we can improve the current script.
Thanks for the info.
I am using the following script to add a text “Service” at _add_value_10. I am checking the status of bit “.internal.Service_Mode:_original.._value == 1” and if is TRUE am adding this text to the _add_value_10 attribute. This script works for me only to the alerts with ‘Alert handling’ Power config . I want also to use this script for adding value to alerts with ‘Alert handling 5 ranges’ Power config but it doesn’t work. Is there any solution for that.
How can i define in WHERE clause the datapoint type;;
In my case I want to check if the bit '.internal.Service_Mode:_original.._value' (datatype bool) is true . I have noticed that when I trigger an alert of type bool this script works perfect but when I trigger an alert of type Float (5 ranges alert handling) it doesn’t work.
With the '_DPT' keyword a datapoint type can be defined in a query. This and other keywords can be found in the online help under: System management -> Reporting -> SQL -> Basics SQL in Control
there is no difference if an _alert_hdl config was added using power configs or not.
The power config functionality also only adds configs to a datapoint element.
Please note that using configs different to the _alert_hdl config in a query using SELECT ALERT is not the correct approach. Depending on the version you are using also an error is reported when such queries are executed.
If the _add_value shall only be set for an alert configured at ".internal.Service_Mode" the DPE name needs to be defined at the FROM clause.
Best Regards
Leopold Knipp
Senior Support Specialist