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  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: RE: dynamic monitoring
From: "Jeff Hill" <johill@lanl.gov>
To: "'Patrick Thomas'" <thomas_p@ligo-wa.caltech.edu>, <tech-talk@aps.anl.gov>
Date: Fri, 21 Jan 2011 18:34:26 -0700
Hi Patrick,

The mechanism to start/stop a subscription is accessed via calls to
ca_create_subscription/ca_clear_susbscription. If you have a single threaded
application then you will need to start and stop the subscriptions from
within the main loop. Therefore, yes, that could be accomplished by calling
ca_pend_event with a finite timeout, deciding what subscriptions might be
needed, and calling ca_create_subscription/ca_clear_susbscription to start
stop the appropriate subscriptions - all of these actions in a loop. There
are of course many other, more complex, ways to schedule this including
changing to a preemptive callback mode application with multiple threads
(emphasis on complex) but of course a simple, minimal approach is often
just-a-fit for the design requirements.

Jeff
______________________________________________________
Jeffrey O. Hill           Email        johill@lanl.gov
LANL MS H820              Voice        505 665 1831
Los Alamos NM 87545 USA   FAX          505 665 5107

Message content: TSPA

With sufficient thrust, pigs fly just fine. However, this is
not necessarily a good idea. It is hard to be sure where they
are going to land, and it could be dangerous sitting under them
as they fly overhead. -- RFC 1925


> -----Original Message-----
> From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-
> bounces@aps.anl.gov] On Behalf Of Patrick Thomas
> Sent: Friday, January 21, 2011 6:01 PM
> To: tech-talk@aps.anl.gov
> Subject: dynamic monitoring
> 
> Hi,
> 
> I was wondering what the best way is to dynamically monitor channels in
> C. That is to start and stop monitoring channels at run time. I
> currently have a program that connects to and attaches monitors to a
> predefined list of channels and then goes into a ca_pend_event(0), which
> blocks forever. Should I change this to a loop and specify a certain
> time period, i.e. ca_pend_event(1) and add or remove channels in that
> loop?
> 
> Thank you for your time,
> Patrick



Replies:
Re: dynamic monitoring Patrick Thomas
References:
dynamic monitoring Patrick Thomas

Navigate by Date:
Prev: dynamic monitoring Patrick Thomas
Next: Re: dynamic monitoring Patrick Thomas
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: dynamic monitoring Patrick Thomas
Next: Re: dynamic monitoring Patrick Thomas
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·