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  2015  2016  2017  2018  <20192020  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  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Getting data from a shell script into an ioc
From: "Kasemir, Kay via Tech-talk" <[email protected]>
To: Bo Jakobsen <[email protected]>, Wang Xiaoqiang <[email protected]>, techtalk <[email protected]>
Date: Mon, 14 Jan 2019 13:49:03 +0000
> An aSub record would just work.
> In the subroutine you can launch the script and parse its output.

Note that the subroutine should be quick.
If the subroutine calls system() or popen() to start the external process, then parses the result, this will delay the IOC record processing.

What would be better:
You start a separate thread which periodically calls system() or popen() to start the external process, parses the result, places the result somewhere, and the code invoked from the subroutine record then simply picks the latest result.
If you're familiar with starting threads and getting the synchronization right, that should be easy.
Otherwise look at the asyn framework as a starting point.

-Kay

References:
Getting data from a shell script into an ioc Bo Jakobsen via Tech-talk
Re: Getting data from a shell script into an ioc Wang Xiaoqiang via Tech-talk

Navigate by Date:
Prev: Re: Getting data from a shell script into an ioc Wang Xiaoqiang via Tech-talk
Next: Re: Getting data from a shell script into an ioc Konrad, Martin via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Getting data from a shell script into an ioc Wang Xiaoqiang via Tech-talk
Next: Re: Getting data from a shell script into an ioc Pearson, Matthew R. via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 14 Jan 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·