static long readValue(stringinRecord *prec) { long status; struct stringindset *pdset = (struct stringindset *) (prec->dset); if (prec->pact == TRUE){ status=(*pdset->read_stringin)(prec); return(status); } status=dbGetLink(&(prec->siml),DBR_USHORT, &(prec->simm),0,0); if (status) return(status); if (prec->simm == menuYesNoNO){ status=(*pdset->read_stringin)(prec); return(status); } if (prec->simm == menuYesNoYES){ status=dbGetLink(&(prec->siol),DBR_STRING, prec->sval,0,0); if (status==0) { strcpy(prec->val,prec->sval); prec->udf=FALSE; } } else { status=-1; recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM); return(status); } recGblSetSevr(prec,SIMM_ALARM,prec->sims); return(status); }
/* * FETCH_VALUES * * fetch the values for the variables from which to select */ static int fetch_values(selRecord *prec) { struct link *plink; double *pvalue; int i; long status; plink = &prec->inpa; pvalue = &prec->a; /* If mechanism is selSELM_Specified, only get the selected input*/ if(prec->selm == selSELM_Specified) { /* fetch the select index */ status=dbGetLink(&(prec->nvl),DBR_USHORT,&(prec->seln),0,0); if (!RTN_SUCCESS(status) || (prec->seln >= SEL_MAX)) return(status); plink += prec->seln; pvalue += prec->seln; status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0); return(status); } /* fetch all inputs*/ for(i=0; i<SEL_MAX; i++, plink++, pvalue++) { status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0); } return(status); }
static long fetch_values(aSubRecord *prec) { long status; int i; if (prec->lflg == aSubLFLG_READ) { /* Get the Subroutine Name and look it up if changed */ status = dbGetLink(&prec->subl, DBR_STRING, prec->snam, 0, 0); if (status) return status; if (prec->snam[0] != 0 && strcmp(prec->snam, prec->onam)) { GENFUNCPTR pfunc = (GENFUNCPTR)registryFunctionFind(prec->snam); if (!pfunc) return S_db_BadSub; prec->sadr = pfunc; strcpy(prec->onam, prec->snam); } } /* Get the input link values */ for (i = 0; i < NUM_ARGS; i++) { long nRequest = (&prec->noa)[i]; status = dbGetLink(&(&prec->inpa)[i], (&prec->fta)[i], (&prec->a)[i], 0, &nRequest); if (nRequest > 0) (&prec->nea)[i] = nRequest; if (status) return status; } return 0; }
static long readValue(waveformRecord *prec) { long status; struct wfdset *pdset = (struct wfdset *) prec->dset; if (prec->pact == TRUE) { return (*pdset->read_wf)(prec); } status = dbGetLink(&(prec->siml), DBR_ENUM, &(prec->simm),0,0); if (status) return status; if (prec->simm == menuYesNoNO) { return (*pdset->read_wf)(prec); } if (prec->simm == menuYesNoYES) { long nRequest = prec->nelm; status = dbGetLink(&(prec->siol), prec->ftvl, prec->bptr, 0, &nRequest); /* nord set only for db links: needed for old db_access */ if (prec->siol.type != CONSTANT) { prec->nord = nRequest; if (status == 0) prec->udf=FALSE; } } else { recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM); return -1; } recGblSetSevr(prec, SIMM_ALARM, prec->sims); return status; }
static int fetch_values(acalcoutRecord *pcalc) { DBLINK *plink; /* structure of the link field */ double *pvalue; double **pavalue; long status = 0; int i, j; unsigned short *plinkValid; long numElements; #if MIND_UNUSED_ELEMENTS numElements = pcalc->nelm; #else numElements = acalcGetNumElements( pcalc ); #endif if (aCalcoutRecordDebug >= 10) printf("acalcoutRecord(%s):fetch_values: entry\n", pcalc->name); for (i=0, plink=&pcalc->inpa, pvalue=&pcalc->a; i<MAX_FIELDS; i++, plink++, pvalue++) { status = dbGetLink(plink, DBR_DOUBLE, pvalue, 0, 0); if (!RTN_SUCCESS(status)) return(status); } if (aCalcoutRecordDebug >= 10) printf("acalcoutRecord(%s):fetch_values: arrays\n", pcalc->name); plinkValid = &pcalc->iaav; for (i=0, plink=&pcalc->inaa, pavalue=(double **)(&pcalc->aa); i<ARRAY_MAX_FIELDS; i++, plink++, pavalue++, plinkValid++) { if ((*plinkValid==acalcoutINAV_EXT) || (*plinkValid==acalcoutINAV_LOC)) { long nRequest; if (aCalcoutRecordDebug >= 10) printf("acalcoutRecord(%s):fetch_values: field %c%c, pointer=%p\n", pcalc->name, (int)('A'+i), (int)('A'+i), *pavalue); if (*pavalue == NULL) { if (aCalcoutRecordDebug) printf("acalcoutRecord(%s): allocating for field %c%c\n", pcalc->name, (int)('A'+i), (int)('A'+i)); *pavalue = (double *)calloc(pcalc->nelm, sizeof(double)); } /* save current array value */ if (pcalc->paa == NULL) { if (aCalcoutRecordDebug) printf("acalcoutRecord(%s): allocating for field PAA\n", pcalc->name); pcalc->paa = (double *)calloc(pcalc->nelm, sizeof(double)); } for (j=0; j<numElements; j++) pcalc->paa[j] = (*pavalue)[j]; /* get new value */ nRequest = acalcGetNumElements( pcalc ); status = dbGetLink(plink, DBR_DOUBLE, *pavalue, 0, &nRequest); if (!RTN_SUCCESS(status)) return(status); if (nRequest<numElements) { for (j=nRequest; j<numElements; j++) (*pavalue)[j] = 0; } /* compare new array value with saved value */ for (j=0; j<numElements; j++) { if (pcalc->paa[j] != (*pavalue)[j]) {pcalc->newm |= 1<<i; break;} } } } if (aCalcoutRecordDebug >= 10) printf("acalcoutRecord(%s):fetch_values: returning\n", pcalc->name); return(0); }
static long write_lcdout(lcdoutRecord *pstrout) { struct Pin_Info *pin_info = pstrout->dpvt; int handle = pin_info->handle; int bits = pin_info->bits; lcdHome(handle); lcdClear(handle); int dirs = pstrout->dirs; if(dirs == 1) { char *val = pstrout->val; lcdPuts(handle, val); // lcdPrintf(handle, "%s", val); } else { double inpa = 0.0; double inpb = 0.0; double inpc = 0.0; double inpd = 0.0; long status; status = dbGetLink(&(pstrout->inpa), DBF_DOUBLE, &inpa, 0, 0); status = dbGetLink(&(pstrout->inpb), DBF_DOUBLE, &inpb, 0, 0); status = dbGetLink(&(pstrout->inpc), DBF_DOUBLE, &inpc, 0, 0); status = dbGetLink(&(pstrout->inpd), DBF_DOUBLE, &inpd, 0, 0); char *stra = pstrout->stra; char *strb = pstrout->strb; char *strc = pstrout->strc; char *strd = pstrout->strd; char *unia = pstrout->unia; char *unib = pstrout->unib; char *unic = pstrout->unic; char *unid = pstrout->unid; lcdPosition(handle, 0,0); lcdPrintf(handle, "%s%.2f%s", stra, inpa, unia); lcdPosition(handle, 0,1); lcdPrintf(handle, "%s%.2f%s", strb, inpb, unib); if(bits > 2) { lcdPosition(handle, 0,2); lcdPrintf(handle, "%s%.2f%s", strc, inpc, unic); lcdPosition(handle, 0,3); lcdPrintf(handle, "%s%.2f%s", strd, inpd, unid); } } return 0; }
static long process(epidRecord *pepid) { struct epidDSET *pdset = (struct epidDSET *)(pepid->dset); long status; int pact=pepid->pact; if (!pact) { /* If this is not a callback from device support */ /* fetch the setpoint */ if(pepid->smsl == menuOmslclosed_loop) { status = dbGetLink(&(pepid->stpl),DBR_DOUBLE, &(pepid->val),0,0); if (RTN_SUCCESS(status)) pepid->udf=FALSE; } if (pepid->udf == TRUE ) { #if LT_EPICSBASE(3,15,0,2) recGblSetSevr(pepid,UDF_ALARM,INVALID_ALARM); #else recGblSetSevr(pepid,UDF_ALARM,pepid->udfs); #endif return(0); } } status = (*pdset->do_pid)(pepid); /* See if device support set pact=true, meaning it will call us back */ if (!pact && pepid->pact) return(0); pepid->pact = TRUE; recGblGetTimeStamp(pepid); checkAlarms(pepid); monitor(pepid); recGblFwdLink(pepid); pepid->pact=FALSE; return(status); }
static long writeValue(lsoRecord *prec) { long status; lsodset *pdset = (lsodset *) prec->dset; if (prec->pact) goto write; status = dbGetLink(&prec->siml, DBR_USHORT, &prec->simm, 0, 0); if (status) return(status); switch (prec->simm) { case menuYesNoNO: write: status = pdset->write_string(prec); break; case menuYesNoYES: recGblSetSevr(prec, SIMM_ALARM, prec->sims); status = dbPutLink(&prec->siol,DBR_STRING, prec->val,1); break; default: recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM); status = -1; } return status; }
static long writeValue(stringoutRecord *prec) { long status; struct stringoutdset *pdset = (struct stringoutdset *) (prec->dset); if (prec->pact == TRUE){ status=(*pdset->write_stringout)(prec); return(status); } status=dbGetLink(&(prec->siml),DBR_USHORT, &(prec->simm),0,0); if (status) return(status); if (prec->simm == menuYesNoNO){ status=(*pdset->write_stringout)(prec); return(status); } if (prec->simm == menuYesNoYES){ status=dbPutLink(&prec->siol,DBR_STRING, prec->val,1); } else { status=-1; recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM); return(status); } recGblSetSevr(prec,SIMM_ALARM,prec->sims); return(status); }
static long read_histogram(histogramRecord *prec) { long status; status = dbGetLink(&prec->svl,DBR_DOUBLE, &prec->sgnl,0,0); return(0); /*add count*/ }
static long readValue(aiRecord *prec) { long status; aidset *pdset = (aidset *) (prec->dset); if (prec->pact == TRUE){ status=(*pdset->read_ai)(prec); return(status); } status = dbGetLink(&(prec->siml),DBR_USHORT,&(prec->simm),0,0); if (status) return(status); if (prec->simm == menuSimmNO){ status=(*pdset->read_ai)(prec); return(status); } if (prec->simm == menuSimmYES){ status = dbGetLink(&(prec->siol),DBR_DOUBLE,&(prec->sval),0,0); if (status==0){ prec->val=prec->sval; prec->udf=isnan(prec->val); } status=2; /* dont convert */ } else if (prec->simm == menuSimmRAW){ status = dbGetLink(&(prec->siol),DBR_DOUBLE,&(prec->sval),0,0); if (status==0) { prec->udf=isnan(prec->sval); if (!prec->udf) { prec->rval=(long)floor(prec->sval); } } status=0; /* convert since we've written RVAL */ } else { status=-1; recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM); return(status); } recGblSetSevr(prec,SIMM_ALARM,prec->sims); return(status); }
static long read_bi(biRecord *prec) { if (!dbGetLink(&prec->inp, DBR_ULONG, &prec->rval, 0, 0) && prec->tsel.type == CONSTANT && prec->tse == epicsTimeEventDeviceTime) dbGetTimeStamp(&prec->inp, &prec->time); return 0; }
static long process(fanoutRecord *prec) { struct link *plink; unsigned short state; short i; unsigned short monitor_mask; prec->pact = TRUE; /* fetch link selection */ dbGetLink(&(prec->sell),DBR_USHORT,&(prec->seln),0,0); switch (prec->selm){ case (fanoutSELM_All): plink=&(prec->lnk1); state=prec->seln; for ( i=0; i<6; i++, state>>=1, plink++) { if(plink->type!=CONSTANT) dbScanFwdLink(plink); } break; case (fanoutSELM_Specified): if(prec->seln>6) { recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM); break; } if(prec->seln==0) { break; } plink=&(prec->lnk1); plink += (prec->seln-1); dbScanFwdLink(plink); break; case (fanoutSELM_Mask): if(prec->seln==0) { break; } if(prec->seln>63 ) { recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM); break; } plink=&(prec->lnk1); state=prec->seln; for ( i=0; i<6; i++, state>>=1, plink++) { if(state & 1 && plink->type!=CONSTANT) dbScanFwdLink(plink); } break; default: recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM); } prec->udf=FALSE; recGblGetTimeStamp(prec); /* check monitors*/ /* get previous stat and sevr and new stat and sevr*/ monitor_mask = recGblResetAlarms(prec); /* process the forward scan link record */ recGblFwdLink(prec); prec->pact=FALSE; return(0); }
static long read_mbbi(mbbiDirectRecord *prec) { if (!dbGetLink(&prec->inp, DBR_LONG, &prec->rval, 0, 0)) { prec->rval &= prec->mask; if (prec->tsel.type == CONSTANT && prec->tse == epicsTimeEventDeviceTime) dbGetTimeStamp(&prec->inp, &prec->time); } return 0; }
/*----------------------------------------------------------------------*/ static long dsetRead_devSiSyncSoft(stringinRecord *psi) { long status; dsetLog(3, __FILE__ "[%d] -> %s(%s)\n", __LINE__, __func__, psi->name); status = dbGetLink(&psi->inp,DBR_STRING,psi->val,0,0); if(psi->inp.type!=CONSTANT && RTN_SUCCESS(status)) psi->udf=FALSE; dsetLog(3, __FILE__ "[%d] <- %s\n", __LINE__, __func__); return(status); }
static long dsetRead_devMbbiSyncSoft(mbbiRecord *pmbbi) { long status; dsetLog(3, __FILE__ "[%d] -> %s(%s)\n", __LINE__, __func__, pmbbi->name); status = dbGetLink(&pmbbi->inp,DBR_USHORT,&pmbbi->val,0,0); dsetLog(7, __FILE__ "[%d] %d -> %s\n", __LINE__, pmbbi->val, pmbbi->name); if(pmbbi->inp.type!=CONSTANT && RTN_SUCCESS(status)) pmbbi->udf=FALSE; dsetLog(3, __FILE__ "[%d] <- %s\n", __LINE__, __func__); return(DO_NOT_CONVERT); }
static long process(stringoutRecord *prec) { struct stringoutdset *pdset = (struct stringoutdset *)(prec->dset); long status=0; unsigned char pact=prec->pact; if( (pdset==NULL) || (pdset->write_stringout==NULL) ) { prec->pact=TRUE; recGblRecordError(S_dev_missingSup,(void *)prec,"write_stringout"); return(S_dev_missingSup); } if (!prec->pact && (prec->dol.type != CONSTANT) && (prec->omsl == menuOmslclosed_loop)) { status = dbGetLink(&(prec->dol), DBR_STRING,prec->val,0,0); if(prec->dol.type!=CONSTANT && RTN_SUCCESS(status)) prec->udf=FALSE; } if(prec->udf == TRUE ){ recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM); } if (prec->nsev < INVALID_ALARM ) status=writeValue(prec); /* write the new value */ else { switch (prec->ivoa) { case (menuIvoaContinue_normally) : status=writeValue(prec); /* write the new value */ break; case (menuIvoaDon_t_drive_outputs) : break; case (menuIvoaSet_output_to_IVOV) : if(prec->pact == FALSE){ strcpy(prec->val,prec->ivov); } status=writeValue(prec); /* write the new value */ break; default : status=-1; recGblRecordError(S_db_badField,(void *)prec, "stringout:process Illegal IVOA field"); } } /* check if device support set pact */ if ( !pact && prec->pact ) return(0); prec->pact = TRUE; recGblGetTimeStamp(prec); monitor(prec); recGblFwdLink(prec); prec->pact=FALSE; return(status); }
static long readInputs(struct cvtRecord *pcvt) { long status; double old; old = pcvt->x; status = dbGetLink(&pcvt->inpx, DBR_DOUBLE, &pcvt->x, 0, 0); if (status) { recGblSetSevr(pcvt, LINK_ALARM, INVALID_ALARM); return status; } if (old != pcvt->x) { pcvt->drty |= DRTY_X; } old = pcvt->y; status = dbGetLink(&pcvt->inpy, DBR_DOUBLE, &pcvt->y, 0, 0); if (status) { recGblSetSevr(pcvt, LINK_ALARM, INVALID_ALARM); return status; } if (old != pcvt->y) { pcvt->drty |= DRTY_Y; } status = dbGetLink(&pcvt->iaml, DBR_ENUM, &pcvt->iaom, 0, 0); if (status) { recGblSetSevr(pcvt, LINK_ALARM, INVALID_ALARM); return status; } if (pcvt->iaom) { status = dbGetLink(&pcvt->iavl, DBR_DOUBLE, &pcvt->iaov, 0, 0); if (status) { recGblSetSevr(pcvt, LINK_ALARM, INVALID_ALARM); return status; } pcvt->val = pcvt->iaov; } return 0; }
static long read_bi(biRecord *prec) { if (!dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0)) { if (prec->inp.type != CONSTANT) prec->udf = FALSE; if (prec->tsel.type == CONSTANT && prec->tse == epicsTimeEventDeviceTime) dbGetTimeStamp(&prec->inp, &prec->time); } return 2; }
static long dsetRead_devAiSyncSoft(aiRecord *pai) { long status; dsetLog(3, __FILE__ "[%d] -> %s(%s)\n", __LINE__, __func__, pai->name); status = dbGetLink(&(pai->inp),DBR_DOUBLE, &(pai->val),0,0); if (pai->inp.type!=CONSTANT && RTN_SUCCESS(status)) pai->udf = FALSE; dsetLog(3, __FILE__ "[%d] <- %s\n", __LINE__, __func__); return(DO_NOT_CONVERT); }
static long fetch_values(subRecord *prec) { struct link *plink = &prec->inpa; double *pvalue = &prec->a; int i; for (i = 0; i < INP_ARG_MAX; i++, plink++, pvalue++) { if (dbGetLink(plink, DBR_DOUBLE, pvalue, 0, 0)) return -1; } return 0; }
/*----------------------------------------------------------------------*/ static long dsetRead_devBiSyncSoft(biRecord *pbi) { long status; dsetLog(3, __FILE__ "[%d] -> %s(%s)\n", __LINE__, __func__, pbi->name); status = dbGetLink(&pbi->inp, DBR_USHORT, &pbi->val,0,0); if(pbi->inp.type!=CONSTANT && RTN_SUCCESS(status)) pbi->udf=FALSE; dsetLog(2, __FILE__ "[%d] %s --(%d)-> %s\n", __LINE__, pbi->inp.value.instio.string, pbi->val, pbi->name); dsetLog(3, __FILE__ "[%d] <- %s\n", __LINE__, __func__); return(DO_NOT_CONVERT); }
static long process(compressRecord *prec) { long status=0; long nelements = 0; int alg = prec->alg; prec->pact = TRUE; if(!dbIsLinkConnected(&prec->inp) || dbGetNelements(&prec->inp,&nelements) || nelements<=0) { recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM); } else { if(!prec->wptr || nelements!=prec->inpn) { if(prec->wptr) { free(prec->wptr); reset(prec); } prec->wptr = (double *)dbCalloc(nelements,sizeof(double)); prec->inpn = nelements; } status = dbGetLink(&prec->inp,DBF_DOUBLE,prec->wptr,0,&nelements); if(status || nelements<=0) { recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM); status = 0; } else { if(alg==compressALG_Average) { status = array_average(prec,prec->wptr,nelements); } else if(alg==compressALG_Circular_Buffer) { (void)put_value(prec,prec->wptr,nelements); status = 0; } else if(nelements>1) { status = compress_array(prec,prec->wptr,nelements); }else if(nelements==1){ status = compress_scalar(prec,prec->wptr); }else status=1; } } /* check event list */ if(status!=1) { prec->udf=FALSE; recGblGetTimeStamp(prec); monitor(prec); /* process the forward scan link record */ recGblFwdLink(prec); } prec->pact=FALSE; return(0); }
static int fetch_values(calcoutRecord *prec) { DBLINK *plink; /* structure of the link field */ double *pvalue; long status = 0; int i; for (i = 0, plink = &prec->inpa, pvalue = &prec->a; i<CALCPERFORM_NARGS; i++, plink++, pvalue++) { int newStatus; newStatus = dbGetLink(plink, DBR_DOUBLE, pvalue, 0, 0); if (!status) status = newStatus; } return(status); }
/*----------------------------------------------------------------------*/ static long dsetRead_devSiSyncSoft(stringinRecord *pstringin) { long status; #ifdef DEBUG1 printf( __FILE__ "[%d] -> %s(%s)\n", __LINE__, __func__,pstringin->name); #endif status = dbGetLink(&pstringin->inp,DBR_STRING,pstringin->val,0,0); if(pstringin->inp.type!=CONSTANT && RTN_SUCCESS(status)) pstringin->udf=FALSE; #ifdef DEBUG1 printf( __FILE__ "[%d] <- %s(%ld)\n", __LINE__, __func__, status); #endif return(status); }
/***************************************************************************** * * Link-group processing function. * * if the input link is not a constant * call dbGetLink() to get the link value * else * get the value from the DOV field * call dbPutLink() to forward the value to destination location * call processNextLink() to schedule the processing of the next link-group * * NOTE: * dbScanLock is NOT held for prec when this function is called!! * ******************************************************************************/ static void processCallback(CALLBACK *arg) { callbackSeq *pcb; seqRecord *prec; double myDouble; callbackGetUser(pcb,arg); prec = pcb->pseqRecord; dbScanLock((struct dbCommon *)prec); if (seqRecDebug > 5) printf("processCallback(%s) processing field index %d\n", prec->name, pcb->index+1); /* Save the old value */ myDouble = pcb->plinks[pcb->index]->dov; dbGetLink(&(pcb->plinks[pcb->index]->dol), DBR_DOUBLE, &(pcb->plinks[pcb->index]->dov),0,0); recGblGetTimeStamp(prec); /* Dump the value to the destination field */ dbPutLink(&(pcb->plinks[pcb->index]->lnk), DBR_DOUBLE, &(pcb->plinks[pcb->index]->dov),1); if (myDouble != pcb->plinks[pcb->index]->dov) { if (seqRecDebug > 0) printf("link %d changed from %f to %f\n", pcb->index, myDouble, pcb->plinks[pcb->index]->dov); db_post_events(prec, &pcb->plinks[pcb->index]->dov, DBE_VALUE|DBE_LOG); } else { if (seqRecDebug > 0) printf("link %d not changed... %f\n", pcb->index, pcb->plinks[pcb->index]->dov); } /* Find the 'next' link-seq that is ready for processing. */ pcb->index++; processNextLink(prec); dbScanUnlock((struct dbCommon *)prec); return; }
static long read_event(eventRecord *prec) { long status; char newEvent[MAX_STRING_SIZE]; if (prec->inp.type != CONSTANT) { status = dbGetLink(&prec->inp, DBR_STRING, newEvent, 0, 0); if (status) return status; if (strcmp(newEvent, prec->val) != 0) { strcpy(prec->val, newEvent); prec->epvt = eventNameToHandle(prec->val); } } prec->udf = FALSE; if (prec->tsel.type == CONSTANT && prec->tse == epicsTimeEventDeviceTime) dbGetTimeStamp(&prec->inp, &prec->time); return 0; }
long snmp_Read(void *precord) { snmpRecord *psnmp = (snmpRecord *)precord; long status; /* printf("SNMP Read\n"); */ /* gpSnmp = psnmp; */ /* snmp_get(psnmp); */ status = dbGetLink(&(psnmp->inp),DBF_DOUBLE, &(psnmp->val),0,0); /*If return was succesful then set undefined false*/ if(!status) psnmp->udf = FALSE; printf("SNMP Read\n"); gpSnmp = psnmp; snmp_get(psnmp); return(0); }
void recGblGetTimeStamp(void *pvoid) { dbCommon* prec = (dbCommon*)pvoid; struct link *plink = &prec->tsel; if (plink->type != CONSTANT) { struct pv_link *ppv_link = &plink->value.pv_link; if (ppv_link->pvlMask & pvlOptTSELisTime) { if (dbGetTimeStamp(plink, &prec->time)) errlogPrintf("recGblGetTimeStamp: dbGetTimeStamp failed, %s.TSEL = %s\n", prec->name, ppv_link->pvname); return; } dbGetLink(&prec->tsel, DBR_SHORT, &prec->tse, 0, 0); } if (prec->tse != epicsTimeEventDeviceTime) { if (epicsTimeGetEvent(&prec->time, prec->tse)) errlogPrintf("recGblGetTimeStamp: epicsTimeGetEvent failed, %s.TSE = %d\n", prec->name, prec->tse); } }
static long fetch_value(aoRecord *prec,double *pvalue) { short save_pact; long status; save_pact = prec->pact; prec->pact = TRUE; /* don't allow dbputs to val field */ prec->val=prec->pval; status = dbGetLink(&prec->dol,DBR_DOUBLE,pvalue,0,0); prec->pact = save_pact; if (status) { recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM); return(status); } if (prec->oif == aoOIF_Incremental) *pvalue += prec->val; return(0); }