From b1556bd8717a8efac77aacc3760e58b1fb622dbb Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 2 Apr 2009 15:51:30 +0000 Subject: [PATCH] New DBE_PROPERTY event type and support in catools and mbbi/mbbo records --- documentation/RELEASE_NOTES.html | 17 +++++++++++++++++ src/ca/CAref.html | 16 ++++++++++------ src/ca/caeventmask.h | 15 +++++++++++---- src/catools/camonitor.c | 13 +++++++------ src/rec/mbbiRecord.c | 8 ++++++-- src/rec/mbboRecord.c | 6 +++++- 6 files changed, 56 insertions(+), 19 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index d74aae675..b341d7e98 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -12,6 +12,23 @@

Changes between 3.14.10 and 3.14.11

+

New event type DBE_PROPERTY

+ +

A new event type (flag in the Channel Access event mask) has been added +to support subscriptions that get events whenever a property of the PV +changes. This will allow clients to get notified on changes of control +limits, graphical limits, state strings etc.

+ +

The CA commandline tool camonitor and the CA Perl interface support +the new event type. +As a first working example, the mbbi and mbbo records have been extended +to send a DBE_PROPERTY event when their status strings are updated. +A more general mechanism to specify sending DBE_PROPERTY events through +the DBD file will appear in 3.15.

+ +

Application developers are encouraged to start using DBE_PROPERTY +subscriptions.

+

PINI Processing Phases

The PHAS field now controls the order in which records with PINI set are diff --git a/src/ca/CAref.html b/src/ca/CAref.html index ca4ac68af..cd822edf6 100644 --- a/src/ca/CAref.html +++ b/src/ca/CAref.html @@ -12,6 +12,7 @@ background-color: #ddf; --> + @@ -32,11 +33,13 @@ Laboratory, SNS Division

Helmholtz-Zentrum Berlin (BESSY II)

-

Copyright © 2002 -The University of Chicago, as Operator of Argonne National Laboratory.
+

Copyright © 2009 +Helmholtz-Zentrum Berlin für Materialien und Energie GmbH.
+Copyright © 2002 The University of Chicago, as Operator of Argonne National +Laboratory.
Copyright © 2002 The Regents of the University of California, as Operator of Los Alamos National Laboratory.
-Copyright © 2002 Helmholtz-Zentrum Berlin für Materialien und Energie +Copyright © 2002 Berliner Speicherringgesellschaft für Synchrotronstrahlung GmbH.

EPICS BASE @@ -2864,10 +2867,11 @@ least

For functions above that do not include a trigger specification, events will be triggered when there are significant changes in the diff --git a/src/ca/caeventmask.h b/src/ca/caeventmask.h index 871193135..9b7c2d31d 100644 --- a/src/ca/caeventmask.h +++ b/src/ca/caeventmask.h @@ -22,16 +22,23 @@ Trigger an event when a significant change in the channel's value occurs. Relies on the monitor deadband field under DCT. - DBE_LOG + DBE_ARCHIVE (DBE_LOG) Trigger an event when an archive significant change in the channel's valuue occurs. Relies on the archiver monitor deadband field under DCT. DBE_ALARM Trigger an event when the alarm state changes + DBE_PROPERTY + Trigger an event when a property change (control limit, graphical + limit, status string, enum string ...) occurs. + */ -#define DBE_VALUE (1<<0) -#define DBE_LOG (1<<1) -#define DBE_ALARM (1<<2) + +#define DBE_VALUE (1<<0) +#define DBE_ARCHIVE (1<<1) +#define DBE_LOG DBE_ARCHIVE +#define DBE_ALARM (1<<2) +#define DBE_PROPERTY (1<<3) #endif diff --git a/src/catools/camonitor.c b/src/catools/camonitor.c index 24f00e138..62bec59fc 100644 --- a/src/catools/camonitor.c +++ b/src/catools/camonitor.c @@ -50,7 +50,7 @@ void usage (void) "Channel Access options:\n" " -w : Wait time, specifies CA timeout, default is %f second(s)\n" " -m : Specify CA event mask to use, with being any combination of\n" - " 'v' (value), 'a' (alarm), 'l' (log). Default: va\n" + " 'v' (value), 'a' (alarm), 'l' (log/archive), 'p' (property). Default: va\n" " -p : CA priority (0-%u, default 0=lowest)\n" "Timestamps:\n" " Default: Print absolute timestamps (as reported by CA server)\n" @@ -278,11 +278,12 @@ int main (int argc, char *argv[]) case 'v': eventMask |= DBE_VALUE; break; case 'a': eventMask |= DBE_ALARM; break; case 'l': eventMask |= DBE_LOG; break; - default : - fprintf(stderr, "Invalid argument '%s' " - "for option '-m' - ignored.\n", optarg); - eventMask = DBE_VALUE | DBE_ALARM; - err = 1; + case 'p': eventMask |= DBE_PROPERTY; break; + default : + fprintf(stderr, "Invalid argument '%s' " + "for option '-m' - ignored.\n", optarg); + eventMask = DBE_VALUE | DBE_ALARM; + err = 1; } } break; diff --git a/src/rec/mbbiRecord.c b/src/rec/mbbiRecord.c index de357c455..9366c26f8 100644 --- a/src/rec/mbbiRecord.c +++ b/src/rec/mbbiRecord.c @@ -1,4 +1,5 @@ /*************************************************************************\ +* Copyright (c) 2009 Helmholtz-Zentrum Berlin fuer Materialien und Energie. * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as @@ -196,13 +197,16 @@ static long process(mbbiRecord *pmbbi) static long special(DBADDR *paddr,int after) { mbbiRecord *pmbbi = (mbbiRecord *)(paddr->precord); - int special_type = paddr->special; + int special_type = paddr->special; + int fieldIndex = dbGetFieldIndex(paddr); if(!after) return(0); switch(special_type) { case(SPC_MOD): init_common(pmbbi); - return(0); + if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST) + db_post_events(pmbbi,&pmbbi->val,DBE_PROPERTY); + return(0); default: recGblDbaddrError(S_db_badChoice,paddr,"mbbi: special"); return(S_db_badChoice); diff --git a/src/rec/mbboRecord.c b/src/rec/mbboRecord.c index 35172b0e2..df0763bd9 100644 --- a/src/rec/mbboRecord.c +++ b/src/rec/mbboRecord.c @@ -1,4 +1,5 @@ /*************************************************************************\ +* Copyright (c) 2009 Helmholtz-Zentrum Berlin fuer Materialien und Energie. * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as @@ -262,12 +263,15 @@ CONTINUE: static long special(DBADDR *paddr, int after) { mbboRecord *pmbbo = (mbboRecord *)(paddr->precord); - int special_type = paddr->special; + int special_type = paddr->special; + int fieldIndex = dbGetFieldIndex(paddr); if(!after) return(0); switch(special_type) { case(SPC_MOD): init_common(pmbbo); + if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST) + db_post_events(pmbbo,&pmbbo->val,DBE_PROPERTY); return(0); default: recGblDbaddrError(S_db_badChoice,paddr,"mbbo: special");