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  <20152016  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  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: acalcout subarray indices
From: [email protected]
To: [email protected]
Date: Wed, 4 Mar 2015 17:01:58 -0800 (PST)

This documentation on the acalcout record:
 
 http://www.aps.anl.gov/bcda/synApps/calc/R2-6/aCalcoutRecord.html

says that subarray indices are inclusive, so that {2,4} selects
elments with indices 2,3,4 (where 0 is the first index):

 AA{2,4} where AA = (1,2,3,4,5,6)  Result is (0,0,3,4,5,0).

But this test seems to show that indices are exclusive, that is, 
the upper index is excluded from the subarray:

record(acalcout, R) {
  field(NELM, "2")
  # no INPA or INPB - write directly to R.A and R.B
  field(CALC, "ARR(0)+ARR(A){0,1}+ARR(B){1,2}")
}

epics> dbgf R.AVAL
DBR_DOUBLE[2]:      0                   0                   

epics> dbpf R.A 1
DBR_DOUBLE:         1                   

epics> dbgf R.AVAL
DBR_DOUBLE[2]:      1                   0                   

According to the documentation, it seems {0,1} should select the two
elements with indices 0 and 1, but here only the first bit in AVAL
gets set.  Similar tests with larger arrays, subarrays longer than one
element, values other than 1, and positions other than the first, show
similar results: the upper index is not included in the subarray.

Can anyone explain this?

Jon Jacky

PS - This discrepancy was found by a graduate student here at UW, who
wrote an analyzer that checks an EPICS database against assertions about
its intended behavior.



Replies:
RE: acalcout subarray indices Mooney, Tim M.

Navigate by Date:
Prev: Re: How to handle out-of-index of MBBO/MBBI? Andrew Johnson
Next: Re: Problem with HDF5 plugin for areaDetector Wilkins, Stuart
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Problem with HDF5 plugin for areaDetector Mark Rivers
Next: RE: acalcout subarray indices Mooney, Tim M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·