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

Subject: Re: ca_search() and "preemptive callback"
From: Michael Westfall <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: "[email protected] Talk" <[email protected]>
Date: Thu, 5 Jan 2017 17:46:31 -0300
Thanks, Andrew.

That looks like the way to go here.

On Thu, Jan 5, 2017 at 5:27 PM, Andrew Johnson <[email protected]> wrote:
Hi again Mike,

If it only needs to access local channels and isn't trying to use
monitors this code would probably be better off using the dbAccess
interface instead of going through CA. I suggest studying the code in
base/src/db/dbTest.c for dbgf() and dbpf() to see how to use the APIs
dbNameToAddr(), dbGetField() and dbPutField(). These are documented in
the Application Developers Guide, section 15.4 available online at
> http://www.aps.anl.gov/epics/base/R3-14/12-docs/AppDevGuide/node16.html#SECTION001640000000000000000

One thing to be aware of, the DBR_xxx types supported by dbAccess are
*completely* different to and incompatible with the DBR_xxx types
provided by CA, so you cannot mix the two interfaces (or include both
sets of header files) in the same C source file, you have to change the
code all in one jump.

HTH,

- Andrew


On 01/05/2017 01:11 PM, Michael Westfall wrote:
> It's in the main thread in a function that's called from the startup
> script after iocinit().
>
> As far as I can tell, the purpose is to get channel IDs of some local
> database channels in order to get and put values to them.
>
> I don't doubt that there is a different and better way to do this
> now-a-days... And maybe there was way back when this was originally
> implemented too. Who knows why things were done the way they were back
> in the primordial days..
>
>
> On Thu, Jan 5, 2017 at 3:53 PM, Andrew Johnson <[email protected]
> <mailto:[email protected]>> wrote:
>
>     Hi Mike,
>
>     On 01/05/2017 12:33 PM, Michael Westfall wrote:
>     > We are converting our legacy systems from EPICS 3.13/vxWorks to EPICS
>     > 3.14/RTEMS,
>     >
>     > I have an IOC that calls
>     > *SEVCHK( ca_search(buf, &id), "ca_search failed\n");*
>
>     Where is this code? What thread is going to execute it?
>
>     I suspect you're going to have to rewrite some of that subsystem, but
>     we'll need rather more information about what it's trying to do to be
>     able to give you much help.
>
>     - Andrew
>
>     > but it results in the following error:
>     > *dbContext: preemptive callback required for direct in
>     > memory interfacing of CA channels to the DB.
>     > CA.Client.Exception...............................................
>     >     Warning: "Not supported by attached service"
>     >     Context: "ca_search failed
>     > "
>     >     Source File: ../caLogDataDriver.c line 119
>     >     Current Time: Thu Jan 05 2017 18:02:41.367850828*
>     >
>     > OK, so I insert this first:
>     > *SEVCHK(ca_context_create(ca_enable_preemptive_callback),
>     > "caInitLogSetup() calling ca_context_create()");*
>     >
>     > But now I get this
>     > *CA.Client.Exception...............................................
>     >     Error: "Preemptive callback not enabled - additional threads may not
>     > join context"
>     >     Context: "caInitLogSetup() calling ca_context_create()"
>     >     Source File: ../caLogDataDriver.c line 106
>     >     Current Time: Thu Jan 05 2017 17:41:58.248806684
>     >
>     > *
>     > *
>     > *
>     > What am I missing? Do I need to supply a callback function first? The
>     > Channel Access documentation seems a bit sparse in this regard...
>     >
>     > --
>     > Mike Westfall
>     > Control Systems Software Engineer
>     >
>     >
>
>     --
>     Arguing for surveillance because you have nothing to hide is no
>     different than making the claim, "I don't care about freedom of
>     speech because I have nothing to say." -- Edward Snowdon
>
>
>
>
> --
> Mike Westfall
> Control Systems Software Engineer
>
>

--
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon



--
Mike Westfall
Control Systems Software Engineer



References:
ca_search() and "preemptive callback" Michael Westfall
Re: ca_search() and "preemptive callback" Andrew Johnson
Re: ca_search() and "preemptive callback" Michael Westfall
Re: ca_search() and "preemptive callback" Andrew Johnson

Navigate by Date:
Prev: Re: ca_search() and "preemptive callback" Andrew Johnson
Next: RE: ca_search() and "preemptive callback" Mooney, Tim M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: ca_search() and "preemptive callback" Andrew Johnson
Next: RE: ca_search() and "preemptive callback" Mooney, Tim M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·