_alert_hdl problems

Find and share HowTos to various installations / configurations!
3 posts • Page 1 of 1
vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

_alert_hdl problems

Post by vedadramovic »

Hello,
in our SCADA solution we have integrated video detection and video surveillance. Video detection detects cases and informs SCADA which sets video from that video source to some of Alarm monitors over video survelilance system.
In some cases - for example in case of pedestrian - video detection is constantly sending alarm and clearing it (that is the way it work).
For SCADA it is as if alert comes and goes on and on as long as pedestrian is in sight of camera.
We set alert on cameras so as alarm is there as long as there is no alert and it is acknowledged.
What I wanted to make is to send video to alarm monitor only once until it is acknowledged.
So i used
alertConnect("cb_function", ":_alert_hdl.._visible");
and expected it to notify me only when _visible parameter changes

the problems are:
1. this function notifies me every time DP value changes no meter if it was acknowledged or not ( no meter if visible value changed or not)
2. when alarm from camera goes from false to true this function notifies me as if there where 3 changes not 1
(it sends:
System1:K2.Pedestrian:alert_hdl.._visible = false
System1:K2.Pedestrian:alert_hdl.._visible = false
System1:K2.Pedestrian:alert_hdl.._visible = true

all in the same millisecond.

Is there a way to prevent this?

To prevent this I tried to get more info from _alert_hdl for this DP, so I can know if this change of _visible is false, but no luck.
I tried to get with dpGet() following atributes:
_visible, _ack_state, _ack_time, _came_time, _gone_time
but non of them returned any value.
Using getLastError(), i get:
The attribute does not exist in this config, DP: System1:K2.Pedestrian:_alert_hdl.._visible, MAN: ( SYS: 1 Ctrl -num 12 CONN: 1)

Please help me solve this issue.
Vedad

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: _alert_hdl problems

Post by Gertjan van Schijndel »

It could be that also get updates of the older alerts (partner and went).

You could try to use a dpQueryConnectSingle with a SELECT ALERT query and specify a filter to get only the alerts you want. I guess that you only want came alerts without a partner.

vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

Re: _alert_hdl problems

Post by vedadramovic »

I need to know when the alert goes along with its confirmation - actually I need to know when attribute _visible changes.
I managed to get some info from attributes. So it should help me make the decision if the alert visibility change was false.
I will let you know if this worked.
Regards,
Vedad

3 posts • Page 1 of 1