Experimental Physics and
| |||||||||||||||
|
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
| ||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |