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  <20092010  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  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: caget with an array of space-containing strings
From: Andrew Johnson <[email protected]>
To: [email protected]
Cc: Carl Schumann <[email protected]>
Date: Thu, 26 Feb 2009 15:24:28 -0600
On Thursday 26 February 2009 13:57:56 Carl Schumann wrote:
>
> I am using the command-line caget with an array of space-containing
> strings.  Apparently caget uses spaces to separate array elements.   A
> space separator causes some difficultly in this case because the
> elements themselves contains spaces.   For example, ...
>
> > clx39:~ $ caget -# 1 ADC00.RNGS
> > ADC00.RNGS                     50, 10k: -10->0
> > clx39:~ $ caget ADC00.RNGS
> > ADC00.RNGS 9 50, 10k: -10->0 50, 10k: +-5 50, 10k: 0->10 50: -6->0,
> > 10k: -5->0 50: +-3, 10k: +-2.5 50, 10k: 0->5 50: -5->0, 10k: -2->0 50:
> > +-2.5, 10k: +-1 50: 0->5, 10k: 0->2
> > clx39:~ $
>
> One can ask for specific elements as I have done, but that is a little
> bit inconvenient.  Any suggestions?

The tools caget caput and camonitor are really designed for human consumption.  
If you're writing scripts that make more than a few calls (especially if they 
are long-running or involve looping) you should consider switching to a 
scripting language that has a direct interface to the CA library.  There are 
several Python interfaces available, and a Perl library comes with Base 
R3.14.10 (look at base/html/CA.html for documentation).  These will all allow 
you to fetch arrays the way you want them, and they can help reduce the load 
on your IOCs when compared with scripts that repeatedly run the command-line 
tools.

- Andrew
-- 
The best FOSS code is written to be read by other humans -- Harold Welte

References:
caget with an array of space-containing strings Carl Schumann

Navigate by Date:
Prev: Re: caget with an array of space-containing strings J. Lewis Muir
Next: Re: caget with an array of space-containing strings Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: caget with an array of space-containing strings Eric Norum
Next: Re: caget with an array of space-containing strings Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·