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  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: Zero length length requests, EPICS upgrades, and cothread
From: Matt Newville <newville@cars.uchicago.edu>
To: Andrew Johnson <anj@aps.anl.gov>
Cc: EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Mon, 16 Dec 2013 13:06:13 -0600
Hi Michael, Andrew,

On Mon, Dec 16, 2013 at 11:47 AM, Andrew Johnson <anj@aps.anl.gov> wrote:
> Hi Michael,
>
> On 12/16/2013 08:11 AM, michael.abbott@diamond.ac.uk wrote:
>> This is a question for users of cothread.catools.
>
> I'm not one of your users so you weren't asking for my comments, but
> I'll make them anyway.

I'm not a user of cothread.catools either, but I think it might be
useful to have cothreads.catools and pyepics have similar behaviors
whenever possible.    I've been confused about what the correct
behavior for waveforms should be too.

>> QUESTION: What should be the correct *default* result length when
>> using cothread to perform caget() or camonitor() on a waveform?
>>
>> A. The "natural" length, encoded as zero: this returns NORD elements
>> on a .12 and above server, but NELM elements on older version of
>> EPICS.  (This is the current default.)
>
> I think you should stick with this meaning.
>
>> B. The "full" length, which for a waveform is NELM elements.
>>
>>
>> I am proposing to make the following *incompatible* change: the
>> default result length (encoded by the 'count' parameter to 'caget'
>> and 'camonitor') will change from 0 ("natural" length) to "full"
>> length, and if the "natural" length is wanted it will be necessary to
>> explicitly specify 'count=0' as an argument.
>>
>> Please shout if you think this is a bad idea...
>
> Shout!

Oh, Micheal's proposal is (mostly) exactly what pyepics ca.get() does.
 It takes a count argument with a default value of None.  That is
interpreted as "use ca_element_count() to figure out count".   One can
pass in count=0 to get the natural length (NORD elements), but the
default is the full array.

But, for pyepics, ca.get() is meant to be the "low level interface"
that is similar to C.  Creating a pyepics.PV() normally sets up a
monitor on the value (ca.create_subscription) with a count of 0, so
that the natural length is used.

Should the ca.get() be changed to have a default count of 0 (meaning,
return NORD elements)?  I think that would mean the user has to
explicitly do a ca_element_count() to get the full array, which does
seem reasonable.

That is, if we know that elements NORD through NELM-1 are not valid
data then it seems better to not return them, unless the user
explicitly asks for it.  Then again, I think it would be preferable to
have uniform behavior.  Looking forward to hearing what the best
approach should be...

--Matt

Replies:
RE: Zero length length requests, EPICS upgrades, and cothread Emmanuel Mayssat
RE: Zero length length requests, EPICS upgrades, and cothread michael.abbott
References:
Zero length length requests, EPICS upgrades, and cothread michael.abbott
Re: Zero length length requests, EPICS upgrades, and cothread Andrew Johnson

Navigate by Date:
Prev: caQtDM Mezger Anton Christian
Next: Re: Mclennan PM600 motor controller Ron Sluiter
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: Zero length length requests, EPICS upgrades, and cothread Andrew Johnson
Next: RE: Zero length length requests, EPICS upgrades, and cothread Emmanuel Mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·