From b26bf2e8a549ed511f72ca8cda2c63bdfc257e8d Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 31 Jul 1991 16:22:43 +0000 Subject: [PATCH] *** empty log message *** --- src/dev/devWfSoft.c | 9 +++++++-- src/rec/recBo.c | 7 +++++++ src/rec/recCompress.c | 10 ++++++++-- src/rec/recMbbi.c | 7 +++++++ src/rec/recPid.c | 18 +++++++++--------- src/rec/recSel.c | 5 ++--- src/rec/recSteppermotor.c | 8 +++++++- src/rec/recTimer.c | 15 +++++++++++++-- 8 files changed, 60 insertions(+), 19 deletions(-) diff --git a/src/dev/devWfSoft.c b/src/dev/devWfSoft.c index 9f9a420b4..2c7a7bdc1 100644 --- a/src/dev/devWfSoft.c +++ b/src/dev/devWfSoft.c @@ -104,8 +104,13 @@ static long read_wf(pwf) case (DB_LINK) : options=0; nRequest=pwf->nelm; - (void)dbGetLink(&(pwf->inp.value.db_link),pwf,pwf->ftvl, - pwf->bptr,&options,&nRequest); + if(dbGetLink(&(pwf->inp.value.db_link),pwf,pwf->ftvl, + pwf->bptr,&options,&nRequest)!=0){ + if(pwf->nsev < VALID_ALARM) { + pwf->nsev = VALID_ALARM; + pwf->nsta = LINK_ALARM; + } + } pwf->nord = nRequest; break; case (CA_LINK) : diff --git a/src/rec/recBo.c b/src/rec/recBo.c index 30211717d..67947a1a2 100644 --- a/src/rec/recBo.c +++ b/src/rec/recBo.c @@ -308,6 +308,13 @@ static void alarm(pbo) { unsigned short val = pbo->val; + /* check for udf alarm */ + if(pbo->udf == TRUE ){ + if (pbo->nsevnsta = UDF_ALARM; + pbo->nsev = VALID_ALARM; + } + } /* check for state alarm */ if (val == 0){ diff --git a/src/rec/recCompress.c b/src/rec/recCompress.c index 1a4425fce..96dc92cc9 100644 --- a/src/rec/recCompress.c +++ b/src/rec/recCompress.c @@ -161,8 +161,14 @@ static long process(paddr) long no_elements=pdbAddr->no_elements; int alg=pcompress->alg; - (void)dbGetLink(&pcompress->inp.value.db_link,pcompress,DBR_DOUBLE,pcompress->wptr, - &options,&no_elements); + if(dbGetLink(&pcompress->inp.value.db_link,pcompress,DBR_DOUBLE,pcompress->wptr, + &options,&no_elements)!=0){ + if(pcompress->nsev < VALID_ALARM) { + pcompress->nsev = VALID_ALARM; + pcompress->nsta = LINK_ALARM; + } + } + if(alg==AVERAGE) { status = array_average(pcompress,pcompress->wptr,no_elements); } else if(alg==CIRBUF) { diff --git a/src/rec/recMbbi.c b/src/rec/recMbbi.c index 1d3aa68ca..73c30919c 100644 --- a/src/rec/recMbbi.c +++ b/src/rec/recMbbi.c @@ -310,6 +310,13 @@ static void alarm(pmbbi) unsigned short *severities; unsigned short val=pmbbi->val; + /* check for udf alarm */ + if(pmbbi->udf == TRUE ){ + if (pmbbi->nsevnsta = UDF_ALARM; + pmbbi->nsev = VALID_ALARM; + } + } /* check for state alarm */ /* unknown state */ diff --git a/src/rec/recPid.c b/src/rec/recPid.c index 9b0a03a33..0c47d8ccf 100644 --- a/src/rec/recPid.c +++ b/src/rec/recPid.c @@ -79,11 +79,11 @@ struct rset pidRSET={ cvt_dbaddr, get_array_info, put_array_info, + get_units, + get_precision, get_enum_str, get_enum_strs, put_enum_str, - get_units, - get_precision, get_graphic_double, get_control_double, get_alarm_double }; @@ -372,10 +372,10 @@ struct pidRecord *ppid; if(dbGetLink(&(ppid->cvl.value.db_link),ppid,DBR_FLOAT, &cval,&options,&nRequest)!=NULL) { if (ppid->nsevnsta = READ_ALARM; + ppid->nsta = LINK_ALARM; ppid->nsev = VALID_ALARM; - return(0); } + return(0); } /* fetch the setpoint */ if(ppid->stpl.type == DB_LINK && ppid->smsl == CLOSED_LOOP){ @@ -384,17 +384,17 @@ struct pidRecord *ppid; if(dbGetLink(&(ppid->stpl.value.db_link),ppid,DBR_FLOAT, &(ppid->val),&options,&nRequest)!=NULL) { if (ppid->nsevstat = READ_ALARM; - ppid->sevr = VALID_ALARM; - return(0); + ppid->nsta = LINK_ALARM; + ppid->nsev = VALID_ALARM; } + return(0); } else ppid->udf=FALSE; } val = ppid->val; if (ppid->udf == TRUE ) { if (ppid->nsevstat = UDF_ALARM; - ppid->sevr = VALID_ALARM; + ppid->nsta = UDF_ALARM; + ppid->nsev = VALID_ALARM; } return(0); } diff --git a/src/rec/recSel.c b/src/rec/recSel.c index 34ff2e122..7c0e7c748 100644 --- a/src/rec/recSel.c +++ b/src/rec/recSel.c @@ -418,9 +418,8 @@ struct selRecord *psel; if(dbGetLink(&(psel->nvl.value.db_link),psel,DBR_USHORT, &(psel->seln),&options,&nRequest)!=NULL) { if (psel->nsevstat = LINK_ALARM; - psel->sevr = VALID_ALARM; - return(0); + psel->nsta = LINK_ALARM; + psel->nsev = VALID_ALARM; } return(-1); } diff --git a/src/rec/recSteppermotor.c b/src/rec/recSteppermotor.c index b53f86d77..bbb22bb15 100644 --- a/src/rec/recSteppermotor.c +++ b/src/rec/recSteppermotor.c @@ -145,6 +145,12 @@ static long init_record(psm) struct steppermotorRecord *psm; { + /* get the initial value if dol is a constant*/ + if (psm->dol.type == CONSTANT ){ + psm->udf = FALSE; + psm->val = psm->dol.value.value; + } + init_sm(psm); return(0); } @@ -663,7 +669,7 @@ struct steppermotorRecord *psm; if(dbGetLink(&(psm->dol.value.db_link),psm,DBR_FLOAT,&(psm->val),&options,&nRequest)){ if (psm->nsev < VALID_ALARM) { - psm->nsta = READ_ALARM; + psm->nsta = LINK_ALARM; psm->nsev = VALID_ALARM; } return; diff --git a/src/rec/recTimer.c b/src/rec/recTimer.c index db2138b94..7759a95c0 100644 --- a/src/rec/recTimer.c +++ b/src/rec/recTimer.c @@ -132,6 +132,11 @@ void write_timer(); static long init_record(ptimer) struct timerRecord *ptimer; { + /* get the delay initial value if torg is a constant*/ + if (ptimer->torg.type == CONSTANT ){ + ptimer->trdl = ptimer->torg.value.value; + } + /* read to maintain time pulses over a restart */ read_timer(ptimer); @@ -281,8 +286,14 @@ struct timerRecord *ptimer; nRequest=1; status = dbGetLink(&(ptimer->torg.value.db_link),ptimer,DBR_FLOAT, &(ptimer->trdl),&options,&nRequest); - if(status!=0) return; - } + if(status!=0){ + if(ptimer->nsev < VALID_ALARM) { + ptimer->nsev = VALID_ALARM; + ptimer->nsta = LINK_ALARM; + } + return; + } + } if (ptimer->out.type != VME_IO) { if(ptimer->nsevnsta = WRITE_ALARM;