Alarm Limit Value Parameter

Find and share HowTos to various installations / configurations!
5 posts • Page 1 of 1
hakan
Posts:28
Joined: Wed Nov 24, 2010 9:38 am

Alarm Limit Value Parameter

Post by hakan »

Hi,
We have defined 5 range alarm handling.
How can be changed Alarm limit values and hysteresis values dynamically at runtime by the operator. Is it possible?.

Thank you

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Alarm Limit Value Parameter

Post by leoknipp »

You can write a script which modifies the values for the attributes by using dpSet()/dpSetWait().

The scripts has to
-- acknowledge all pending alerts for the given dp element
-- deactivate the _alert_hdl config
-- modify the attributes
-- activate the _alert_hdl config

Which attributes need to be modifed depends on the _alert_hdl config which shall be adapted.

Best Regards
Leopold Knipp
Senior Support Specialist

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: Alarm Limit Value Parameter

Post by adaneau »

Hi,

I would add a detail about hysteresis: this doesnt exist as attribute, actually this is just a tweak of l_limit and u_limit for each range ;)

BR
Alex

hakan
Posts:28
Joined: Wed Nov 24, 2010 9:38 am

Re: Alarm Limit Value Parameter

Post by hakan »

Ok. I developed script. I shared it. Maybe help someone

Code: Select all

main()
{
int rc;
dyn_errClass err;
 
float hh = 100.0; // from text field
float h = 90.0;// from text field
float l = 30.0;// from text field
float ll = 20.0;// from text field

float hyst = 2.0;// from text field

float a1_u_hyst =  ll;    
float a2_u_hyst =  l;    
float a2_l_hyst = ll+hyst; 
float a3_u_hyst =  h-hyst;    
float a3_l_hyst = l+hyst;
float a4_u_hyst =  hh-hyst;    
float a4_l_hyst = h;    
float a5_l_hyst = hh;

dpSetWait(dpPV+":_alert_hdl.._active", FALSE); //alert must be passive
dpSetWait(dpPV+":_alert_hdl.._ack", 1);//alert must be ack

rc = dpSetWait(
dpPV+":_alert_hdl.1._u_limit", ll,

dpPV+":_alert_hdl.2._u_limit", l,
dpPV+":_alert_hdl.2._l_limit", ll,

dpPV+":_alert_hdl.3._u_limit", h,
dpPV+":_alert_hdl.3._l_limit", l,

dpPV+":_alert_hdl.4._u_limit", hh,
dpPV+":_alert_hdl.4._l_limit", h,


dpPV+":_alert_hdl.5._l_limit", hh,

dpPV+":_alert_hdl.1._u_hyst_limit",a1_u_hyst,

dpPV+":_alert_hdl.2._l_hyst_limit",a2_l_hyst,
dpPV+":_alert_hdl.2._u_hyst_limit",a2_u_hyst,

dpPV+":_alert_hdl.3._l_hyst_limit",a3_l_hyst,
dpPV+":_alert_hdl.3._u_hyst_limit",a3_u_hyst,

dpPV+":_alert_hdl.4._l_hyst_limit",a4_l_hyst,
dpPV+":_alert_hdl.4._u_hyst_limit",a4_u_hyst,

dpPV+":_alert_hdl.5._l_hyst_limit",a5_l_hyst,

dpPV+":_alert_hdl.._active", TRUE);
 
if(rc == 0){
  
}
else{
    ChildPanelOnRelativModal("vision/MessageWarning", "Warning", makeDynString("Wrong Values. Check Parameters"),5,5); 
  
}



err = getLastError();
 
if(dynlen(err)>0)
{
throwError(err);
}
DebugN("done", rc);
}



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

Re: Alarm Limit Value Parameter

Post by Gertjan van Schijndel »

An acknowledge is not always needed. If it is not needed an error message will be written in the log file.
To prevent this you could replace the deactivation and acknowledge 'dpSet' with the function 'dpDeactivateAlert'.

5 posts • Page 1 of 1