Thank you very much Kay!
El 17/01/2019 a las 15:32, Kasemir, Kay
escribió:
> I'm sorry but it's not very clear to me what you
mean with "Monitor the .VAL for
alarm state changes STAT and SEVR values are part of that
metadata (...)".
He means request
DBR_STS_xxx, so you get the dbr_sts_xxx data
type.
Change your program to replace DBR_DOUBLE with
DBR_STS_DOUBLE,
replace
double data;
with
struct dbr_sts_double data;
Read db_access.h to see what that struct looks like, you'll
find the value, alarm status and severity.
-Kay
Please, I would really appreciate it if you could show me
using my provided sample code.
Thank you very much!
El 17/01/2019 a las 15:00,
bob dalesio escribió:
In Channel Access, request get the
DBR_CTRL_DBL. The menu is part of the metadata. Monitor
the .VAL for alarm state changes STAT and SEVR values
are part of that metadata. In pvAccess, alarm strings
are supported. Records and drivers are not yet taking
advantage of that.
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 data;
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:
-
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)?
-
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.
--
Raquel Pérez Lázaro
System Engineer
[email protected]
TTI
Infrastructures
M&C Department
C/Isla del Hierro, 7 oficina 3.1
28703 San Sebastian de los Reyes,
Madrid (Spain)
Telf +34 917 56 91 7
Ext. 303
www.ttinorte.es
|
--
Raquel Pérez Lázaro
System Engineer
[email protected]
TTI
Infrastructures M&C
Department
C/Isla del Hierro, 7 oficina 3.1
28703 San Sebastian de los Reyes, Madrid
(Spain)
Telf +34 917 56 91 7 Ext.
303
www.ttinorte.es
|
|