alarm add_value
Search
alarm add_value
Alarm banner filtering can work on things like Short Sign and data type, none of which are runtime changeable. I found that you can filter on the "add_value" parts of an alarm instance. SO, it seems that you can script a change to one or more of the additional values that the banner can filter.
The documentation says that you can use only the alertSet() command. I have scripted it as it describes in the help, but the help is for ACK. I looked at other scripts in 3.18 ETM code, and I cannot find exactly how they script the add_value properties?
I have tried writing to the :_alert_hdl.?._add_value_20. The example code shows it always to a .?. number based on the alarm instance. That seems to work, but if you go back and try to update the value, the alertSet always reports setting/modifying attributes failed.
So, for the community... have any of you used these add_value attributes? Do you write to the :_alert_hdl.?._add_value_20 or the :_alert_hdl.._add_value_20 ??? I really need this feature to work, but I cannot seem to find a reliable way to update this.
Todd Malone
Trident Maritime Systems, LLC
The documentation says that you can use only the alertSet() command. I have scripted it as it describes in the help, but the help is for ACK. I looked at other scripts in 3.18 ETM code, and I cannot find exactly how they script the add_value properties?
I have tried writing to the :_alert_hdl.?._add_value_20. The example code shows it always to a .?. number based on the alarm instance. That seems to work, but if you go back and try to update the value, the alertSet always reports setting/modifying attributes failed.
So, for the community... have any of you used these add_value attributes? Do you write to the :_alert_hdl.?._add_value_20 or the :_alert_hdl.._add_value_20 ??? I really need this feature to work, but I cannot seem to find a reliable way to update this.
Todd Malone
Trident Maritime Systems, LLC
Re: alarm add_value
After some other research, I found in the help->system management->reports->SQL Query->Queries a reference the add_value
"SELECT ALERT '_alert_hdl.._add_value_5' FROM 'myAlarm.' WHERE '_alert_hdl.._add_value_5' == 1"
I guess this says that like the .._comment, that it is at the "root" of the alert instance.
Can anyone confirm this?
"SELECT ALERT '_alert_hdl.._add_value_5' FROM 'myAlarm.' WHERE '_alert_hdl.._add_value_5' == 1"
I guess this says that like the .._comment, that it is at the "root" of the alert instance.
Can anyone confirm this?
-
- Posts: 373
- Joined: Tue Jan 15, 2019 3:12 pm
Re: alarm add_value
Write should be done with the detail number from the atime of the alert.
Alert queries are always done without detail number.
Alert queries are always done without detail number.
Re: alarm add_value
I now have tried both ways. I have worked with other configs that are very picky about the number .?. like scaling. There is, without doubt, a difference in how they are handled, .. vs. .1. is different.
I will try to create a test screen and submit to ETM.
Todd
I will try to create a test screen and submit to ETM.
Todd
Re: alarm add_value
If you want to write a value to one of the _add_value attributes by using alertSet() you have to know exactly
-- The time of the alert
-- The count for the alert
-- The DP element for the alert
This information you can get with a dpQuery(). A dpQuery returns information as a variable type aTime. From the aTime you can get information by using the functions getAIdentifier() and getATime().
Best Regards
Leopold Knipp
Senior Support Specialist
-- The time of the alert
-- The count for the alert
-- The DP element for the alert
This information you can get with a dpQuery(). A dpQuery returns information as a variable type aTime. From the aTime you can get information by using the functions getAIdentifier() and getATime().
Best Regards
Leopold Knipp
Senior Support Specialist
Re: alarm add_value
SOLVED.
If you change an add_value on an alert after the initial alarm, it changes the timestamp of the _online.._stime and _origional.._stime. If you try to change the _add_value later, the time will be wrong. Then, if you follow the help for alertSet():
dpGet(dpe+":_online.._stime", t);
At = makeATime(t, 0, dpe);
This time will NOT the time of the alert and the set update of _add_value will fail.
The correct way to get the time of the alert:
dpGet(sDPE + ":_alert_hdl.._act_state", iAlertState);
if(iAlertState != DPATTR_ALERTSTATE_NONE)
{
dpQuery("SELECT ALERT '_alert_hdl.._came_time' from '"+sDPE+"'", dda)
tCameTime = dda[2][3];
}
now you have a TIME type variable you can use to pass to
At = makeATime(tCameTime , 0, sDPE);
This will work for non-multi-instance alarms.
Code for multi-instance alarms is found here.
(help->PARA->data point configs, basics->alert handling, basics->Examples of alert handling).
If you change an add_value on an alert after the initial alarm, it changes the timestamp of the _online.._stime and _origional.._stime. If you try to change the _add_value later, the time will be wrong. Then, if you follow the help for alertSet():
dpGet(dpe+":_online.._stime", t);
At = makeATime(t, 0, dpe);
This time will NOT the time of the alert and the set update of _add_value will fail.
The correct way to get the time of the alert:
dpGet(sDPE + ":_alert_hdl.._act_state", iAlertState);
if(iAlertState != DPATTR_ALERTSTATE_NONE)
{
dpQuery("SELECT ALERT '_alert_hdl.._came_time' from '"+sDPE+"'", dda)
tCameTime = dda[2][3];
}
now you have a TIME type variable you can use to pass to
At = makeATime(tCameTime , 0, sDPE);
This will work for non-multi-instance alarms.
Code for multi-instance alarms is found here.
(help->PARA->data point configs, basics->alert handling, basics->Examples of alert handling).
Re: alarm add_value
Dear Leo,
Thanks for your insight, but it is not enough information. The help is lacking these examples.
"This information you can get with a dpQuery(). A dpQuery returns information as a variable type aTime. From the aTime you can get information by using the functions getAIdentifier() and getATime()."
All dpQuery return aTime types? maybe I need an example
I cannot search for or find getATime().
Why do I need the AIdentifier?
Can you give me a clue as to why you suggest a dpQuery but there are no examples for the elements you suggest time, count, element?
I really have spent days trying to understand this for both regular alerts and multi-instance alerts. The limitation of the alert banner filter to only add_values makes this feature critical to my efforts.
Todd
Thanks for your insight, but it is not enough information. The help is lacking these examples.
"This information you can get with a dpQuery(). A dpQuery returns information as a variable type aTime. From the aTime you can get information by using the functions getAIdentifier() and getATime()."
All dpQuery return aTime types? maybe I need an example
I cannot search for or find getATime().
Why do I need the AIdentifier?
Can you give me a clue as to why you suggest a dpQuery but there are no examples for the elements you suggest time, count, element?
I really have spent days trying to understand this for both regular alerts and multi-instance alerts. The limitation of the alert banner filter to only add_values makes this feature critical to my efforts.
Todd
Re: alarm add_value
Follow on question.
I am writing to the _alert_hdl.._add_values using the alertSetWait function. My add_value_20 that I set does not stay like those set by the S7Plus driver? As the alarm changes from CAME to WENT and other changes like ACK, the add_value_20 value that I set is back to "" blank.
How can I set the add_value_20 so that it stays set for that instance of the alert like the values set by the driver initally?
Todd
I am writing to the _alert_hdl.._add_values using the alertSetWait function. My add_value_20 that I set does not stay like those set by the S7Plus driver? As the alarm changes from CAME to WENT and other changes like ACK, the add_value_20 value that I set is back to "" blank.
How can I set the add_value_20 so that it stays set for that instance of the alert like the values set by the driver initally?
Todd
Re: alarm add_value
Hey Todd,
As far as I know, you need to carry by script the add_values when the alarm status change. You can use a dedicated script for this or put it in the alert class scripts.
Alex
As far as I know, you need to carry by script the add_values when the alarm status change. You can use a dedicated script for this or put it in the alert class scripts.
Alex
Re: alarm add_value
Alex,
Do we think that the driver also updates the add_values when the status changes? Or does the driver always set the add_values for each update from the driver?
multi-instance alarms are not easy to use at all.
Todd
Do we think that the driver also updates the add_values when the status changes? Or does the driver always set the add_values for each update from the driver?
multi-instance alarms are not easy to use at all.
Todd