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  2013  2014  <20152016  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  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Fetching return value from external program call in StreamDevice
From: Rod Nussbaumer <[email protected]>
To: [email protected]
Date: Thu, 05 Feb 2015 10:08:00 -0800
Or you could make your python script into a daemon (or something akin to that if not on a Unix-like host), and modify it to be a TCP server that responds to StreamDevice queries via TCP.

   ---   rod.


On 02/05/2015 09:05 AM, Kasemir, Kay wrote:
Since you already have the data in python, you could add the python CA server to your python code, so your python program is like an IOC, directly serving the data via channel access. See https://pcaspy.readthedocs.org
-Kay


On Feb 5, 2015, at 11:58 AM, Christian Pauly<[email protected]>
  wrote:

Hi

I want to read out a little pressure sensor, for which i have already a small python script which reads the sensor (via i2c bus) and prints the sensor value to the terminal. Alternatively, i could also give the sensor value as return value upon program exit.


Now i want to read this sensor inside an EPICS IOC.
Is it possible, to use StreamDevice for this, by calling the external script / program and evaluating the return value ?
Maybe using the "exec" statement in the protocol file ?

Reading the sensor takes some time (500ms), so it would be good to do it asynchronously, without blocking the IOC.

Or is there any other easy way, without reimplementing all the i2c sensor readout eg inside an ASYN driver in C++ code ?


Thanks for any hints or help

Best regards,
Christian



--
Dr. Christian Pauly
Bergische Universität Wuppertal
Fachbereich C - Physik
Gaußstraße 20, D-42119 Wuppertal
Tel: +49 (0)202 439-2632,
Fax: +49 (0)202 439-2662






Replies:
RE: Fetching return value from external program call in StreamDevice Al Honey
References:
Fetching return value from external program call in StreamDevice Christian Pauly
Re: Fetching return value from external program call in StreamDevice Kasemir, Kay

Navigate by Date:
Prev: RE: Fetching return value from external program call in StreamDevice Mooney, Tim M.
Next: Re: Fetching return value from external program call in StreamDevice Kasemir, Kay
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Fetching return value from external program call in StreamDevice Kasemir, Kay
Next: RE: Fetching return value from external program call in StreamDevice Al Honey
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·