diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index ecbcff338..dae1e977e 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,14 @@

Changes between 3.14.11 and 3.14.12

+

Enable array puts to subArray records

+ +

It is now possible to put an array into the VAL field of a soft channel +subArray record whose INP field is empty. Processing the record then causes the +sub-array extraction process to be done on the current VAL array. This can be +used to feed a sequence of values into some other record (set INDX=1 and +NELM=MALM and read one element out of the VAL field each time).

+

Added windows-x64 target

64-bit binaries for Microsoft Windows platforms can now be built using the diff --git a/src/dev/softDev/devSASoft.c b/src/dev/softDev/devSASoft.c index 8505e9299..6178b6ce7 100644 --- a/src/dev/softDev/devSASoft.c +++ b/src/dev/softDev/devSASoft.c @@ -72,15 +72,24 @@ static long read_sa(subArrayRecord *prec) if (nRequest > prec->malm) nRequest = prec->malm; - dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest); - prec->nord = ecount = nRequest - prec->indx; + + if (prec->inp.type == CONSTANT) + nRequest = prec->nord; + else + dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest); + + ecount = nRequest - prec->indx; if (ecount > 0) { int esize = dbValueSize(prec->ftvl); + if (ecount > prec->nelm) ecount = prec->nelm; memmove(prec->bptr, (char *)prec->bptr + prec->indx * esize, ecount * esize); - } + } else + ecount = 0; + + prec->nord = ecount; if (nRequest > 0 && prec->tsel.type == CONSTANT && diff --git a/src/rec/subArrayRecord.c b/src/rec/subArrayRecord.c index dac59a89d..dc18a6ad3 100644 --- a/src/rec/subArrayRecord.c +++ b/src/rec/subArrayRecord.c @@ -194,9 +194,8 @@ static long put_array_info(DBADDR *paddr, long nNew) subArrayRecord *prec = (subArrayRecord *) paddr->precord; if (nNew > prec->malm) - prec->nord = prec->malm; - else - prec->nord = nNew; + nNew = prec->malm; + prec->nord = nNew; return 0; }