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  <20132014  2015  2016  2017  2018  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: ca_get and ca_put triggered by monitors?
From: "Hill, Jeff" <[email protected]>
To: Dirk Zimoch <[email protected]>, EPICS <[email protected]>
Date: Thu, 27 Jun 2013 14:36:59 +0000
Hi Dirk,

> The naive way would
> be to do ca_get and/or ca_put inside a monitor callback function. But as
> far as I remember, this is forbidden.

Most of the CA functions can be called from within a callback, The regression 
tests verify that it is possible to even destroy a channel from within a callback.

I wouldn't make sense however to call a  blocking ca function such as 
ca_pend_xx from within a callback. 

Since ca_get is used typically as follows, with a final blocking ca_pend_io call 
for completion synchronization, then the ca_get sans callback can't 
be recommended for use within a callback, but ca_get_callback would work 
fine and _is_ recommended for use in a callback. 

ca_get
ca_get
ca_get
ca_get
ca_get
ca_pend_io

All of the variants of ca_put should be suitable for use in a callback.

Jeff

> -----Original Message-----
> From: [email protected] [mailto:tech-talk-
> [email protected]] On Behalf Of Dirk Zimoch
> Sent: Thursday, June 27, 2013 7:16 AM
> To: EPICS
> Subject: ca_get and ca_put triggered by monitors?
> 
> Hi all,
> 
> I have an application which needs to read or write EPICS data whenever
> something interesting happens with other EPICS data. The naive way would
> be to do ca_get and/or ca_put inside a monitor callback function. But as
> far as I remember, this is forbidden.
> 
> Is this (still) true? I cannot find anything about this in the Channel
> Access Reference Manual.
> 
> If it is not (yet) possible, can this be implemented in a future release
> of the channel access library? I think it is a common use case to "do
> something when something else happened".
> 
> What is the best practice to do monitor triggered channel access at the
> moment?
> 
> One way I can imagine is to setup a different thread blocking on an
> event semaphore and release that semaphore from within the monitor
> callback. But this involves thread save programming with all its
> complications.
> 
> 
> Dirk


References:
ca_get and ca_put triggered by monitors? Dirk Zimoch

Navigate by Date:
Prev: Re: caget can't connect to soft ioc on host with multiple NICs Brian McAllister
Next: caget apparent timeout D Peter Siddons
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: ca_get and ca_put triggered by monitors? J. Lewis Muir
Next: caget apparent timeout D Peter Siddons
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·