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  2019  2020  2021  2022  2023  2024  <20252026  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  2019  2020  2021  2022  2023  2024  <20252026 
<== Date ==> <== Thread ==>

Subject: Re: Get notified of alarms internally to IOC w/o requiring record fields
From: "Johnson, Andrew N. via Tech-talk" <[email protected]>
To: David Bracey <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 25 Nov 2025 18:30:54 +0000
Hi David,

Could you send us a (much) higher-level description of what you’re trying to accomplish with this work?

The code you show below is making use of APIs that as a Core developer I consider to be largely internal to the IOC and not intended for applications to call. That means we might make changes to these routines in future EPICS releases that could cause your code to no longer compile. It’s very unusual to be doing the kind of things that you are looking to do here, and that's a red flag to me — you might not know if/how the EPICS community already has solutions to the problem that you’re trying to solve. If you would let us know what that high-level problem is we might be able to point you in a different direction that doesn’t need as much code to be written.

In general, most normal EPICS applications don’t need the kinds of code that you’ve been asking about recently. I’m not trying to dissuade you from looking at our internals or implementing something useful that EPICS can’t currently do, but "trying to get notified of alarm states changing on PV’s without link fields or user events” isn’t a common EPICS IOC-centric thing.

- Andrew


-- 

Complexity comes for free, Simplicity you have to work for.


On 11/25/25, 11:03 AM, "Tech-talk" <[email protected]> wrote:

Needed:

 

    auto dse = db_start_events(pctx, 0, 0, 0, epicsThreadPriorityCAServerLow);

 

 

From: David Bracey <[email protected]>
Date: Tuesday, November 25, 2025 at 9:06
AM
To: [email protected] <[email protected]>
Subject: Get notified of alarms internally to IOC w/o requiring record fields

I am messing around with some ideas, and I am trying to get notified of alarm states changing on PV’s without link fields or user events – basically without putting any requirements on PV’s or DB records.

 

I tried some code that intends to set a callback for the DBE_ALARM event, but I don’t seem to get called.  The code looks like this:

 

void my_event_func(void *user_arg, struct dbChannel *chan,

    int eventsRemaining, struct db_field_log *pfl)

{

    errlogPrintf("my_event_func\n");

}

 

int main(int argc,char *argv[])

{

    if(argc>=2) {

        iocsh(argv[1]);

        epicsThreadSleep(.2);

    }

 

    auto pctx = db_init_events();

    errlogPrintf("pctx %p\n", pctx);

 

    auto pchn = dbChannelCreate("SOME_");

    errlogPrintf("pchn %p %s\n", pchn, pchn ? pchn->name : "");

 

    auto psub = db_add_event(pctx, pchn, my_event_func, 0, DBE_ALARM);

    errlogPrintf("psub %p\n", psub);

 

    db_event_enable(psub);

 

    iocsh(NULL);

    epicsExit(0);

    return(0);

}

 

Does this seem feasible at all?

 

  • Dave Bracey, Fermilab AD

 


References:
Get notified of alarms internally to IOC w/o requiring record fields David Bracey via Tech-talk
Re: Get notified of alarms internally to IOC w/o requiring record fields David Bracey via Tech-talk

Navigate by Date:
Prev: Re: Get notified of alarms internally to IOC w/o requiring record fields Michael Davidsaver via Tech-talk
Next: Re: Alarm stuck in "Async in progress" even after record processing is fine Jure Varlec 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  2019  2020  2021  2022  2023  2024  <20252026 
Navigate by Thread:
Prev: Re: Get notified of alarms internally to IOC w/o requiring record fields Michael Davidsaver via Tech-talk
Next: Asyn record CNCT field does not update Abdalla Ahmad 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  2019  2020  2021  2022  2023  2024  <20252026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·