From fc17801360eb67eefa8cf0b81b5a7e54e5d0d6f2 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Fri, 17 Apr 1992 12:41:48 +0000 Subject: [PATCH] jba pact now used to test for asyn processing, not status --- src/rec/recAi.c | 11 ++++++----- src/rec/recAo.c | 9 ++++++--- src/rec/recBi.c | 10 ++++++---- src/rec/recBo.c | 11 +++++++---- src/rec/recEvent.c | 10 +++++----- src/rec/recHistogram.c | 13 ++++++------- src/rec/recLongin.c | 9 +++++---- src/rec/recLongout.c | 9 +++++---- src/rec/recMbbi.c | 8 ++++++-- src/rec/recMbbo.c | 8 +++++--- src/rec/recPulseCounter.c | 9 +++++---- src/rec/recPulseDelay.c | 9 +++++---- src/rec/recPulseTrain.c | 8 +++++--- src/rec/recStringin.c | 9 +++++---- src/rec/recStringout.c | 9 +++++---- src/rec/recSub.c | 6 +++--- src/rec/recWaveform.c | 13 ++++++++----- 17 files changed, 93 insertions(+), 68 deletions(-) diff --git a/src/rec/recAi.c b/src/rec/recAi.c index 597852692..5758ab122 100644 --- a/src/rec/recAi.c +++ b/src/rec/recAi.c @@ -61,6 +61,7 @@ * .21 02-05-92 jba Changed function arguments from paddr to precord * .22 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .23 02-28-92 jba ANSI C changes + * .24 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -125,8 +126,7 @@ struct aidset { /* analog input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_ai;/*(0,1,2)=> success and */ - /*(convert,don't continue, don't convert)*/ + DEVSUPFUN read_ai;/*(0,2)=> success and convert,don't convert)*/ /* if convert then raw value stored in rval */ DEVSUPFUN special_linconv; }; @@ -168,6 +168,7 @@ static long process(pai) { struct aidset *pdset = (struct aidset *)(pai->dset); long status; + unsigned char pact=pai->pact; if( (pdset==NULL) || (pdset->read_ai==NULL) ) { pai->pact=TRUE; @@ -184,11 +185,11 @@ static long process(pai) } } - /*pact must not be set true until read_ai is called*/ status=(*pdset->read_ai)(pai); /* read the new value */ + /* check if device support set pact */ + if ( !pact && pai->pact ) return(0); pai->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); + tsLocalTime(&pai->time); if (status==0) convert(pai); else if (status==2) status=0; diff --git a/src/rec/recAo.c b/src/rec/recAo.c index 805b0f07c..cb93075f5 100644 --- a/src/rec/recAo.c +++ b/src/rec/recAo.c @@ -55,6 +55,7 @@ * .22 02-05-92 jba Changed function arguments from paddr to precord * .23 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .24 02-28-92 jba ANSI C changes + * .25 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -118,8 +119,7 @@ struct aodset { /* analog input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (0,2)=>(success,success no convert)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_ao;/*(0,1)=>success and */ - /*(continue, don`t continue) */ + DEVSUPFUN write_ao;/*(0)=>(success ) */ DEVSUPFUN special_linconv; }; @@ -193,6 +193,7 @@ static long process(pao) { struct aodset *pdset = (struct aodset *)(pao->dset); long status=0; + unsigned char pact=pao->pact; if( (pdset==NULL) || (pdset->write_ao==NULL) ) { pao->pact=TRUE; @@ -205,8 +206,10 @@ static long process(pao) } else { status=(*pdset->write_ao)(pao); } + /* check if device support set pact */ + if ( !pact && pao->pact ) return(0); pao->pact = TRUE; - if(status==1) return(0); + tsLocalTime(&pao->time); /* check for alarms */ diff --git a/src/rec/recBi.c b/src/rec/recBi.c index 22068f636..35292492e 100644 --- a/src/rec/recBi.c +++ b/src/rec/recBi.c @@ -48,6 +48,7 @@ * .14 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .15 02-05-92 jba Changed function arguments from paddr to precord * .16 02-28-92 jba ANSI C changes + * .17 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -108,8 +109,7 @@ struct bidset { /* binary input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_bi;/*(0,1,2)=> success and */ - /*(convert,don't continue, don't convert)*/ + DEVSUPFUN read_bi;/*(0,2)=> success and convert, don't convert)*/ /* if convert then raw value stored in rval */ }; void alarm(); @@ -141,6 +141,7 @@ static long process(pbi) { struct bidset *pdset = (struct bidset *)(pbi->dset); long status; + unsigned char pact=pbi->pact; if( (pdset==NULL) || (pdset->read_bi==NULL) ) { pbi->pact=TRUE; @@ -149,9 +150,10 @@ static long process(pbi) } status=(*pdset->read_bi)(pbi); /* read the new value */ + /* check if device support set pact */ + if ( !pact && pbi->pact ) return(0); pbi->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); + tsLocalTime(&pbi->time); if(status==0) { /* convert rval to val */ if(pbi->rval==0) pbi->val =0; diff --git a/src/rec/recBo.c b/src/rec/recBo.c index 5566eafe4..950e69dae 100644 --- a/src/rec/recBo.c +++ b/src/rec/recBo.c @@ -56,6 +56,7 @@ * .20 02-05-92 jba Changed function arguments from paddr to precord * .21 02-28-92 jba ANSI C changes * .22 03-03-92 jba Changed callback handling + * .23 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -122,7 +123,7 @@ struct bodset { /* binary output dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns:(0,2)=>(success,success no convert*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_bo;/*returns: (-1,0,1)=>(failure,success,don't continue)*/ + DEVSUPFUN write_bo;/*returns: (-1,0)=>(failure,success)*/ }; @@ -196,6 +197,7 @@ static long process(pbo) struct bodset *pdset = (struct bodset *)(pbo->dset); long status=0; int wait_time; + unsigned char pact=pbo->pact; if( (pdset==NULL) || (pdset->write_bo==NULL) ) { pbo->pact=TRUE; @@ -222,14 +224,15 @@ static long process(pbo) if ( pbo->mask != 0 ) { if(pbo->val==0) pbo->rval = 0; else pbo->rval = pbo->mask; - } + } else pbo->rval = (unsigned long)pbo->val; } if(status==0) { status=(*pdset->write_bo)(pbo); /* write the new value */ } + /* check if device support set pact */ + if ( !pact && pbo->pact ) return(0); pbo->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if(status==1) return(0); + tsLocalTime(&pbo->time); wait_time = (int)((pbo->high) * vxTicksPerSecond); /* seconds to ticks */ if(pbo->val==1 && wait_time>0) { diff --git a/src/rec/recEvent.c b/src/rec/recEvent.c index 4aee3d88b..42e5f0ed4 100644 --- a/src/rec/recEvent.c +++ b/src/rec/recEvent.c @@ -31,6 +31,7 @@ * ----------------- 4 .00 12-13-91 jba Initial definition * .01 02-28-92 jba ANSI C changes + * .02 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -46,7 +47,6 @@ #include #include #include -#include #include /* Create RSET - Record Support Entry Table*/ @@ -94,7 +94,7 @@ struct eventdset { /* event input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_event;/*(0,1)=> success, async */ + DEVSUPFUN read_event;/*(0)=> success */ }; void monitor(); @@ -114,13 +114,13 @@ static long process(pevent) { struct eventdset *pdset = (struct eventdset *)(pevent->dset); long status=0; + unsigned char pact=pevent->pact; if((pdset!=NULL) && (pdset->number >= 5) && pdset->read_event ) status=(*pdset->read_event)(pevent); /* read the new value */ + /* check if device support set pact */ + if ( !pact && pevent->pact ) return(0); pevent->pact = TRUE; - - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); if(pevent->val>0) post_event((int)pevent->val); diff --git a/src/rec/recHistogram.c b/src/rec/recHistogram.c index 89c4b139f..98b329442 100644 --- a/src/rec/recHistogram.c +++ b/src/rec/recHistogram.c @@ -32,6 +32,7 @@ * .01 10-14-91 jba Added dev sup crtl fld and wd timer * .02 02-05-92 jba Changed function arguments from paddr to precord * .03 02-28-92 jba ANSI C changes + * .04 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -100,8 +101,7 @@ struct histogramdset { /* histogram input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_histogram;/*(0,1,2)=> success and */ - /*(add_count,don't continue, don't add_count)*/ + DEVSUPFUN read_histogram;/*(0,2)=> success and add_count, don't add_count)*/ /* if add_count then sgnl added to array */ DEVSUPFUN special_linconv; }; @@ -157,6 +157,7 @@ static long init_record(phistogram) /* This routine may get called twice. Once by cvt_dbaddr. Once by iocInit*/ + pcallback->process = process; if(phistogram->wdog==NULL && phistogram->sdel!=0) { /* initialize a watchdog timer */ pcallback = (struct callback *)(calloc(1,sizeof(struct callback))); @@ -168,7 +169,6 @@ static long init_record(phistogram) exit(1); } pcallback->wd_id = wdCreate(); - pcallback->process = process; /* start new watchdog timer on monitor */ wait_time = (float)(phistogram->sdel * vxTicksPerSecond); @@ -206,6 +206,7 @@ static long process(phistogram) { struct histogramdset *pdset = (struct histogramdset *)(phistogram->dset); long status; + unsigned char pact=phistogram->pact; if( (pdset==NULL) || (pdset->read_histogram==NULL) ) { phistogram->pact=TRUE; @@ -213,13 +214,11 @@ static long process(phistogram) return(S_dev_missingSup); } - /*pact must not be set true until read_histogram is called*/ status=(*pdset->read_histogram)(phistogram); + /* check if device support set pact */ + if ( !pact && phistogram->pact ) return(0); phistogram->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - tsLocalTime(&phistogram->time); if(status==0)add_count(phistogram); diff --git a/src/rec/recLongin.c b/src/rec/recLongin.c index 864f4b51a..b79c87ac6 100644 --- a/src/rec/recLongin.c +++ b/src/rec/recLongin.c @@ -33,6 +33,7 @@ * .02 02-05-92 jba Changed function arguments from paddr to precord * .03 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .04 02-28-92 jba ANSI C changes + * .04 04-10-92 jba pact now used to test for asyn processing, not status */ @@ -97,7 +98,7 @@ struct longindset { /* longin input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_longin;/*(0,1)=> success, async */ + DEVSUPFUN read_longin; /*returns: (-1,0)=>(failure,success)*/ }; void alarm(); void monitor(); @@ -128,6 +129,7 @@ static long process(plongin) { struct longindset *pdset = (struct longindset *)(plongin->dset); long status; + unsigned char pact=plongin->pact; if( (pdset==NULL) || (pdset->read_longin==NULL) ) { plongin->pact=TRUE; @@ -136,11 +138,10 @@ static long process(plongin) } status=(*pdset->read_longin)(plongin); /* read the new value */ + /* check if device support set pact */ + if ( !pact && plongin->pact ) return(0); plongin->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - tsLocalTime(&plongin->time); /* check for alarms */ diff --git a/src/rec/recLongout.c b/src/rec/recLongout.c index 188af9ea9..fc1b7be55 100644 --- a/src/rec/recLongout.c +++ b/src/rec/recLongout.c @@ -32,6 +32,7 @@ * .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .02 02-05-92 jba Changed function arguments from paddr to precord * .03 02-28-92 jba ANSI C changes + * .04 04-10-92 jba pact now used to test for asyn processing, not status */ @@ -96,7 +97,7 @@ struct longoutdset { /* longout input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_longout;/*(-1,0,1)=>(failure,success,don't Continue*/ + DEVSUPFUN write_longout;/*(-1,0)=>(failure,success*/ }; void alarm(); int convert(); @@ -133,6 +134,7 @@ static long process(plongout) { struct longoutdset *pdset = (struct longoutdset *)(plongout->dset); long status=0; + unsigned char pact=plongout->pact; if( (pdset==NULL) || (pdset->write_longout==NULL) ) { plongout->pact=TRUE; @@ -157,11 +159,10 @@ static long process(plongout) if(status==0) { status=(*pdset->write_longout)(plongout); /* write the new value */ } + /* check if device support set pact */ + if ( !pact && plongout->pact ) return(0); plongout->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - tsLocalTime(&plongout->time); /* check for alarms */ diff --git a/src/rec/recMbbi.c b/src/rec/recMbbi.c index 95644bbe3..d6e17f33f 100644 --- a/src/rec/recMbbi.c +++ b/src/rec/recMbbi.c @@ -49,6 +49,7 @@ * .14 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .15 02-05-92 jba Changed function arguments from paddr to precord * .16 02-28-92 jba ANSI C changes + * .17 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -111,7 +112,7 @@ struct mbbidset { /* multi bit binary input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_mbbi;/*(0,1,2)=>(success, asyn, success no convert)*/ + DEVSUPFUN read_mbbi;/*(0,2)=>(success, success no convert)*/ }; void alarm(); void monitor(); @@ -168,6 +169,7 @@ static long process(pmbbi) { struct mbbidset *pdset = (struct mbbidset *)(pmbbi->dset); long status; + unsigned char pact=pmbbi->pact; if( (pdset==NULL) || (pdset->read_mbbi==NULL) ) { pmbbi->pact=TRUE; @@ -176,8 +178,10 @@ static long process(pmbbi) } status=(*pdset->read_mbbi)(pmbbi); /* read the new value */ + /* check if device support set pact */ + if ( !pact && pmbbi->pact ) return(0); pmbbi->pact = TRUE; - if (status==1) return(0); + tsLocalTime(&pmbbi->time); if(status==0) { /* convert the value */ unsigned long *pstate_values; diff --git a/src/rec/recMbbo.c b/src/rec/recMbbo.c index cb3188e76..c3cc8551d 100644 --- a/src/rec/recMbbo.c +++ b/src/rec/recMbbo.c @@ -52,6 +52,7 @@ * .17 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .18 02-05-92 jba Changed function arguments from paddr to precord * .19 02-28-92 jba ANSI C changes + * .20 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -115,7 +116,7 @@ struct mbbodset { /* multi bit binary output dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (0,2)=>(success,success no convert)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_mbbo;/*(0,1)=>(success,don't Continue*/ + DEVSUPFUN write_mbbo; /*returns: (0,2)=>(success,success no convert)*/ }; @@ -205,6 +206,7 @@ static long process(pmbbo) { struct mbbodset *pdset = (struct mbbodset *)(pmbbo->dset); long status=0; + unsigned char pact=pmbbo->pact; if( (pdset==NULL) || (pdset->write_mbbo==NULL) ) { pmbbo->pact=TRUE; @@ -249,10 +251,10 @@ static long process(pmbbo) status=(*pdset->write_mbbo)(pmbbo); /* write the new value */ DONT_WRITE: + /* check if device support set pact */ + if ( !pact && pmbbo->pact ) return(0); pmbbo->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if(status==1) return(0); tsLocalTime(&pmbbo->time); /* check for alarms */ alarm(pmbbo); diff --git a/src/rec/recPulseCounter.c b/src/rec/recPulseCounter.c index 4cfc4dd97..5be1b0d05 100644 --- a/src/rec/recPulseCounter.c +++ b/src/rec/recPulseCounter.c @@ -32,6 +32,7 @@ * .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .02 02-05-92 jba Changed function arguments from paddr to precord * .03 02-28-92 jba ANSI C changes + * .04 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -95,7 +96,7 @@ struct pcdset { /* pulseCounter input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN cmd_pc;/*(-1,0,1)=>(failure,success,don't Continue*/ + DEVSUPFUN cmd_pc;/*(-1,0)=>(failure,success*/ }; /* def for gsrc field */ @@ -145,6 +146,7 @@ static long process(ppc) long status=0; long options,nRequest; unsigned short save; + unsigned char pact=ppc->pact; /* must have cmd_pc functions defined */ if( (pdset==NULL) || (pdset->cmd_pc==NULL) ) { @@ -191,11 +193,10 @@ static long process(ppc) } if (status==0) status=(*pdset->cmd_pc)(ppc); + /* check if device support set pact */ + if ( !pact && ppc->pact ) return(0); ppc->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - ppc->udf=FALSE; tsLocalTime(&ppc->time); diff --git a/src/rec/recPulseDelay.c b/src/rec/recPulseDelay.c index 4a501eec0..93ad579dc 100644 --- a/src/rec/recPulseDelay.c +++ b/src/rec/recPulseDelay.c @@ -33,6 +33,7 @@ * .02 02-05-92 jba Changed function arguments from paddr to precord * .03 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .04 02-28-92 jba ANSI C changes + * .05 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -96,7 +97,7 @@ struct pddset { /* pulseDelay input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_pd;/*(-1,0,1)=>(failure,success,don't Continue*/ + DEVSUPFUN write_pd;/*(-1,0)=>(failure,success*/ }; void monitor(); @@ -129,6 +130,7 @@ static long process(ppd) { struct pddset *pdset = (struct pddset *)(ppd->dset); long status=0; + unsigned char pact=ppd->pact; /* must have write_pd functions defined */ if( (pdset==NULL) || (pdset->write_pd==NULL) ) { @@ -139,11 +141,10 @@ static long process(ppd) if (status==0) status=(*pdset->write_pd)(ppd); /* write the new value */ + /* check if device support set pact */ + if ( !pact && ppd->pact ) return(0); ppd->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - ppd->udf=FALSE; tsLocalTime(&ppd->time); diff --git a/src/rec/recPulseTrain.c b/src/rec/recPulseTrain.c index bacc65da7..a518559a3 100644 --- a/src/rec/recPulseTrain.c +++ b/src/rec/recPulseTrain.c @@ -34,6 +34,7 @@ * .03 02-05-92 jba Changed function arguments from paddr to precord * .04 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .05 02-28-92 jba ANSI C changes + * .06 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -97,7 +98,7 @@ struct ptdset { /* pulseTrain input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_pt;/*(-1,0,1)=>(failure,success,don't Continue*/ + DEVSUPFUN write_pt;/*(-1,0)=>(failure,success)*/ }; /* def for gsrc field */ @@ -147,6 +148,7 @@ static long process(ppt) long status=0; long options,nRequest; double save; + unsigned char pact=ppt->pact; /* must have write_pt functions defined */ @@ -189,10 +191,10 @@ static long process(ppt) if (status==0 && (ppt->gsrc!=SOFTWARE || ppt->sgv!=0)) status=(*pdset->write_pt)(ppt); + /* check if device support set pact */ + if ( !pact && ppt->pact ) return(0); ppt->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); if(status==-1)status = 0; ppt->udf=FALSE; diff --git a/src/rec/recStringin.c b/src/rec/recStringin.c index d1320ed5d..5c5f83524 100644 --- a/src/rec/recStringin.c +++ b/src/rec/recStringin.c @@ -32,6 +32,7 @@ * .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .02 02-05-92 jba Changed function arguments from paddr to precord * .03 02-28-92 jba ANSI C changes + * .04 04-10-92 jba pact now used to test for asyn processing, not status */ @@ -95,7 +96,7 @@ struct stringindset { /* stringin input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_stringin;/*(0,1)=> success, async */ + DEVSUPFUN read_stringin; /*returns: (-1,0)=>(failure,success)*/ }; void monitor(); @@ -125,6 +126,7 @@ static long process(pstringin) { struct stringindset *pdset = (struct stringindset *)(pstringin->dset); long status; + unsigned char pact=pstringin->pact; if( (pdset==NULL) || (pdset->read_stringin==NULL) ) { pstringin->pact=TRUE; @@ -133,11 +135,10 @@ static long process(pstringin) } status=(*pdset->read_stringin)(pstringin); /* read the new value */ + /* check if device support set pact */ + if ( !pact && pstringin->pact ) return(0); pstringin->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - tsLocalTime(&pstringin->time); /* check event list */ diff --git a/src/rec/recStringout.c b/src/rec/recStringout.c index ad749db75..7fed867e5 100644 --- a/src/rec/recStringout.c +++ b/src/rec/recStringout.c @@ -33,6 +33,7 @@ * .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .03 02-05-92 jba Changed function arguments from paddr to precord * .04 02-28-92 jba ANSI C changes + * .05 04-10-92 jba pact now used to test for asyn processing, not status */ @@ -96,7 +97,7 @@ struct stringoutdset { /* stringout input dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN write_stringout;/*(-1,0,1)=>(failure,success,don't Continue*/ + DEVSUPFUN write_stringout;/*(-1,0)=>(failure,success)*/ }; void monitor(); @@ -133,6 +134,7 @@ static long process(pstringout) { struct stringoutdset *pdset = (struct stringoutdset *)(pstringout->dset); long status=0; + unsigned char pact=pstringout->pact; if( (pdset==NULL) || (pdset->write_stringout==NULL) ) { pstringout->pact=TRUE; @@ -158,11 +160,10 @@ static long process(pstringout) if(status==0) { status=(*pdset->write_stringout)(pstringout); /* write the new value */ } + /* check if device support set pact */ + if ( !pact && pstringout->pact ) return(0); pstringout->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if (status==1) return(0); - tsLocalTime(&pstringout->time); /* check event list */ diff --git a/src/rec/recSub.c b/src/rec/recSub.c index 6ffc47267..0c6bbc38b 100644 --- a/src/rec/recSub.c +++ b/src/rec/recSub.c @@ -36,7 +36,7 @@ * .04 02-05-92 jba Changed function arguments from paddr to precord * .05 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .06 02-28-92 jba ANSI C changes - + * .07 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -125,7 +125,7 @@ static long init_record(psub) strcpy(temp,"_"); } strcat(temp,psub->inam); - ret = symFindByName(sysSymTbl,temp,&psub->sadr,(void *)&sub_type); + ret = symFindByName(sysSymTbl,temp,(void *)&psub->sadr,(void *)&sub_type); if ((ret !=OK) || ((sub_type & N_TEXT) == 0)){ recGblRecordError(S_db_BadSub,psub,"recSub(init_record)"); return(S_db_BadSub); @@ -142,7 +142,7 @@ static long init_record(psub) strcpy(temp,"_"); } strcat(temp,psub->snam); - ret = symFindByName(sysSymTbl,temp,&psub->sadr,(void *)&sub_type); + ret = symFindByName(sysSymTbl,temp,(void *)&psub->sadr,(void *)&sub_type); if ((ret < 0) || ((sub_type & N_TEXT) == 0)){ recGblRecordError(S_db_BadSub,psub,"recSub(init_record)"); return(S_db_BadSub); diff --git a/src/rec/recWaveform.c b/src/rec/recWaveform.c index f99e74b4b..19daf53de 100644 --- a/src/rec/recWaveform.c +++ b/src/rec/recWaveform.c @@ -53,6 +53,7 @@ * .13 02-05-92 jba Changed function arguments from paddr to precord * .14 02-28-92 jba Changed get_precision,get_graphic_double,get_control_double * .15 02-28-92 jba ANSI C changes + * .16 04-10-92 jba pact now used to test for asyn processing, not status */ #include @@ -117,8 +118,7 @@ struct wfdset { /* waveform dset */ DEVSUPFUN init; DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/ DEVSUPFUN get_ioint_info; - DEVSUPFUN read_wf;/*(0,1)=> success and */ - /*(convert,don't continue)*/ + DEVSUPFUN read_wf; /*returns: (-1,0)=>(failure,success)*/ }; /*sizes of field types*/ @@ -168,6 +168,7 @@ static long process(pwf) { struct wfdset *pdset = (struct wfdset *)(pwf->dset); long status; + unsigned char pact=pwf->pact; if( (pdset==NULL) || (pdset->read_wf==NULL) ) { pwf->pact=TRUE; @@ -184,11 +185,13 @@ static long process(pwf) } } - /*pact must not be set true until read_wf completes*/ + if ( pact && pwf->busy ) return(0); + status=(*pdset->read_wf)(pwf); /* read the new value */ + /* check if device support set pact */ + if ( !pact && pwf->pact ) return(0); pwf->pact = TRUE; - /* status is one if an asynchronous record is being processed*/ - if(status==1) return(0); + pwf->udf=FALSE; tsLocalTime(&pwf->time);