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: Phillip Sorensen <[email protected]>
To: [email protected]
Date: Tue, 10 Feb 2015 09:08:10 -0500
I may have need for something like this in the next couple weeks. If I get something working, I will post something.

Phil Sorensen

On 2/6/2015 8:51 AM, Dirk Zimoch wrote:
Hi Christian

At the moment, StreamDevice cannot do this directly. The 'exec' command
can only pass parameters to an external program but cannot pipe data
into the program or read its output, nor can it evaluate the exit status.

But it would be a nice exercise to write an asynOctet driver that uses a
piped program instead of a serial line.

drvAsynPipeConfigure "myProgramPort" "program arg1 arg2 arg3 ..."

The driver may restart the program whenever it has exited and asyn tries
to talk to the port again (i.e. autoConnect).

Any volunteers?

Dirk

On 05.02.2015 17:58, Christian Pauly 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






References:
Fetching return value from external program call in StreamDevice Christian Pauly
Re: Fetching return value from external program call in StreamDevice Dirk Zimoch

Navigate by Date:
Prev: Re: medm3.1.8 linker problem Dirk Zimoch
Next: announcing pyDevSup Michael Davidsaver
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 Torsten Bögershausen
Next: Re: Fetching return value from external program call in StreamDevice Christian Pauly
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 ·