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: EPICS Threading Issues
From: Richard Pastrick <[email protected]>
To: "[email protected]" <[email protected]>
Date: Tue, 21 Oct 2008 15:25:48 -0700
I have some questions regarding EPICS and threading. Let me start by laying out the development environment.

I am developing an interface to an EPICS motor record using the CA API. I am using base 3.14.8.2. I am compiling under windows using Visual Studio 2008. I have successfully compiled all necessary components this way. I know that there are no issues with the compiling because all of the utilities and executables generated by the base are functional.

My interface is being generated in a GUI application for windows. When I start the program, the main process thread instantiates a class which contains all of my EPICS related code. This class will connect to the various PVs I require and store their chid objects for future access.

I then go on to do other necessary steps for my program and eventually I complete startup. Once startup has completed, there is a spawned thread which will go to my EPICS class at a specified interval and retrieve new data from the EPICS motors. These ca_get commands will fail to return any accurate data. The return code they return indicates a success but the data, as confirmed by both the caget utility and an MEDM window, is incorrect. For example, if I have moved the motor to a position of 2.5, both the MEDM window and caget will confirm that the RBV for that motor is 2.5. My program will say that it is at 0.

If I issue a ca_get right after I create the channels in the same thread that created the channels, I will receive the proper value of 2.5. I can also use ca_put with no problem. So if I issue a command to move to 4.2 from my program, the motor actually will move to this new location but the ca_get to retrieve the RBV will return 0 for the read value.

So my question boils down to this, should EPICS be able use a channel that was created in a different thread? 

Thank you,


Richard Pastrick
Associate Software Engineer
Xradia Inc
5052 Commercial Cir
Concord CA 94520
925-288-1228 Ext 1151
925-348-0384 (cell)


Replies:
Re: EPICS Threading Issues Andrew Johnson
RE: EPICS Threading Issues Jeff Hill

Navigate by Date:
Prev: ioc reading data from files Pierrick Hanlet
Next: Re: EPICS Threading Issues Andrew Johnson
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: ioc reading data from files Dirk Zimoch
Next: Re: EPICS Threading Issues Andrew Johnson
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 ·