diff --git a/src/rec/mbboDirectRecord.c b/src/rec/mbboDirectRecord.c index 21e9110eb..45563707a 100644 --- a/src/rec/mbboDirectRecord.c +++ b/src/rec/mbboDirectRecord.c @@ -117,18 +117,9 @@ static long init_record(pmbboDirect,pass) if (pass==0) return(0); - /* mbbo.siml must be a CONSTANT or a PV_LINK or a DB_LINK */ - switch (pmbboDirect->siml.type) { - case (CONSTANT) : + /* mbboDirect.siml must be a CONSTANT or a PV_LINK or a DB_LINK */ + if (pmbboDirect->siml.type == CONSTANT) { recGblInitConstantLink(&pmbboDirect->siml,DBF_USHORT,&pmbboDirect->simm); - break; - case (PV_LINK) : - case (DB_LINK) : - break; - default : - recGblRecordError(S_db_badField,(void *)pmbboDirect, - "mbboDirect: init_record Illegal SIML field"); - return(S_db_badField); } if(!(pdset = (struct mbbodset *)(pmbboDirect->dset))) { @@ -141,7 +132,8 @@ static long init_record(pmbboDirect,pass) return(S_dev_missingSup); } if (pmbboDirect->dol.type == CONSTANT){ - recGblInitConstantLink(&pmbboDirect->dol,DBF_USHORT,&pmbboDirect->val); + if(recGblInitConstantLink(&pmbboDirect->dol,DBF_USHORT,&pmbboDirect->val)) + pmbboDirect->udf = FALSE; } /* initialize mask*/ pmbboDirect->mask = 0; @@ -177,7 +169,7 @@ static long process(pmbboDirect) } if (!pmbboDirect->pact) { - if(pmbboDirect->dol.type==DB_LINK && pmbboDirect->omsl==CLOSED_LOOP){ + if(pmbboDirect->dol.type!=CONSTANT && pmbboDirect->omsl==CLOSED_LOOP){ long status; unsigned short val; @@ -186,6 +178,7 @@ static long process(pmbboDirect) pmbboDirect->pact = FALSE; if(status==0) { pmbboDirect->val= val; + pmbboDirect->udf= FALSE; } } /* convert val to rval */ diff --git a/src/rec/waitRecord.c b/src/rec/waitRecord.c index 4a658c376..e894ceda6 100644 --- a/src/rec/waitRecord.c +++ b/src/rec/waitRecord.c @@ -593,32 +593,15 @@ static long initSiml(pwait) struct waitRecord *pwait; { long status; + /* wait.siml must be a CONSTANT or a PV_LINK or a DB_LINK */ - switch (pwait->siml.type) { - case (CONSTANT) : + if (pwait->siml.type == CONSTANT) { recGblInitConstantLink(&pwait->siml,DBF_USHORT,&pwait->simm); - break; - case (PV_LINK) : - case (DB_LINK) : - break; - default : - recGblRecordError(S_db_badField,(void *)pwait, - "wait: init_record Illegal SIML field"); - return(S_db_badField); } /* wait.siol must be a CONSTANT or a PV_LINK or a DB_LINK */ - switch (pwait->siol.type) { - case (CONSTANT) : + if (pwait->siol.type == CONSTANT) { recGblInitConstantLink(&pwait->siol,DBF_DOUBLE,&pwait->sval); - break; - case (PV_LINK) : - case (DB_LINK) : - break; - default : - recGblRecordError(S_db_badField,(void *)pwait, - "wait: init_record Illegal SIOL field"); - return(S_db_badField); } return(0);