Experimental Physics and Industrial Control System
I have found that if a subArray record reads 0 elements into its array,
it sets its INDX field to 0. Is this behavior intended? I would rather
it not change its INDX field in this situation.
As an example, say I read four bytes from a serial connection with an
asyn record. I then want to grab the fourth read byte from the asyn
record's BINP field with a subArray record. So I make the subArray
record's INDX field have the value 3. Now say the asyn record has a
read error and reads 0 bytes from the serial connection. When the
subArray record processes, it sets its INDX field to 0. At this point,
my database is broken because INDX has the wrong index for getting the
fourth byte of the asyn record's BINP field.
I've attached an example database that shows this problem. Run it on an
IOC and run the following commands assuming a PV prefix of "xxx:":
$ caget xxx:FourthByte.INDX
$ caput xxx:ReadFourBytes.PROC 1
$ caget xxx:FourthByte.INDX
In the first caget, INDX will be 3. In the second caget, INDX will be 0.
I've attached a small patch against EPICS 3.14.8.2 base to fix this.
But maybe I'm mistaken and the way it works is how it is supposed to work?
My configuration is:
* Processor: Intel Core Duo
* OS: Mac OS X 10.4.10
* EPICS 3.14.8.2
* synApps 5.2 (with motor 6-2-2 + fixes, asyn 4-8 + fixes, sscan 2-5-6)
Thanks,
Lewis
--
J. Lewis Muir
Software Engineer
CARS/IMCA-CAT
#
# Parameters:
# $(P) PV name prefix (e.g. 17bm:)
#
record(asyn, "$(P)ReadFourBytes") {
field(PORT, "noexistent")
field(TMOT, "2.0")
field(TMOD, "Read")
field(NRRD, "4")
field(IFMT, "Binary")
field(FLNK, "$(P)FourthByte")
}
record(subArray, "$(P)FourthByte") {
field(INP, "$(P)ReadFourBytes.BINP NPP MS")
field(FTVL, "CHAR")
field(MALM, "4")
field(NELM, "1")
field(INDX, "3")
}
*** src/rec/subArrayRecord.c.orig Tue Apr 1 16:02:03 2003
--- src/rec/subArrayRecord.c Thu Nov 8 16:52:46 2007
***************
*** 314,320 ****
if (psa->nord <= 0)
{
status = -1;
- psa->indx = 0;
}
return(status);
}
--- 314,319 ----
- Replies:
- Re: subArray INDX field set to 0 if NORD <= 0 Andrew Johnson
- Navigate by Date:
- Prev:
RE: EDM screens did not reconnect Jeff Hill
- Next:
Re: subArray INDX field set to 0 if NORD <= 0 Andrew Johnson
- 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
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Call for expressions of interest for ILC controls R&D and engineering Margaret Votava
- Next:
Re: subArray INDX field set to 0 if NORD <= 0 Andrew Johnson
- 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
2020
2021
2022
2023
2024