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: Get notified of alarms internally to IOC w/o requiring record fields
From: David Bracey via Tech-talk <[email protected]>
To: "[email protected]" <[email protected]>
Date: Tue, 25 Nov 2025 15:06:01 +0000

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

 


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

Navigate by Date:
Prev: Re: Manta G-235B Camera Steven Hunt via Tech-talk
Next: Re: Modbus-TCP "authorization" Виталий Балакин 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: Manta G-235B Camera Steven Hunt via Tech-talk
Next: Re: Get notified of alarms internally to IOC w/o requiring record fields David Bracey 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 ·