EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How can I get the severity fields values for a limit alarm?
From: "Kasemir, Kay via Tech-talk" <[email protected]>
To: rperez <[email protected]>
Cc: techtalk <[email protected]>
Date: Thu, 17 Jan 2019 14:17:12 +0000

Hi:


> I am developing a CA client program in C and I need to handle the severity value for the alarm limits (HIHI, HIGH, LOW, LOLO). This is, the value of HHSV, HSV, LSV and LLSV fields.


Note that there's a difference between what you see via channel access, and records.

If you are developing a CA client program, you're best doing just that, because there may not be any records.

From the CA client perspective, you get the DBR_STS_xxx data type which will provide you with the value, alarm status and severity.
If the channel is associated with a record, specifically an analog record, then yes, a MAJOR alarm could indicate that VAL >= HIHI and HHSV = MAJOR.

In that case, you could try to read name_of_record.HIHI, but the channel could also be served by PCASPY or some other CAS-based server, and in that case there is no record, and nobody will respond to a read request for name_of_record.HIHI. Same with HHSV.

From the CA client perspective, you instead need to get the DBR_CTRL_xxx data type which has the alarm threshold values.

-Kay


From: [email protected] <[email protected]> on behalf of rperez via Tech-talk <[email protected]>
Sent: Thursday, January 17, 2019 7:55 AM
To: [email protected]
Subject: How can I get the severity fields values for a limit alarm?
 

Hello,

I am developing a CA client program in C and I need to handle the severity value for the alarm limits (HIHI, HIGH, LOW, LOLO). This is, the value of HHSV, HSV, LSV and LLSV fields.

To do this, I am executing the following code:

    struct dbr_ctrl_double    tPvData;
    double d
ata;
    chid    mychid;

    SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create");
    SEVCHK(ca_create_channel("PC:MEM_USED",NULL,NULL,10,&mychid),"ca_create_channel failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");

    SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&tPvData),"ca_get failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");

     printf("PV Name %s :\n \talarm status: %d\n \talarm severity: %d\n \tvalue: %f\n \tunits: %s\n \talarm limits: [%d-%d]\n \twarning limits: [%d-%d]\n",
                               "PC:MEM_USED",  tPvData.status, tPvData.severity, tPvData.value, data.units,
                                tPvData.lower_alarm_limit, tPvData.upper_alarm_limit,
                                tPvData.lower_warning_limit, tPvData.upper_warning_limit);

    SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&data),"ca_get failure");
   
SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    printf("
PV Name %s=%f\n","PC:MEM_USED", data);

    return(0);

As result I get the following PV's data, even the alarm (HIHI, LOLO) and warning (HI, LO) limits.

PV Name PC:MEM_USED  :
     alarm status: 3
     alarm severity: 2
     value: 100.000000
     units: %
     alarm limits: [nan-95.000000]
     warning limits: [nan-85.000000]

     PV Name PC:MEM_USED =100.000000

But to get the HHSV, HSV, LSV and LLSV fields, I am doing the following:

    SEVCHK(ca_create_channel("PC:MEM_USED.HHSV",NULL,NULL,10,&mychid),"ca_create_channel failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&data),"ca_get failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    printf("%s= %f\n","PC:MEM_USED.HHSV",data);

    SEVCHK(ca_create_channel("PC:MEM_USED.HSV",NULL,NULL,10,&mychid),"ca_create_channel failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&data),"ca_get failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    printf("%s= %f\n","PC:MEM_USED.HSV",data);

    SEVCHK(ca_create_channel("PC:MEM_USED.LLSV",NULL,NULL,10,&mychid),"ca_create_channel failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&data),"ca_get failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    printf("%s= %f\n","PC:MEM_USED.LLSV",data);

    SEVCHK(ca_create_channel("PC:MEM_USED.LSV",NULL,NULL,10,&mychid),"ca_create_channel failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&data),"ca_get failure");
    SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
    printf("%s=%f\n","PC:MEM_USED.LSV",data);

As result, I am getting this:

     "PC:MEM_USED.HHSV=2.000000" which means severity for a Hihi alarm is MAJOR

     "PC:MEM_USED.HSV=1.000000" which means severity for a Hi alarm is MINOR

     "PC:MEM_USED.LLSV=0.000000" which means severity for a Lolo alarm is NO_ALARM

     "PC:MEM_USED.LSV=0.000000" which means severity for a Lo alarm is NO_ALARM


Taking this into account, I have the following doubts:

  1. Is the value of the alarm severity  filed = 2 (MAJOR ) derived from this HHSV alarm severity limit field?  or is it only a coincidence that the value of the alarm severity is also 2 (MAJOR)? If so, what is the difference between the alarm severity field and the severity for a Hihi alarm field (HHSV)?

  2. Is this the correct way ( this is executing ca_get (PC:MEM_USED.HHSV), etc...) to obtain these HHSV, HSV, LLSV and LSV values?  Is there any other simpler way?


Thank you very much in advance.


References:
How can I get the severity fields values for a limit alarm? rperez via Tech-talk

Navigate by Date:
Prev: Re: How can I get the severity fields values for a limit alarm? bob dalesio via Tech-talk
Next: Re: How can I get the severity fields values for a limit alarm? rperez via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: How can I get the severity fields values for a limit alarm? rperez via Tech-talk
Next: File format for files in SynAps:calc module Jörn Dreyer via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 17 Jan 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·