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  <20132014  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  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Zero length length requests, EPICS upgrades, and cothread
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Cc: [email protected]
Date: Wed, 18 Dec 2013 11:18:16 -0600
Hi Michael,

On 12/18/2013 01:14 AM, [email protected] wrote:
> BTW, does CA support zero length arrays, I mean with .NORD == 0?
> (Just an idle question, really.  I imagine not, to be honest.)

The IOC does handle zero-length arrays OK, they don't cause it to crash
or anything like that, but it generally expects there to be at least one
element. Several dbAccess APIs to get or put field data take both a
request length and a set of options flags for requesting metadata such
as the units string, and you pass in length=0 to say that you're only
asking for metadata, so they don't return any data in that case. Other
internal code converts a zero length in to a one, but that behaviour may
not be visible outside the IOC.

Zero-length arrays can cause strange behaviour with some CA client
programs though. A waveform record initializes with NORD=0, and if you
do a caget of such a waveform it currently prints a garbage value for
the first array element:

tux% caget anjHost:wf
anjHost:wf 8 2.50321e-308 0 0 0 0 0 0 0

The caget -c option which uses ca_get_callback does see that this is a
zero-length array, but if you're parsing the result you'd better write
it to expect an empty value string because it doesn't print an element
count when it's zero:

tux% caget -c anjHost:wf
anjHost:wf

These are known bugs: https://bugs.launchpad.net/epics-base/+bug/1242919

HTH,

- Andrew
-- 
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock

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

Navigate by Date:
Prev: Design strategies for CSS BOY screens tom.cobb
Next: Re: Increasing scan rate to 10 kHz Evgeniy
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  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Zero length length requests, EPICS upgrades, and cothread michael.abbott
Next: EPICS Base R3.14.12.4 now available Andrew Johnson
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  2020  2021  2022  2023  2024 
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 ·