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  2019  <20202021  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  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Setting an array to zero length
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: "Rogers, Will (DLSLtd,RAL,LSCI)" <will.rogers at diamond.ac.uk>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Tue, 2 Jun 2020 16:28:25 +0000
Hi Will,

Yeah, I wrote my email in April with a different situation in mind, sorry!

Some members of the core group are looking to make zero-length arrays work, although I’m not sure whether they’ll be able to get every API to work with them (hopefully they will, but in some places a zero length value used to mean a scalar, i.e. 1 element, and that might be hard to change without breaking external code – hopefully I’m wrong about that though).

- Andrew


On Jun 2, 2020, at 10:06 AM, Rogers, Will (DLSLtd,RAL,LSCI) <will.rogers at diamond.ac.uk> wrote:

It's also worth noting that I seem to be able to set a waveform record in a soft IOC to zero length using JCA.

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk <tech-talk at aps.anl.gov>
Sent: 02 June 2020 14:03
To: Michael Davidsaver <mdavidsaver at gmail.com>; Johnson, Andrew N. <anj at anl.gov>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Re: Setting an array to zero length
 
This newly-opened bug report seems relevant to this discussion.





From: Michael Davidsaver <mdavidsaver at gmail.com>
Sent: 08 April 2020 22:50
To: Johnson, Andrew N. <anj at anl.gov>
Cc: Rogers, Will (DLSLtd,RAL,LSCI) <will.rogers at diamond.ac.uk>; EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Re: Setting an array to zero length
 
On 4/8/20 10:05 AM, Johnson, Andrew N. via Tech-talk wrote:
> Hi Will,
> 
> It is not currently (and may never be) possible to put a zero-length array through Channel Access; I don’t know if PVA and QSRV can handle them or not. The IOC generally doesn’t work too well with zero-length arrays, there are some internal APIs that take a zero length to mean there is no data at all (so they can pass metadata around without any data).
> 
> Personally I think it regrettable that waveform records currently start up with zero elements, I would have preferred that we never have any zero-length arrays in the IOC since I suspect making them work properly might take more work than making them impossible, but if someone is already using them we probably couldn’t make that change. IOC support for zero-length arrays is something that a site that relies on them should probably take a careful look at; currently I think we have a bit of a mixture, some APIs can handle them and others can’t (including the CA client API AIUI).

I think that zero length is an entirely reasonable default
which should not be changed.  While the array API is clunky
an inefficient, the problems I'm aware of with handling of
length zero are confined to RSRV/libca.  Other interfaces
to the database QSRV, or even DB_LINK, are quite capable of
handling length zero.


> HTH,
> 
> - Andrew
> 
> 
>> On Apr 8, 2020, at 9:13 AM, Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk <tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>> wrote:
>>
>> This is interesting, thank you, but the intention here is to do this for an arbitrary record from a client tool over channel access.
>>
>> Is the conclusion that this is not possible?
>>
>> Thanks,
>> Willl
>>
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> *From:* Tech-talk on behalf of Ben Franksen via Tech-talk
>> *Sent:* Friday, April 03, 2020 16:43
>> *To:* EPICS Tech Talk
>> *Subject:* Re: Setting an array to zero length
>>
>> Am 03.04.20 um 17:28 schrieb Ben Franksen via Tech-talk:
>> > Am 03.04.20 um 16:25 schrieb Ralph Lange via Tech-talk:
>> >> On Fri, 3 Apr 2020 at 15:04, Ben Franksen via Tech-talk <
>> >> tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>> wrote:
>> >>
>> >>> [...]
>> >>
>> >> You could also try to use another
>> >>> record with NELM=NORD=0 and that has an output link that you point to
>> >>> your WAVE record. There is no record type in base with such an output
>> >>> link [...]
>> >>>
>> >>
>> >> The aaoRecord since Base 3.12.2 (ca. 1995)
>> > 
>> > Thanks I completely forgot about this one. Indeed this works:
>> > 
>> > record(waveform, "wf") {
>> >     field(NELM, "10")
>> >     field(FTVL, "DOUBLE")
>> >     field(INP, [1, 2, 3, 4, 5, 6, 7, 8])
>> >     field(PINI, "YES")
>> > }
>> > record(aao, "reset") {
>> >     field(NELM, "0")
>> >     field(OUT, "wf PP")
>> > }
>> > 
>> > ben@juliana[1]:.../base/7.0>caget wf
>> > wf 10 1 2 3 4 5 6 7 8 0 0
>> > ben@juliana[1]:.../base/7.0>caget wf.NORD
>> > wf.NORD                        8
>> > ben@juliana[1]:.../base/7.0>caput reset.PROC 1
>> > Old : reset.PROC                     0
>> > New : reset.PROC                     1
>> > ben@juliana[1]:.../base/7.0>caget wf.NORD
>> > wf.NORD                        0
>> > ben@juliana[1]:.../base/7.0>caget wf
>> > wf 10 2.50321e-308 0 0 0 0 0 0 0 0 0
>> > 
>> > The last response is unexpected though. While caget -h indeed says:
>> > 
>> > Arrays: Value format: print number of requested values, then list of values
>> > 
>> > printing the actual number of values in the response (and only so many
>> > values) would be more useful. Does CA not return the current number of
>> > values in an array?
>>
>> Ah, I see. This is a limitation of the simple ca_array_get call which is
>> used by default. It works as expected if I pass the -c option which
>> makes it use ca_array_get_callback which can return the current number
>> of elements.
>>
>> Cheers
>> Ben
>> -- 
>> ...it is impossible to speak of a depoliticized economy as the liberals
>> do, or of a separation between economic exploitation and political
>> oppression as the Marxists articulate. The basic distinction, rather, is
>> between power and creativity...
>>              -- Jonathan Nitzan and Shimshon Bichler: Capital as Power
>>
>>  
>>
>> -- 
>> This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
>> Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
>> Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
>> Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
> 
> -- 
> Complexity comes for free, simplicity you have to work for.
> 

 

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 

 

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

-- 
Complexity comes for free, simplicity you have to work for.


References:
Re: Setting an array to zero length Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk
Re: Setting an array to zero length Johnson, Andrew N. via Tech-talk
Re: Setting an array to zero length Michael Davidsaver via Tech-talk
Re: Setting an array to zero length Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk
Re: Setting an array to zero length Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk

Navigate by Date:
Prev: Re: Setting an array to zero length Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk
Next: Asyn4-38 SetOption Parity "Even" fails - "Invalid argument" Jan Hoppius 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  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Setting an array to zero length Rogers, Will (DLSLtd, RAL, LSCI) via Tech-talk
Next: PolyScience Model 4100 and 4200 Series Liquid-to-Liquid Coolers Hu, Yong 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  2019  <20202021  2022  2023  2024 
ANJ, 02 Jun 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·