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  <20082009  2010  2011  2012  2013  2014  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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: CA client application
From: "M.Babai" <[email protected]>
To: epics tech-talk <[email protected]>
Date: Wed, 15 Oct 2008 12:10:24 +0200
Hello,

I am trying to develop an application using EPICS CA connection library. We have the following setting:

device one: provides PV1
device two: provides PV2

Now, the intention is to read a number of values from the first device and collect them. After collecting of, let say 100, values of PV1 we can perform some computations and based on the results we can determine the value for PV2 and set that. After this operations we want to go to the monitoring phase and continue collecting PV1 values. For reading PV1 values I am using a program with the same structure like the caMonitor application provided by the makeBaseApp.pl:

/Code
status = ca_context_create(ca_disable_preemptive_callback);
SEVCHK(status,"ca_context_create()");

status = ca_create_channel(pname,connectionCallback,
                               pmynode,20,&pmynode->mychid);
SEVCHK(status,"ca_create_channel()");

status = ca_add_event(DBR_FLOAT,pmynode->mychid,
			    eventCallback, pmynode,&pmynode->myevid);
SEVCHK(status,"ca_add_event()");

SEVCHK(ca_pend_event(0.0),"ca_pend_event()");
/Code

I am using ca_pend_event() because I want to collect PV1 values only if they change. The frequency of changes of PV1 are not known, thus the application needs to wait until there are enough values available.
If I use the value 0.0 as the argument for ca_pend_event(), then program remains calling the eventCallback function (blocking mode), thus all of the necessary computations need to be done in the body of eventCallback. In the other case, other values for time-out, there is no guaranty that we can collect enough PV1-s.


Any ideas how to solve this?
Any suggestions or examples are very welcome.

Thanks in advanced,
/MB

Replies:
Re: CA client application Benjamin Franksen

Navigate by Date:
Prev: a question about mbbiDirect and fanout Silver
Next: RE: epics dbpf problem Shi HaoLi
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re:RE: RE: a question about mbbiDirect and fanout marco_hair
Next: Re: CA client application Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·