Hi Michael, Andrew,
On Mon, Dec 16, 2013 at 11:47 AM, Andrew Johnson <email@example.com> wrote:
> Hi Michael,
> On 12/16/2013 08:11 AM, firstname.lastname@example.org 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...
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
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...
- RE: Zero length length requests, EPICS upgrades, and cothread Emmanuel Mayssat
- RE: Zero length length requests, EPICS upgrades, and cothread michael.abbott
- Zero length length requests, EPICS upgrades, and cothread michael.abbott
- Re: Zero length length requests, EPICS upgrades, and cothread Andrew Johnson
- Navigate by Date:
caQtDM Mezger Anton Christian
Re: Mclennan PM600 motor controller Ron Sluiter
- Navigate by Thread:
Re: Zero length length requests, EPICS upgrades, and cothread Andrew Johnson
RE: Zero length length requests, EPICS upgrades, and cothread Emmanuel Mayssat