diff --git a/src/dev/devAiDvx2502.c b/src/dev/devAiDvx2502.c index 47533b6f9..0917abb33 100644 --- a/src/dev/devAiDvx2502.c +++ b/src/dev/devAiDvx2502.c @@ -1,5 +1,5 @@ /* devAiDvx2502.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiDvx2502.c - Device Support Routines */ /* diff --git a/src/dev/devAiKscV215.c b/src/dev/devAiKscV215.c index ebbbaf869..00ae98140 100644 --- a/src/dev/devAiKscV215.c +++ b/src/dev/devAiKscV215.c @@ -1,5 +1,5 @@ /* devAiKscV215.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* * Original Author: Bob Dalesio diff --git a/src/dev/devAiSoft.c b/src/dev/devAiSoft.c index afe8fc45f..6aa1b505e 100644 --- a/src/dev/devAiSoft.c +++ b/src/dev/devAiSoft.c @@ -1,5 +1,5 @@ /* devAiSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiSoft.c - Device Support Routines for soft Analog Input Records*/ /* @@ -73,7 +73,7 @@ struct { init_record, NULL, read_ai, - NULL}; + NULL }; static long init_record(pai) @@ -86,32 +86,37 @@ static long init_record(pai) case (CONSTANT) : pai->val = pai->inp.value.value; pai->udf = FALSE; + break; case (PV_LINK) : - status = dbCaAddInlink(&(pai->inp), (void *) pai, "VAL"); - if(status) return(status); - break; case (DB_LINK) : + status = recGblInitFastInLink(&(pai->inp), (struct dbCommon *) pai, + DBR_DOUBLE, "VAL"); + + if (status) + return(status); + break; default : - recGblRecordError(S_db_badField,(void *)pai, + recGblRecordError(S_db_badField, (void *)pai, "devAiSoft (init_record) Illegal INP field"); + return(S_db_badField); } /* Make sure record processing routine does not perform any conversion*/ - pai->linr=0; + pai->linr = 0; return(0); } static long read_ai(pai) struct aiRecord *pai; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(pai->inp),(void *)pai,DBR_DOUBLE,&(pai->val), - &options,&nRequest); + status = recGblGetFastLink(&(pai->inp), (void *) pai, &(pai->val)); - if(RTN_SUCCESS(status)) pai->udf=FALSE; + if (RTN_SUCCESS(status)) + pai->udf = FALSE; return(2); /*don't convert*/ } diff --git a/src/dev/devAiSoftRaw.c b/src/dev/devAiSoftRaw.c index 4f2394945..d68436765 100644 --- a/src/dev/devAiSoftRaw.c +++ b/src/dev/devAiSoftRaw.c @@ -1,5 +1,5 @@ /* devAiSoftRaw.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiSoftRaw.c - Device Support Routines for soft Analog Input Records*/ /* @@ -88,12 +88,9 @@ static long init_record(pai) pai->rval = pai->inp.value.value; break; case (PV_LINK) : - status = dbCaAddInlink(&(pai->inp), (void *) pai, "RVAL"); - if(status) return(status); - break; case (DB_LINK) : - break; - case (CA_LINK) : + status = recGblInitFastInLink(&(pai->inp), (void *) pai, DBR_LONG, "RVAL"); + if(status) return(status); break; default : recGblRecordError(S_db_badField,(void *)pai, @@ -106,10 +103,9 @@ static long init_record(pai) static long read_ai(pai) struct aiRecord *pai; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(pai->inp),(void *)pai,DBR_LONG,&(pai->rval), - &options,&nRequest); + status = recGblGetFastLink(&(pai->inp),(void *)pai,&(pai->rval)); return(0); } diff --git a/src/dev/devAiSymb.c b/src/dev/devAiSymb.c index c3f8b77c7..aa4d03c58 100644 --- a/src/dev/devAiSymb.c +++ b/src/dev/devAiSymb.c @@ -1,3 +1,5 @@ +/* base/src/dev $Id$ */ + /* @(#)devAiSymb.c 1.1 6/4/93 * Device Support for VxWorks Global Symbol Analog Input Records * diff --git a/src/dev/devAiTestAsyn.c b/src/dev/devAiTestAsyn.c index 0165959fb..b3db29ac5 100644 --- a/src/dev/devAiTestAsyn.c +++ b/src/dev/devAiTestAsyn.c @@ -1,5 +1,5 @@ /* devAiTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devAiXy566Di.c b/src/dev/devAiXy566Di.c index 6c7bfaf3f..7bbe63539 100644 --- a/src/dev/devAiXy566Di.c +++ b/src/dev/devAiXy566Di.c @@ -1,5 +1,5 @@ /* devAiXy566Di.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiXy566Di.c - Device Support Routines */ /* diff --git a/src/dev/devAiXy566DiL.c b/src/dev/devAiXy566DiL.c index 55912a95c..bcb4541f4 100644 --- a/src/dev/devAiXy566DiL.c +++ b/src/dev/devAiXy566DiL.c @@ -1,5 +1,5 @@ /* devAiXy566DiL.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiXy566DiL.c - Device Support Routines */ /* diff --git a/src/dev/devAiXy566Se.c b/src/dev/devAiXy566Se.c index 8ad0f89a8..b6a27ad46 100644 --- a/src/dev/devAiXy566Se.c +++ b/src/dev/devAiXy566Se.c @@ -1,5 +1,5 @@ /* devAiXy566Se.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAiXy566Se.c - Device Support Routines */ /* diff --git a/src/dev/devAllenBradley.c b/src/dev/devAllenBradley.c index 84e180136..2bf0d8d35 100644 --- a/src/dev/devAllenBradley.c +++ b/src/dev/devAllenBradley.c @@ -1,5 +1,5 @@ /* devAllenBradley.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAllenBradley.c - Device Support Routines for Allen Bradley*/ /* @@ -32,7 +32,8 @@ * ----------------- * .01 08-27-92 mrk Combined all Allen Bradley devive support * .02 02-08-94 mrk Issue Hardware Errors BUT prevent Error Message Storms - * .02 04-13-94 mrk Fixed IXE problems + * .03 03-30-94 mcn support for devMbboDirect and devMbbiDirect + * .04 04-13-94 mrk Fixed IXE problems * ... */ @@ -56,11 +57,11 @@ #include #include #include +#include #include +#include #include - - /* Create the dsets*/ static long init_1771Ife(); static long read_1771Ife(); @@ -131,11 +132,17 @@ static long init_bi16(); static long ioinfo_bi16(); static long read_bi16(); static long init_mbbi(); +static long init_mbbiDirect(); static long ioinfo_mbbi(); +static long ioinfo_mbbiDirect(); static long read_mbbi(); +static long read_mbbiDirect(); static long init_mbbi16(); +static long init_mbbiDirect16(); static long ioinfo_mbbi16(); +static long ioinfo_mbbiDirect16(); static long read_mbbi16(); +static long read_mbbiDirect16(); typedef struct { long number; DEVSUPFUN report; @@ -147,16 +154,22 @@ typedef struct { ABBIDSET devBiAb={ 5, NULL, NULL, init_bi, ioinfo_bi, read_bi}; ABBIDSET devBiAb16={ 5, NULL, NULL, init_bi16, ioinfo_bi16, read_bi16}; ABBIDSET devMbbiAb={ 5, NULL, NULL, init_mbbi, ioinfo_mbbi, read_mbbi}; +ABBIDSET devMbbiDirectAb={ 5, NULL, NULL, init_mbbiDirect, ioinfo_mbbiDirect, read_mbbiDirect}; ABBIDSET devMbbiAb16={ 5, NULL, NULL, init_mbbi16, ioinfo_mbbi16, read_mbbi16}; +ABBIDSET devMbbiDirectAb16={ 5, NULL, NULL, init_mbbiDirect16, ioinfo_mbbiDirect16, read_mbbiDirect16}; static long init_bo(); static long write_bo(); static long init_bo16(); static long write_bo16(); static long init_mbbo(); +static long init_mbboDirect(); static long write_mbbo(); +static long write_mbboDirect(); static long init_mbbo16(); +static long init_mbboDirect16(); static long write_mbbo16(); +static long write_mbboDirect16(); typedef struct { long number; DEVSUPFUN report; @@ -168,7 +181,9 @@ typedef struct { ABBODSET devBoAb={ 5, NULL, NULL, init_bo, NULL, write_bo}; ABBODSET devBoAb16={ 5, NULL, NULL, init_bo16, NULL, write_bo16}; ABBODSET devMbboAb={ 5, NULL, NULL, init_mbbo, NULL, write_mbbo}; +ABBODSET devMbboDirectAb={ 5, NULL, NULL, init_mbboDirect, NULL, write_mbboDirect}; ABBODSET devMbboAb16={ 5, NULL, NULL, init_mbbo16, NULL, write_mbbo16}; +ABBODSET devMbboDirectAb16={ 5, NULL, NULL, init_mbboDirect16, NULL, write_mbboDirect16}; static long init_1771Ife(struct aiRecord *pai) @@ -929,6 +944,62 @@ static long read_mbbi(struct mbbiRecord *pmbbi) unsigned long value; + pabio = (struct abio *)&(pmbbi->inp.value); + status = ab_bidriver(ABBI_08_BIT,pabio->link,pabio->adapter, + pabio->card,pabio->plc_flag,pmbbi->mask,&value); + if(status==0) { + pmbbi->rval = value; + return(0); + } else { + if(recGblSetSevr(pmbbi,READ_ALARM,INVALID_ALARM) && errVerbose + && (pmbbi->stat!=READ_ALARM || pmbbi->sevr!=INVALID_ALARM)) + recGblRecordError(-1,(void *)pmbbi,"ab_bidriver Error"); + return(2); + } +} + +static long init_mbbiDirect(struct mbbiDirectRecord *pmbbi) +{ + + /* mbbi.inp must be an AB_IO */ + switch (pmbbi->inp.type) { + case (AB_IO) : + pmbbi->shft = pmbbi->inp.value.abio.signal; + pmbbi->mask <<= pmbbi->shft; + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectAb (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long ioinfo_mbbiDirect( + int cmd, + struct mbbiDirectRecord *pmbbi, + IOSCANPVT *ppvt) +{ + struct abio *pabio; + unsigned long value; + + pabio = (struct abio *)&(pmbbi->inp.value); + ab_bi_getioscanpvt(pabio->link,pabio->adapter,pabio->card,ppvt); + /*call ab_bidriver so that it knows it has a binary input*/ + if(cmd==0) { + (void) ab_bidriver(ABBI_08_BIT,pabio->link,pabio->adapter, + pabio->card,pabio->plc_flag,pmbbi->mask,&value); + } + return(0); +} + +static long read_mbbiDirect(struct mbbiDirectRecord *pmbbi) +{ + struct abio *pabio; + int status; + unsigned long value; + + pabio = (struct abio *)&(pmbbi->inp.value); status = ab_bidriver(ABBI_08_BIT,pabio->link,pabio->adapter, pabio->card,pabio->plc_flag,pmbbi->mask,&value); @@ -998,6 +1069,61 @@ static long read_mbbi16(struct mbbiRecord *pmbbi) } } +static long init_mbbiDirect16(struct mbbiDirectRecord *pmbbi) +{ + + /* mbbi.inp must be an AB_IO */ + switch (pmbbi->inp.type) { + case (AB_IO) : + pmbbi->shft = pmbbi->inp.value.abio.signal; + pmbbi->mask <<= pmbbi->shft; + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectAb16 (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long ioinfo_mbbiDirect16( + int cmd, + struct mbbiDirectRecord *pmbbi, + IOSCANPVT *ppvt) +{ + struct abio *pabio; + unsigned long value; + + pabio = (struct abio *)&(pmbbi->inp.value); + ab_bi_getioscanpvt(pabio->link,pabio->adapter,pabio->card,ppvt); + /*call ab_bidriver so that it knows it has a binary input*/ + if(cmd==0) { + (void) ab_bidriver(ABBI_16_BIT,pabio->link,pabio->adapter, + pabio->card,pabio->plc_flag,pmbbi->mask,&value); + } + return(0); +} + +static long read_mbbiDirect16(struct mbbiDirectRecord *pmbbi) +{ + struct abio *pabio; + int status; + unsigned long value; + + pabio = (struct abio *)&(pmbbi->inp.value); + status = ab_bidriver(ABBI_16_BIT,pabio->link,pabio->adapter, + pabio->card,pabio->plc_flag,pmbbi->mask,&value); + if(status==0) { + pmbbi->rval = value; + return(0); + } else { + if(recGblSetSevr(pmbbi,READ_ALARM,INVALID_ALARM) && errVerbose + && (pmbbi->stat!=READ_ALARM || pmbbi->sevr!=INVALID_ALARM)) + recGblRecordError(-1,(void *)pmbbi,"ab_bidriver Error"); + return(2); + } +} + static long init_bo(struct boRecord *pbo) { unsigned long value; @@ -1114,6 +1240,48 @@ static long write_mbbo(struct mbboRecord *pmbbo) unsigned long value; + pabio = &(pmbbo->out.value.abio); + status = ab_bodriver(ABBO_08_BIT,pabio->link,pabio->adapter, + pabio->card,pabio->plc_flag,pmbbo->rval,pmbbo->mask); + if(status!=0) { + if(recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM) && errVerbose + && (pmbbo->stat!=WRITE_ALARM || pmbbo->sevr!=INVALID_ALARM)) + recGblRecordError(-1,(void *)pmbbo,"ab_bodriver Error"); + } + return(0); +} + +static long init_mbboDirect(struct mbboDirectRecord *pmbbo) +{ + unsigned long value; + struct abio *pabio; + int status=0; + + /* mbbo.out must be an AB_IO */ + switch (pmbbo->out.type) { + case (AB_IO) : + pabio = &(pmbbo->out.value.abio); + pmbbo->shft = pabio->signal; + pmbbo->mask <<= pmbbo->shft; + status = ab_boread(ABBO_08_BIT,pabio->link,pabio->adapter,pabio->card,&value,pmbbo->mask); + if(status==0) pmbbo->rval = value; + else status = 2; + break; + default : + status = S_db_badField; + recGblRecordError(status,(void *)pmbbo, + "devMbboDirectAb (init_record) Illegal OUT field"); + } + return(status); +} + +static long write_mbboDirect(struct mbboDirectRecord *pmbbo) +{ + struct abio *pabio; + int status; + unsigned long value; + + pabio = &(pmbbo->out.value.abio); status = ab_bodriver(ABBO_08_BIT,pabio->link,pabio->adapter, pabio->card,pabio->plc_flag,pmbbo->rval,pmbbo->mask); @@ -1165,3 +1333,45 @@ static long write_mbbo16(struct mbboRecord *pmbbo) } return(0); } + +static long init_mbboDirect16(struct mbboDirectRecord *pmbbo) +{ + unsigned long value; + struct abio *pabio; + int status=0; + + /* mbbo.out must be an AB_IO */ + switch (pmbbo->out.type) { + case (AB_IO) : + pabio = &(pmbbo->out.value.abio); + pmbbo->shft = pabio->signal; + pmbbo->mask <<= pmbbo->shft; + status = ab_boread(ABBO_16_BIT,pabio->link,pabio->adapter,pabio->card,&value,pmbbo->mask); + if(status==0) pmbbo->rval = value; + else status = 2; + break; + default : + status = S_db_badField; + recGblRecordError(status,(void *)pmbbo, + "devMbboDirectAb16 (init_record) Illegal OUT field"); + } + return(status); +} + +static long write_mbboDirect16(struct mbboDirectRecord *pmbbo) +{ + struct abio *pabio; + int status; + + + pabio = &(pmbbo->out.value.abio); + status = ab_bodriver(ABBO_16_BIT,pabio->link,pabio->adapter, + pabio->card,pabio->plc_flag,pmbbo->rval,pmbbo->mask); + if(status!=0) { + if(recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM) && errVerbose + && (pmbbo->stat!=WRITE_ALARM || pmbbo->sevr!=INVALID_ALARM)) + recGblRecordError(-1,(void *)pmbbo,"ab_bodriver Error"); + } + return(0); +} + diff --git a/src/dev/devAoSoft.c b/src/dev/devAoSoft.c index 8df67e7ff..44a3b6317 100644 --- a/src/dev/devAoSoft.c +++ b/src/dev/devAoSoft.c @@ -1,5 +1,5 @@ /* devAoSoft.c */ -/* share/src/dev @(#)devAoSoft.c 1.13 4/6/92 */ +/* base/src/dev $Id$ */ /* Device Support Routines for soft Analog Output Records*/ /* @@ -53,8 +53,6 @@ #include /* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devAoSoft */ @@ -83,11 +81,10 @@ struct aoRecord *pao; long status=0; - if (pao->out.type == PV_LINK) - status = dbCaAddOutlink(&(pao->out), (void *) pao, "OVAL"); + status = recGblInitFastOutLink(&(pao->out), (void *) pao, DBR_DOUBLE, "OVAL"); /* dont convert */ - if ( status == 0 ) status = 2; + if (status == 0) status = 2; return status; @@ -96,9 +93,9 @@ struct aoRecord *pao; static long write_ao(pao) struct aoRecord *pao; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(pao->out),(void *)pao,DBR_DOUBLE,&(pao->oval),&nRequest); + status = recGblPutFastLink(&(pao->out), (void *)pao, &(pao->oval)); return(status); } diff --git a/src/dev/devAoSoftRaw.c b/src/dev/devAoSoftRaw.c index 5f0082e60..1cdf18455 100644 --- a/src/dev/devAoSoftRaw.c +++ b/src/dev/devAoSoftRaw.c @@ -1,5 +1,5 @@ /* devAoSoftRaw.c */ -/* share/src/dev @(#)devAoSoftRaw.c 1.6 4/6/92 */ +/* base/src/dev $Id$ */ /* Device Support Routines for soft raw Analog Output Records*/ /* @@ -50,9 +50,6 @@ #include #include -/* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devAoSoftRaw */ @@ -78,13 +75,9 @@ struct { static long init_record(pao) struct aoRecord *pao; { + long status = 0L; -long status; - - if (pao->out.type == PV_LINK) - status = dbCaAddOutlink(&(pao->out), (void *) pao, "RVAL"); - else - status = 0L; + status = recGblInitFastOutLink(&(pao->out), (void *) pao, DBR_LONG, "RVAL"); return status; @@ -93,9 +86,9 @@ long status; static long write_ao(pao) struct aoRecord *pao; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(pao->out),(void *)pao,DBR_LONG,&(pao->rval),&nRequest); + status = recGblPutFastLink(&(pao->out), (void *)pao, &(pao->rval)); return(status); } diff --git a/src/dev/devAoSymb.c b/src/dev/devAoSymb.c index 696955989..ccf90ccff 100644 --- a/src/dev/devAoSymb.c +++ b/src/dev/devAoSymb.c @@ -1,3 +1,5 @@ +/* base/src/dev $Id$ */ + /* @(#)devAoSymb.c 1.1 6/4/93 * Device Support for VxWorks Global Symbol Analog Output Records * diff --git a/src/dev/devAoTestAsyn.c b/src/dev/devAoTestAsyn.c index 5b5dfff3f..edbebed44 100644 --- a/src/dev/devAoTestAsyn.c +++ b/src/dev/devAoTestAsyn.c @@ -1,5 +1,5 @@ /* devAoTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAoTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devAoVmiVme4100.c b/src/dev/devAoVmiVme4100.c index fbe9197bf..98e6c667f 100644 --- a/src/dev/devAoVmiVme4100.c +++ b/src/dev/devAoVmiVme4100.c @@ -1,5 +1,5 @@ /* devAoVmiVme4100.c.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* Device Support Routines for VMI4100 analog output*/ /* diff --git a/src/dev/devAt5Vxi.c b/src/dev/devAt5Vxi.c index 0d90b0391..5120b1565 100644 --- a/src/dev/devAt5Vxi.c +++ b/src/dev/devAt5Vxi.c @@ -1,5 +1,5 @@ /* devAt5Vxi.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devAt5Vxi.c - Device Support Routines */ /* @@ -33,6 +33,8 @@ * .01 08-21-92 mrk Replaces individual At5Vxi modules * .02 05-27-93 joh changed linear conversion * .03 09-01-93 joh expects EPICS status from driver + * .04 09-02-93 mcn added AT5VXI Timer support + * .05 10-08-93 mcn added support for Direct mbbo and mbbi */ #include @@ -54,7 +56,9 @@ #include #include #include -#include +#include +#include +#include #include #include @@ -67,10 +71,13 @@ static long init_ao(); static long init_bi(); static long init_bo(); static long init_mbbi(); +static long init_mbbiDirect(); static long init_mbbo(); +static long init_mbboDirect(); static long ai_ioinfo(); static long bi_ioinfo(); static long mbbi_ioinfo(); +static long mbbiDirect_ioinfo(); static long read_timer(); static long read_ai(); static long write_ao(); @@ -78,7 +85,9 @@ static long read_bi(); static long write_timer(); static long write_bo(); static long read_mbbi(); +static long read_mbbiDirect(); static long write_mbbo(); +static long write_mbboDirect(); static long ai_lincvt(); static long ao_lincvt(); @@ -97,7 +106,9 @@ AT5VXIDSET devAoAt5Vxi= {6, NULL, NULL, init_ao, NULL, write_ao, ao_lincvt}; AT5VXIDSET devBiAt5Vxi= {6, NULL, NULL, init_bi, bi_ioinfo, read_bi, NULL}; AT5VXIDSET devBoAt5Vxi= {6, NULL, NULL, init_bo, NULL, write_bo, NULL}; AT5VXIDSET devMbbiAt5Vxi= {6, NULL, NULL, init_mbbi, mbbi_ioinfo, read_mbbi, NULL}; +AT5VXIDSET devMbbiDirectAt5Vxi= {6, NULL, NULL, init_mbbiDirect, mbbiDirect_ioinfo, read_mbbiDirect, NULL}; AT5VXIDSET devMbboAt5Vxi= {6, NULL, NULL, init_mbbo, NULL, write_mbbo, NULL}; +AT5VXIDSET devMbboDirectAt5Vxi= {6, NULL, NULL, init_mbboDirect, NULL, write_mbboDirect, NULL}; /* DSET structure for timer records */ typedef struct { @@ -400,6 +411,23 @@ static long init_mbbi(struct mbbiRecord *pmbbi) return(0); } +static long init_mbbiDirect(struct mbbiDirectRecord *pmbbi) +{ + + /* mbbi.inp must be an VME_IO */ + switch (pmbbi->inp.type) { + case (VME_IO) : + pmbbi->shft = pmbbi->inp.value.vmeio.signal; + pmbbi->mask <<= pmbbi->shft; + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectAt5Vxi (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + static long mbbi_ioinfo( int cmd, struct mbbiRecord *pmbbi, @@ -408,6 +436,14 @@ static long mbbi_ioinfo( return at5vxi_getioscanpvt(pmbbi->inp.value.vmeio.card,ppvt); } +static long mbbiDirect_ioinfo( + int cmd, + struct mbbiDirectRecord *pmbbi, + IOSCANPVT *ppvt) +{ + return at5vxi_getioscanpvt(pmbbi->inp.value.vmeio.card,ppvt); +} + static long read_mbbi(struct mbbiRecord *pmbbi) { struct vmeio *pvmeio; @@ -415,6 +451,23 @@ static long read_mbbi(struct mbbiRecord *pmbbi) unsigned long value; + pvmeio = (struct vmeio *)&(pmbbi->inp.value); + status = at5vxi_bi_driver(pvmeio->card,pmbbi->mask,&value); + if(status==0) { + pmbbi->rval = value; + } else { + recGblSetSevr(pmbbi,READ_ALARM,INVALID_ALARM); + } + return(status); +} + +static long read_mbbiDirect(struct mbbiDirectRecord *pmbbi) +{ + struct vmeio *pvmeio; + long status; + unsigned long value; + + pvmeio = (struct vmeio *)&(pmbbi->inp.value); status = at5vxi_bi_driver(pvmeio->card,pmbbi->mask,&value); if(status==0) { @@ -448,6 +501,29 @@ static long init_mbbo(struct mbboRecord *pmbbo) return(status); } +static long init_mbboDirect(struct mbboDirectRecord *pmbbo) +{ + unsigned long value; + struct vmeio *pvmeio; + long status = 0; + + /* mbbo.out must be an VME_IO */ + switch (pmbbo->out.type) { + case (VME_IO) : + pvmeio = &(pmbbo->out.value.vmeio); + pmbbo->shft = pvmeio->signal; + pmbbo->mask <<= pmbbo->shft; + status = at5vxi_bi_driver(pvmeio->card,pmbbo->mask,&value); + if(status==0) pmbbo->rbv = pmbbo->rval = value; + break; + default : + status = S_db_badField; + recGblRecordError(status,(void *)pmbbo, + "devMbboDirectAt5Vxi (init_record) Illegal OUT field"); + } + return(status); +} + static long write_mbbo(struct mbboRecord *pmbbo) { struct vmeio *pvmeio; @@ -466,3 +542,23 @@ static long write_mbbo(struct mbboRecord *pmbbo) } return(status); } + +static long write_mbboDirect(struct mbboDirectRecord *pmbbo) +{ + struct vmeio *pvmeio; + long status; + unsigned long value; + + + pvmeio = &(pmbbo->out.value.vmeio); + status = at5vxi_bo_driver(pvmeio->card,pmbbo->rval,pmbbo->mask); + if(status==0) { + status = at5vxi_bi_driver(pvmeio->card,pmbbo->mask,&value); + if(status==0) pmbbo->rbv = value; + else recGblSetSevr(pmbbo,READ_ALARM,INVALID_ALARM); + } else { + recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM); + } + return(status); +} + diff --git a/src/dev/devAt8Fp.c b/src/dev/devAt8Fp.c index 2aa503d2d..29f05059b 100644 --- a/src/dev/devAt8Fp.c +++ b/src/dev/devAt8Fp.c @@ -1,5 +1,5 @@ /* devAt8At8Fp.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* * Original Author: Bob Dalesio diff --git a/src/dev/devBiMpv910.c b/src/dev/devBiMpv910.c index 5d698c7f7..9b1bafa37 100644 --- a/src/dev/devBiMpv910.c +++ b/src/dev/devBiMpv910.c @@ -1,5 +1,5 @@ /* devBiMpv910.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBiMpv910.c - Device Support Routines for Burr Brown MPV 910 Binary input */ /* diff --git a/src/dev/devBiSoft.c b/src/dev/devBiSoft.c index 7376e9275..ceeac5200 100644 --- a/src/dev/devBiSoft.c +++ b/src/dev/devBiSoft.c @@ -1,5 +1,5 @@ /* devBiSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBiSoft.c - Device Support Routines for Soft Binary Input*/ /* @@ -78,19 +78,17 @@ static long init_record(pbi) { long status; - /* bi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ + /* bi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK */ switch (pbi->inp.type) { case (CONSTANT) : pbi->val = pbi->inp.value.value; pbi->udf = FALSE; break; - case (PV_LINK) : - status = dbCaAddInlink(&(pbi->inp), (void *) pbi, "VAL"); - if(status) return(status); - break; case (DB_LINK) : - break; - case (CA_LINK) : + case (PV_LINK) : + status = recGblInitFastInLink(&(pbi->inp), (void *) pbi, DBR_USHORT, "VAL"); + if (status) + return(status); break; default : recGblRecordError(S_db_badField,(void *)pbi, @@ -103,10 +101,9 @@ static long init_record(pbi) static long read_bi(pbi) struct biRecord *pbi; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(pbi->inp),(void *)pbi,DBR_USHORT,&(pbi->val), - &options,&nRequest); + status = recGblGetFastLink(&(pbi->inp), (void *)pbi, &(pbi->val)); if(RTN_SUCCESS(status)) pbi->udf=FALSE; diff --git a/src/dev/devBiSoftRaw.c b/src/dev/devBiSoftRaw.c index 696429115..72e3088ab 100644 --- a/src/dev/devBiSoftRaw.c +++ b/src/dev/devBiSoftRaw.c @@ -1,5 +1,5 @@ /* devBiSoftRaw.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBiSoftRaw.c - Device Support Routines for Soft Binary Input*/ /* @@ -84,13 +84,13 @@ static long init_record(pbi) case (CONSTANT) : pbi->rval = pbi->inp.value.value; break; - case (PV_LINK) : - status = dbCaAddInlink(&(pbi->inp), (void *) pbi, "RVAL"); - if(status) return(status); - break; case (DB_LINK) : - break; - case (CA_LINK) : + case (PV_LINK) : + status = recGblInitFastInLink(&(pbi->inp), (void *) pbi, DBR_ULONG, "RVAL"); + + if (status) + return(status); + break; default : recGblRecordError(S_db_badField,(void *)pbi, @@ -103,10 +103,9 @@ static long init_record(pbi) static long read_bi(pbi) struct biRecord *pbi; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(pbi->inp),(void *)pbi,DBR_ULONG,&(pbi->rval), - &options,&nRequest); + status = recGblGetFastLink(&(pbi->inp), (void *)pbi, &(pbi->rval)); return(0); } diff --git a/src/dev/devBiTestAsyn.c b/src/dev/devBiTestAsyn.c index 9957c8d61..904c05248 100644 --- a/src/dev/devBiTestAsyn.c +++ b/src/dev/devBiTestAsyn.c @@ -1,5 +1,5 @@ /* devBiTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBiTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devBiXVme210.c b/src/dev/devBiXVme210.c index 435631906..8caa15dec 100644 --- a/src/dev/devBiXVme210.c +++ b/src/dev/devBiXVme210.c @@ -1,5 +1,5 @@ /* devBiXVme210.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBiXVme210.c - Device Support Routines for XYcom 32 bit binary input*/ /* diff --git a/src/dev/devBoMpv902.c b/src/dev/devBoMpv902.c index c2e3ccbde..e09280d54 100644 --- a/src/dev/devBoMpv902.c +++ b/src/dev/devBoMpv902.c @@ -1,5 +1,5 @@ /* devBoMpv902.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBoMpv902.c - Device Support Routines for Burr Brown MPV 902 Binary output */ /* diff --git a/src/dev/devBoSoft.c b/src/dev/devBoSoft.c index c11b95892..36ab0d012 100644 --- a/src/dev/devBoSoft.c +++ b/src/dev/devBoSoft.c @@ -1,5 +1,5 @@ /* devBoSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBoSoft.c - Device Support Routines for Soft Binary Output*/ /* @@ -51,9 +51,6 @@ #include #include -/* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devBoSoft */ @@ -80,22 +77,21 @@ struct boRecord *pbo; long status=0; - if (pbo->out.type == PV_LINK) - status = dbCaAddOutlink(&(pbo->out), (void *) pbo, "VAL"); + status = recGblInitFastOutLink(&(pbo->out), (void *) pbo, DBR_USHORT, "VAL"); /* dont convert */ - if (status == 0 ) status=2; + if (status == 0 ) status=2; - return status; + return status; } /* end init_record() */ static long write_bo(pbo) struct boRecord *pbo; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(pbo->out),(void *)pbo,DBR_USHORT,&(pbo->val),&nRequest); + status = recGblPutFastLink(&(pbo->out), (void *)pbo, &(pbo->val)); return(status); } diff --git a/src/dev/devBoSoftRaw.c b/src/dev/devBoSoftRaw.c index 9e81e0e3a..a4539f95e 100644 --- a/src/dev/devBoSoftRaw.c +++ b/src/dev/devBoSoftRaw.c @@ -1,5 +1,5 @@ /* devBoSoftRaw.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBoSoftRaw.c - Device Support Routines for SoftRaw Binary Output*/ /* @@ -49,8 +49,6 @@ #include /* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devBoSoftRaw */ @@ -76,12 +74,11 @@ struct { static long init_record(pbo) struct boRecord *pbo; { + long status; -long status; - - if (pbo->out.type == PV_LINK) - status = dbCaAddOutlink(&(pbo->out), (void *) pbo, "RVAL"); - else + status = recGblInitFastOutLink(&(pbo->out), (void *) pbo, DBR_LONG, "RVAL"); + + if (pbo->out.type != CA_LINK) status = 2; return status; @@ -91,9 +88,9 @@ long status; static long write_bo(pbo) struct boRecord *pbo; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(pbo->out),(void *)pbo,DBR_ULONG,&(pbo->rval),&nRequest); + status = recGblPutFastLink(&(pbo->out), (void *)pbo, &(pbo->rval)); return(status); } diff --git a/src/dev/devBoTestAsyn.c b/src/dev/devBoTestAsyn.c index 7d709765c..526f61922 100644 --- a/src/dev/devBoTestAsyn.c +++ b/src/dev/devBoTestAsyn.c @@ -1,5 +1,5 @@ /* devBoTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBoTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devBoXVme220.c b/src/dev/devBoXVme220.c index 5caffb231..a075849de 100644 --- a/src/dev/devBoXVme220.c +++ b/src/dev/devBoXVme220.c @@ -1,5 +1,5 @@ /* devBoXVme220.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devBoXVme220.c - Device Support Routines for XYcom 32 bit binary output*/ /* diff --git a/src/dev/devCommonGpib.c b/src/dev/devCommonGpib.c index ab291d295..3f20be84e 100644 --- a/src/dev/devCommonGpib.c +++ b/src/dev/devCommonGpib.c @@ -1,5 +1,6 @@ /* devCommonGpib.c */ -/* share/src/devOpt $Id$ */ +/* base/src/dev $Id$ */ + /* * Author: John Winans * Origional Author: Ned D. Arnold diff --git a/src/dev/devEventSoft.c b/src/dev/devEventSoft.c index 8d5fff2f1..a0a720320 100644 --- a/src/dev/devEventSoft.c +++ b/src/dev/devEventSoft.c @@ -1,5 +1,5 @@ /* devEventSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devEventSoft.c - Device Support Routines for Soft Event Input */ /* diff --git a/src/dev/devEventTestIoEvent.c b/src/dev/devEventTestIoEvent.c index 682717851..1f05aa865 100644 --- a/src/dev/devEventTestIoEvent.c +++ b/src/dev/devEventTestIoEvent.c @@ -1,5 +1,5 @@ /* devEventTestIoEvent.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devEventTestIoEvent.c - Device Support Routines for ioEvent*/ /* diff --git a/src/dev/devHistogramSoft.c b/src/dev/devHistogramSoft.c index 0a1c1a1e9..505abc2ca 100644 --- a/src/dev/devHistogramSoft.c +++ b/src/dev/devHistogramSoft.c @@ -1,5 +1,5 @@ /* devHistogramSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devHistogramSoft.c - Device Support Routines for soft Histogram Input */ /* @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ struct { static long init_record(phistogram) struct histogramRecord *phistogram; { + long status = 0; /* histogram.svl must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (phistogram->svl.type) { @@ -81,26 +83,27 @@ static long init_record(phistogram) phistogram->sgnl = phistogram->svl.value.value; break; case (PV_LINK) : - break; case (DB_LINK) : - break; - case (CA_LINK) : + status = recGblInitFastInLink(&phistogram->svl, phistogram, DBR_DOUBLE, "SGNL"); + + if (status != 0) + return(status); + break; default : recGblRecordError(S_db_badField,(void *)phistogram, "devHistogramSoft (init_record) Illegal SVL field"); return(S_db_badField); } - return(0); + return(status); } static long read_histogram(phistogram) struct histogramRecord *phistogram; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(phistogram->svl),(void *)phistogram,DBR_DOUBLE,&(phistogram->sgnl), - &options,&nRequest); + status = recGblGetFastLink(&(phistogram->svl), (void *)phistogram, &(phistogram->sgnl)); return(0); /*add count*/ } diff --git a/src/dev/devHistogramTestAsyn.c b/src/dev/devHistogramTestAsyn.c index c91ea6cd8..67d542742 100644 --- a/src/dev/devHistogramTestAsyn.c +++ b/src/dev/devHistogramTestAsyn.c @@ -1,5 +1,5 @@ /* devHistogramTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devHistogramTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devHpe1368a.c b/src/dev/devHpe1368a.c index fdd9e6260..10b0d0b0b 100644 --- a/src/dev/devHpe1368a.c +++ b/src/dev/devHpe1368a.c @@ -1,5 +1,5 @@ /* devHpe1368a.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* * Original Author: Bob Dalesio diff --git a/src/dev/devLiSoft.c b/src/dev/devLiSoft.c index 9e1d3c89d..93f1d8b4b 100644 --- a/src/dev/devLiSoft.c +++ b/src/dev/devLiSoft.c @@ -1,5 +1,5 @@ /* devLiSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devLiSoft.c - Device Support Routines for Soft Longin Input */ /* @@ -82,12 +82,12 @@ static long init_record(plongin) plongin->udf = FALSE; break; case (PV_LINK) : - status = dbCaAddInlink(&(plongin->inp), (void *) plongin, "VAL"); - if(status) return(status); - break; case (DB_LINK) : - break; - case (CA_LINK) : + status = recGblInitFastInLink(&(plongin->inp), (void *) plongin, DBR_LONG, "VAL"); + + if (status) + return(status); + break; default : recGblRecordError(S_db_badField,(void *)plongin, @@ -100,10 +100,9 @@ static long init_record(plongin) static long read_longin(plongin) struct longinRecord *plongin; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(plongin->inp),(void *)plongin,DBR_LONG,&(plongin->val), - &options,&nRequest); + status = recGblGetFastLink(&(plongin->inp), (void *)plongin, &(plongin->val)); if(RTN_SUCCESS(status)) plongin->udf=FALSE; diff --git a/src/dev/devLiSymb.c b/src/dev/devLiSymb.c index f2e9bf1d3..d931aa070 100644 --- a/src/dev/devLiSymb.c +++ b/src/dev/devLiSymb.c @@ -1,3 +1,5 @@ +/* base/src/dev $Id$ */ + /* @(#)devLiSymb.c 1.1 6/4/93 * Device Support for VxWorks Global Symbol Longin Input Records * diff --git a/src/dev/devLoSoft.c b/src/dev/devLoSoft.c index 4768f15eb..44de028ef 100644 --- a/src/dev/devLoSoft.c +++ b/src/dev/devLoSoft.c @@ -1,5 +1,5 @@ /* devLoSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devLoSoft.c - Device Support Routines for Soft Longout Output */ /* @@ -47,9 +47,6 @@ #include #include -/* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devLoSoft */ @@ -74,27 +71,23 @@ struct { static long init_record(plongout) struct longoutRecord *plongout; { + long status = 0L; -long status; + status = recGblInitFastOutLink(&(plongout->out), (void *) plongout, DBR_LONG, "VAL"); - if (plongout->out.type == PV_LINK) - status = dbCaAddOutlink(&(plongout->out), (void *) plongout, "VAL"); - else - status = 0L; - - return status; + return(status); } /* end init_record() */ static long write_longout(plongout) struct longoutRecord *plongout; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(plongout->out),(void *)plongout,DBR_LONG,&(plongout->val), - &nRequest); + status = recGblPutFastLink(&(plongout->out), (void *)plongout, &(plongout->val)); - if(RTN_SUCCESS(status)) plongout->udf=FALSE; + if (RTN_SUCCESS(status)) + plongout->udf=FALSE; return(0); } diff --git a/src/dev/devLoSymb.c b/src/dev/devLoSymb.c index b3068e16f..c97bec36e 100644 --- a/src/dev/devLoSymb.c +++ b/src/dev/devLoSymb.c @@ -1,3 +1,5 @@ +/* base/src/dev $Id$ */ + /* @(#)devLoSymb.c 1.1 6/4/93 * Device Support for VxWorks Global Symbol Longout Output Records * diff --git a/src/dev/devMbbiDirectMpv910.c b/src/dev/devMbbiDirectMpv910.c new file mode 100644 index 000000000..a0da4bfaf --- /dev/null +++ b/src/dev/devMbbiDirectMpv910.c @@ -0,0 +1,106 @@ +/* devMbbiDirectMpv910.c */ +/* base/src/dev $Id$ */ + +/* devMbbiDirectMpv910.c - Device Support Routines*/ +/* Burr Brown MPV 910 Multibit Binary input */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (modification log of devMbbiDirectMpv910 applies) + * .01 10-08-93 mcn (created) device support for direct mbbi + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +/* Create the dset for devMbbiDirectMpv910 */ +static long init_record(); +static long read_mbbi(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_mbbi; +}devMbbiDirectMpv910={ + 5, + NULL, + NULL, + init_record, + NULL, + read_mbbi}; + +static long init_record(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + + /* mbbi.inp must be an VME_IO */ + switch (pmbbi->inp.type) { + case (VME_IO) : + pmbbi->shft = pmbbi->inp.value.vmeio.signal; + pmbbi->mask <<= pmbbi->shft; + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectMpv910 (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long read_mbbi(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + struct vmeio *pvmeio; + int status; + unsigned long value; + + + pvmeio = (struct vmeio *)&(pmbbi->inp.value); + status = bb910_driver(pvmeio->card,pmbbi->mask,&value); + if(status==0) { + pmbbi->rval = value; + } else { + recGblSetSevr(pmbbi,READ_ALARM,INVALID_ALARM); + } + return(status); +} diff --git a/src/dev/devMbbiDirectSoft.c b/src/dev/devMbbiDirectSoft.c new file mode 100644 index 000000000..620f392b6 --- /dev/null +++ b/src/dev/devMbbiDirectSoft.c @@ -0,0 +1,111 @@ +/* devMbbiDirectSoft.c */ +/* base/src/dev $Id$ */ + +/* devMbbiDirectSoft.c - Device Support for Soft Direct Multibit Binary Input*/ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (Modification log in devMbbiSoft.c applies) + * .01 10-08-93 mcn (created) support for direct mbbi records + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* Added for Channel Access Links */ +long dbCaAddInlink(); +long dbCaGetLink(); + + +/* Create the dset for devMbbiSoft */ +static long init_record(); +static long read_mbbi(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_mbbi; +}devMbbiDirectSoft={ + 5, + NULL, + NULL, + init_record, + NULL, + read_mbbi}; + + +static long init_record(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + long status; + + /* mbbi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ + switch (pmbbi->inp.type) { + case (CONSTANT) : + pmbbi->val = pmbbi->inp.value.value; + pmbbi->udf = FALSE; + break; + case (DB_LINK) : + case (PV_LINK) : + status = recGblInitFastInLink(&(pmbbi->inp), (void *) pmbbi, DBR_USHORT, "VAL"); + if (status) + return(status); + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectSoft (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long read_mbbi(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + long status; + + status = recGblGetFastLink(&(pmbbi->inp), (void *)pmbbi, &(pmbbi->val)); + + if (RTN_SUCCESS(status)) pmbbi->udf=FALSE; + + return(2); +} diff --git a/src/dev/devMbbiDirectSoftRaw.c b/src/dev/devMbbiDirectSoftRaw.c new file mode 100644 index 000000000..6a0dfa601 --- /dev/null +++ b/src/dev/devMbbiDirectSoftRaw.c @@ -0,0 +1,107 @@ +/* devMbbiDirectSoftRaw.c */ +/* base/src/dev $Id$ */ + +/* devMbbiDirectSoftRaw.c - Device Support for Direct Soft MBBI */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (modification log of devMbbiDirectSoftRaw applies) + * .01 10-08-93 mcn device support for direct mbbi records. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* Added for Channel Access Links */ +long dbCaAddInlink(); +long dbCaGetLink(); + + +/* Create the dset for devMbbiDirectSoftRaw */ +static long init_record(); +static long read_mbbi(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_mbbi; +}devMbbiDirectSoftRaw={ + 5, + NULL, + NULL, + init_record, + NULL, + read_mbbi}; + + +static long init_record(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + long status; + + /* mbbi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ + switch (pmbbi->inp.type) { + case (CONSTANT) : + pmbbi->rval = pmbbi->inp.value.value; + break; + case (DB_LINK) : + case (PV_LINK) : + status = recGblInitFastInLink(&(pmbbi->inp), (void *) pmbbi, DBR_ULONG, "RVAL"); + if (status) + return(status); + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectSoftRaw (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long read_mbbi(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + long status; + + status = recGblGetFastLink(&(pmbbi->inp), (void *) pmbbi, &(pmbbi->rval)); + + return(0); +} diff --git a/src/dev/devMbbiDirectTestAsyn.c b/src/dev/devMbbiDirectTestAsyn.c new file mode 100644 index 000000000..c2bb88559 --- /dev/null +++ b/src/dev/devMbbiDirectTestAsyn.c @@ -0,0 +1,148 @@ +/* devMbbiDirectTestAsyn.c */ +/* base/src/dev $Id$ */ + +/* devMbbiDirectTestAsyn.c - Device Support for testing asynch processing */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (modification log of devMbbiDirectTestAsyn.c applies) + * .01 10-08-93 mcn added support for direct mbbi records + */ + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Create the dset for devMbbiDirectTestAsyn */ +static long init_record(); +static long read_mbbi(); +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_mbbi; + DEVSUPFUN special_linconv; +}devMbbiDirectTestAsyn={ + 6, + NULL, + NULL, + init_record, + NULL, + read_mbbi, + NULL}; + +/* control block for callback*/ +struct callback { + CALLBACK callback; + struct dbCommon *precord; + WDOG_ID wd_id; +}; + +static void myCallback(pcallback) + struct callback *pcallback; +{ + struct dbCommon *precord=pcallback->precord; + struct rset *prset=(struct rset *)(precord->rset); + + dbScanLock(precord); + (*prset->process)(precord); + dbScanUnlock(precord); +} + + +static long init_record(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + struct callback *pcallback; + + /* mbbi.inp must be a CONSTANT*/ + switch (pmbbi->inp.type) { + case (CONSTANT) : + pcallback = (struct callback *)(calloc(1,sizeof(struct callback))); + pmbbi->dpvt = (void *)pcallback; + callbackSetCallback(myCallback,pcallback); + pcallback->precord = (struct dbCommon *)pmbbi; + pcallback->wd_id = wdCreate(); + pmbbi->val = pmbbi->inp.value.value; + pmbbi->udf = FALSE; + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectTestAsyn (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long read_mbbi(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + struct callback *pcallback=(struct callback *)(pmbbi->dpvt); + int wait_time; + + /* mbbi.inp must be a CONSTANT*/ + switch (pmbbi->inp.type) { + case (CONSTANT) : + if(pmbbi->pact) { + printf("%s Completed\n",pmbbi->name); + return(2); /* don't convert */ + } else { + wait_time = (int)(pmbbi->disv * vxTicksPerSecond); + if(wait_time<=0) return(0); + callbackSetPriority(pmbbi->prio,pcallback); + printf("%s Starting asynchronous processing\n",pmbbi->name); + wdStart(pcallback->wd_id,wait_time,(FUNCPTR)callbackRequest,(int)pcallback); + pmbbi->pact=TRUE; + return(0); + } + default : + if(recGblSetSevr(pmbbi,SOFT_ALARM,INVALID_ALARM)){ + if(pmbbi->stat!=SOFT_ALARM) { + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectTestAsyn (read_mbbi) Illegal INP field"); + } + } + } + return(0); +} diff --git a/src/dev/devMbbiDirectXVme210.c b/src/dev/devMbbiDirectXVme210.c new file mode 100644 index 000000000..4a953729f --- /dev/null +++ b/src/dev/devMbbiDirectXVme210.c @@ -0,0 +1,106 @@ +/* devMbbiDirectXVme210.c */ +/* base/src/dev $Id$ */ + +/* devMbbiDirectXVme210.c - Device Support Routines */ +/* XYcom 32 bit Multibit binary input */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (modification log of devMbbiXVme210 applies) + * .01 10-08-93 mcn added support for diredt mbbi record + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +/* Create the dset for devMbbiDirectXVme210 */ +static long init_record(); +static long read_mbbi(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_mbbi; +}devMbbiDirectXVme210={ + 5, + NULL, + NULL, + init_record, + NULL, + read_mbbi}; + +static long init_record(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + + /* mbbi.inp must be an VME_IO */ + switch (pmbbi->inp.type) { + case (VME_IO) : + pmbbi->shft = pmbbi->inp.value.vmeio.signal; + pmbbi->mask <<= pmbbi->shft; + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbi, + "devMbbiDirectXVme210 (init_record) Illegal INP field"); + return(S_db_badField); + } + return(0); +} + +static long read_mbbi(pmbbi) + struct mbbiDirectRecord *pmbbi; +{ + struct vmeio *pvmeio; + int status; + unsigned long value; + + + pvmeio = (struct vmeio *)&(pmbbi->inp.value); + status = xy210_driver(pvmeio->card,pmbbi->mask,&value); + if(status==0) { + pmbbi->rval = value; + } else { + recGblSetSevr(pmbbi,READ_ALARM,INVALID_ALARM); + } + return(status); +} diff --git a/src/dev/devMbbiMpv910.c b/src/dev/devMbbiMpv910.c index f43765c32..d8f31540c 100644 --- a/src/dev/devMbbiMpv910.c +++ b/src/dev/devMbbiMpv910.c @@ -1,5 +1,5 @@ /* devMbbiMpv910.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbbiMpv910.c - Device Support Routines*/ /* Burr Brown MPV 910 Multibit Binary input */ diff --git a/src/dev/devMbbiSoft.c b/src/dev/devMbbiSoft.c index 36bccd131..a90e795a7 100644 --- a/src/dev/devMbbiSoft.c +++ b/src/dev/devMbbiSoft.c @@ -1,5 +1,5 @@ /* devMbbiSoft.c */ -/* share/src/dev @(#)devMbbiSoft.c 1.2 11/30/90 */ +/* base/src/dev $Id$ */ /* devMbbiSoft.c - Device Support Routines for Soft Multibit Binary Input*/ /* @@ -79,35 +79,27 @@ static long init_record(pmbbi) { long status; - /* mbbi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ - switch (pmbbi->inp.type) { - case (CONSTANT) : + if (pmbbi->inp.type == CONSTANT) { pmbbi->val = pmbbi->inp.value.value; pmbbi->udf = FALSE; - break; - case (PV_LINK) : - status = dbCaAddInlink(&(pmbbi->inp), (void *) pmbbi, "VAL"); - if(status) return(status); - break; - case (DB_LINK) : - break; - case (CA_LINK) : - break; - default : - recGblRecordError(S_db_badField,(void *)pmbbi, - "devMbbiSoft (init_record) Illegal INP field"); - return(S_db_badField); } + else { + status = recGblInitFastInLink(&(pmbbi->inp), (void *) pmbbi, DBR_USHORT, "VAL"); + + if (status) + return(status); + + } + return(0); } static long read_mbbi(pmbbi) struct mbbiRecord *pmbbi; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(pmbbi->inp),(void *)pmbbi,DBR_USHORT,&(pmbbi->val), - &options,&nRequest); + status = recGblGetFastLink(&(pmbbi->inp), (void *)pmbbi, &(pmbbi->val)); if(RTN_SUCCESS(status)) pmbbi->udf=FALSE; diff --git a/src/dev/devMbbiSoftRaw.c b/src/dev/devMbbiSoftRaw.c index e3158af00..5e499519c 100644 --- a/src/dev/devMbbiSoftRaw.c +++ b/src/dev/devMbbiSoftRaw.c @@ -1,5 +1,5 @@ /* devMbbiSoftRaw.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbbiSoftRaw.c - Device Support Routines for Soft Multibit Binary Input*/ /* @@ -80,34 +80,25 @@ static long init_record(pmbbi) { long status; - /* mbbi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ - switch (pmbbi->inp.type) { - case (CONSTANT) : + if (pmbbi->inp.type == CONSTANT) { pmbbi->rval = pmbbi->inp.value.value; - break; - case (PV_LINK) : - status = dbCaAddInlink(&(pmbbi->inp), (void *) pmbbi, "RVAL"); - if(status) return(status); - break; - case (DB_LINK) : - break; - case (CA_LINK) : - break; - default : - recGblRecordError(S_db_badField,(void *)pmbbi, - "devMbbiSoftRaw (init_record) Illegal INP field"); - return(S_db_badField); } + else { + status = recGblInitFastInLink(&(pmbbi->inp), (void *) pmbbi, DBR_ULONG, "RVAL"); + + if (status) + return(status); + } + return(0); } static long read_mbbi(pmbbi) struct mbbiRecord *pmbbi; { - long status,options=0,nRequest=1; + long status; - status = recGblGetLinkValue(&(pmbbi->inp),(void *)pmbbi,DBR_ULONG,&(pmbbi->rval), - &options,&nRequest); + status = recGblGetFastLink(&(pmbbi->inp), (void *)pmbbi, &(pmbbi->rval)); return(0); } diff --git a/src/dev/devMbbiTestAsyn.c b/src/dev/devMbbiTestAsyn.c index accf5c428..d807be4f9 100644 --- a/src/dev/devMbbiTestAsyn.c +++ b/src/dev/devMbbiTestAsyn.c @@ -1,5 +1,5 @@ /* devMbbiTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbbiTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devMbbiXVme210.c b/src/dev/devMbbiXVme210.c index 48f6ebd52..cbc6226d3 100644 --- a/src/dev/devMbbiXVme210.c +++ b/src/dev/devMbbiXVme210.c @@ -1,5 +1,5 @@ /* devMbbiXVme210.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbbiXVme210.c - Device Support Routines */ /* XYcom 32 bit Multibit binary input */ diff --git a/src/dev/devMbboDirectMpv902.c b/src/dev/devMbboDirectMpv902.c new file mode 100644 index 000000000..ecc81bd5e --- /dev/null +++ b/src/dev/devMbboDirectMpv902.c @@ -0,0 +1,115 @@ +/* devMbboDirectMpv902.c */ +/* base/src/dev $Id$ */ + +/* devMbboDirectMpv902.c - Device Support Routines */ +/* Burr Brown MPV 902 */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: (Log for DevMbboMpv902 also applies) + * ----------------- + * 1. 10-08-93 mcn (created) dev support for MbboDirect records + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +/* Create the dset for devMbboDirectMpv902 */ +static long init_record(); +static long write_mbbo(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_mbbo; +}devMbboDirectMpv902={ + 5, + NULL, + NULL, + init_record, + NULL, + write_mbbo}; + +static long init_record(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + unsigned long value; + struct vmeio *pvmeio; + int status=0; + + /* mbbo.out must be an VME_IO */ + switch (pmbbo->out.type) { + case (VME_IO) : + pvmeio = &(pmbbo->out.value.vmeio); + pmbbo->shft = pvmeio->signal; + pmbbo->mask <<= pmbbo->shft; + status = bb902_read(pvmeio->card,pmbbo->mask,&value); + if(status==0) pmbbo->rbv = pmbbo->rval = value; + else status = 2; + break; + default : + status = S_db_badField; + recGblRecordError(status,(void *)pmbbo, + "devMbboDirectMpv902 (init_record) Illegal OUT field"); + } + return(status); +} + +static long write_mbbo(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + struct vmeio *pvmeio; + int status; + unsigned long value; + + + pvmeio = &(pmbbo->out.value.vmeio); + + status = bb902_driver(pvmeio->card,pmbbo->rval,pmbbo->mask); + if(status==0) { + status = bb902_read(pvmeio->card,pmbbo->mask,&value); + if(status==0) pmbbo->rbv = value; + else recGblSetSevr(pmbbo,READ_ALARM,INVALID_ALARM); + } else { + recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM); + } + return(status); +} diff --git a/src/dev/devMbboDirectSoft.c b/src/dev/devMbboDirectSoft.c new file mode 100644 index 000000000..43e8dd9ac --- /dev/null +++ b/src/dev/devMbboDirectSoft.c @@ -0,0 +1,99 @@ +/* devMbboDirectSoft.c */ +/* base/src/dev $Id$ */ + +/* devMbboDirectSoft.c - Device Support for Soft mbbo Direct */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (log for devMbboSoft applies) + * 1. 10-08-93 mcn (created) dev support for MbboDirect records + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static long init_record(); + +/* Create the dset for devMbboSoft */ +static long write_mbbo(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_mbbo; +}devMbboDirectSoft={ + 5, + NULL, + NULL, + init_record, + NULL, + write_mbbo}; + + + +static long init_record(pmbbo) +struct mbboDirectRecord *pmbbo; +{ + + long status = 0; + + status = recGblInitFastOutLink(&(pmbbo->out), (void *) pmbbo, DBR_USHORT, "VAL"); + + /* dont convert */ + if (status == 0) + status = 2; + + return status; + +} /* end init_record() */ + +static long write_mbbo(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + long status; + + status = recGblPutFastLink(&(pmbbo->out), (void *)pmbbo, &(pmbbo->val)); + + if (RTN_SUCCESS(status)) pmbbo->udf=FALSE; + + return(0); +} diff --git a/src/dev/devMbboDirectSoftRaw.c b/src/dev/devMbboDirectSoftRaw.c new file mode 100644 index 000000000..7c6eb9174 --- /dev/null +++ b/src/dev/devMbboDirectSoftRaw.c @@ -0,0 +1,95 @@ +/* devMbboDirectSoftRaw.c */ +/* base/src/dev $Id$ */ + +/* devMbboDirectSoftRaw.c - Device Support SoftRaw Direct mbbo */ +/* + * Author: Janet Anderson + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (log for devMbboSoftRaw.c applies) + * .01 10-08-93 mcn (created) device support for devMbboDirect records + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static long init_record(); + +/* Create the dset for devMbboDirectSoftRaw */ +static long write_mbbo(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_mbbo; +}devMbboDirectSoftRaw={ + 5, + NULL, + NULL, + init_record, + NULL, + write_mbbo}; + + + +static long init_record(pmbbo) +struct mbboDirectRecord *pmbbo; +{ + long status; + + status = recGblInitFastOutLink(&(pmbbo->out), (void *) pmbbo, DBR_ULONG, "RVAL"); + + if (pmbbo->out.type != PV_LINK) + status = 2; + + return status; + +} /* end init_record() */ + +static long write_mbbo(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + long status; + + status = recGblPutFastLink(&(pmbbo->out), (void *)pmbbo, &(pmbbo->rval)); + + return(0); +} diff --git a/src/dev/devMbboDirectTestAsyn.c b/src/dev/devMbboDirectTestAsyn.c new file mode 100644 index 000000000..f355daa4b --- /dev/null +++ b/src/dev/devMbboDirectTestAsyn.c @@ -0,0 +1,146 @@ +/* devMbboDirectTestAsyn.c */ +/* base/src/dev $Id$ */ + +/* devMbboDirectTestAsyn.c - Device Support for testing asynch processing */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (modification log for devMbboTestAsyn applies) + * .01 10-08-93 mcn device support for MbboDirect records + */ + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Create the dset for devMbboDirectTestAsyn */ +static long init_record(); +static long write_mbbo(); +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_mbbo; + DEVSUPFUN special_linconv; +}devMbboDirectTestAsyn={ + 6, + NULL, + NULL, + init_record, + NULL, + write_mbbo, + NULL}; + +/* control block for callback*/ +struct callback { + CALLBACK callback; + struct dbCommon *precord; + WDOG_ID wd_id; +}; + +static void myCallback(pcallback) + struct callback *pcallback; +{ + struct dbCommon *precord=pcallback->precord; + struct rset *prset=(struct rset *)(precord->rset); + + dbScanLock(precord); + (*prset->process)(precord); + dbScanUnlock(precord); +} + +static long init_record(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + struct callback *pcallback; + + /* mbbo.out must be a CONSTANT*/ + switch (pmbbo->out.type) { + case (CONSTANT) : + pcallback = (struct callback *)(calloc(1,sizeof(struct callback))); + pmbbo->dpvt = (void *)pcallback; + callbackSetCallback(myCallback,pcallback); + pcallback->precord = (struct dbCommon *)pmbbo; + pcallback->wd_id = wdCreate(); + break; + default : + recGblRecordError(S_db_badField,(void *)pmbbo, + "devMbboDirectTestAsyn (init_record) Illegal OUT field"); + return(S_db_badField); + } + return(2); +} + +static long write_mbbo(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + struct callback *pcallback=(struct callback *)(pmbbo->dpvt); + int wait_time; + + /* mbbo.out must be a CONSTANT*/ + switch (pmbbo->out.type) { + case (CONSTANT) : + if(pmbbo->pact) { + printf("%s Completed\n",pmbbo->name); + return(0); + } else { + wait_time = (int)(pmbbo->disv * vxTicksPerSecond); + if(wait_time<=0) return(0); + callbackSetPriority(pmbbo->prio,pcallback); + printf("%s Starting asynchronous processing\n",pmbbo->name); + wdStart(pcallback->wd_id,wait_time,(FUNCPTR)callbackRequest,(int)pcallback); + pmbbo->pact=TRUE; + return(0); + } + default : + if(recGblSetSevr(pmbbo,SOFT_ALARM,INVALID_ALARM)){ + if(pmbbo->stat!=SOFT_ALARM) { + recGblRecordError(S_db_badField,(void *)pmbbo, + "devMbboDirectTestAsyn (read_mbbo) Illegal OUT field"); + } + } + } + return(0); +} diff --git a/src/dev/devMbboDirectXVme220.c b/src/dev/devMbboDirectXVme220.c new file mode 100644 index 000000000..bbd3d9042 --- /dev/null +++ b/src/dev/devMbboDirectXVme220.c @@ -0,0 +1,115 @@ +/* devMbboDirectXVme220.c */ +/* base/src/dev $Id$ */ + +/* devMbboDirectXVme220.c - Device Support Routines */ +/* XYcom 32 bit binary output */ +/* + * Original Author: Bob Dalesio + * Current Author: Matthew Needes + * Date: 10-08-93 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + * (modification log for devMbboXVme220 applies) + * .01 10-08-93 mcn (created) device support for MbboDirect records + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +/* Create the dset for devMbboXVme220 */ +static long init_record(); +static long write_mbbo(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_mbbo; +}devMbboDirectXVme220={ + 5, + NULL, + NULL, + init_record, + NULL, + write_mbbo}; + +static long init_record(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + unsigned long value; + struct vmeio *pvmeio; + int status=0; + + /* mbbo.out must be an VME_IO */ + switch (pmbbo->out.type) { + case (VME_IO) : + pvmeio = &(pmbbo->out.value.vmeio); + pmbbo->shft = pvmeio->signal; + pmbbo->mask = pmbbo->shft; + status = xy220_read(pvmeio->card,pmbbo->mask,&value); + if(status==0) pmbbo->rbv = pmbbo->rval = value; + else status = 2; + break; + default : + status = S_db_badField; + recGblRecordError(status,(void *)pmbbo, + "devMbboDirectXVme220 (init_record) Illegal OUT field"); + } + return(status); +} + +static long write_mbbo(pmbbo) + struct mbboDirectRecord *pmbbo; +{ + struct vmeio *pvmeio; + int status; + unsigned long value; + + + pvmeio = &(pmbbo->out.value.vmeio); + status = xy220_driver(pvmeio->card,&pmbbo->rval,pmbbo->mask); + if(status==0) { + status = xy220_read(pvmeio->card,pmbbo->mask,&value); + if(status==0) pmbbo->rbv = value; + else recGblSetSevr(pmbbo,READ_ALARM,INVALID_ALARM); + } else { + recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM); + } + return(status); +} diff --git a/src/dev/devMbboMpv902.c b/src/dev/devMbboMpv902.c index bf1009c41..38d46a8d8 100644 --- a/src/dev/devMbboMpv902.c +++ b/src/dev/devMbboMpv902.c @@ -1,5 +1,5 @@ /* devMbboMpv902.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbboMpv902.c - Device Support Routines */ /* Burr Brown MPV 902 */ diff --git a/src/dev/devMbboSoft.c b/src/dev/devMbboSoft.c index df3f8198e..c4813b5dd 100644 --- a/src/dev/devMbboSoft.c +++ b/src/dev/devMbboSoft.c @@ -1,5 +1,5 @@ /* devMbboSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbboSoft.c - Device Support Routines for Soft Multibit Binary Output*/ /* @@ -51,9 +51,6 @@ #include #include -/* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devMbboSoft */ @@ -82,8 +79,7 @@ struct mbboRecord *pmbbo; long status=0; - if (pmbbo->out.type == PV_LINK) - status = dbCaAddOutlink(&(pmbbo->out), (void *) pmbbo, "VAL"); + status = recGblInitFastOutLink(&(pmbbo->out), (void *) pmbbo, DBR_USHORT, "VAL"); /* dont convert */ if ( status == 0 ) status=2; @@ -95,10 +91,9 @@ struct mbboRecord *pmbbo; static long write_mbbo(pmbbo) struct mbboRecord *pmbbo; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(pmbbo->out),(void *)pmbbo,DBR_USHORT,&(pmbbo->val), - &nRequest); + status = recGblPutFastLink(&(pmbbo->out), (void *)pmbbo, &(pmbbo->val)); if(RTN_SUCCESS(status)) pmbbo->udf=FALSE; diff --git a/src/dev/devMbboSoftRaw.c b/src/dev/devMbboSoftRaw.c index 8b364c852..77a247466 100644 --- a/src/dev/devMbboSoftRaw.c +++ b/src/dev/devMbboSoftRaw.c @@ -1,5 +1,5 @@ /* devMbboSoftRaw.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbboSoftRaw.c - Device Support Routines for SoftRaw Multibit Binary Output*/ /* @@ -48,9 +48,6 @@ #include #include -/* added for Channel Access Links */ -long dbCaAddOutlink(); -long dbCaPutLink(); static long init_record(); /* Create the dset for devMbboSoftRaw */ @@ -77,12 +74,12 @@ static long init_record(pmbbo) struct mbboRecord *pmbbo; { -long status; + long status; - if (pmbbo->out.type == PV_LINK) - status = dbCaAddOutlink(&(pmbbo->out), (void *) pmbbo, "RVAL"); - else - status = 2; + status = recGblInitFastOutLink(&(pmbbo->out), (void *) pmbbo, DBR_ULONG, "RVAL"); + + if (pmbbo->out.type == CA_LINK) + status = 2; return status; @@ -91,10 +88,9 @@ long status; static long write_mbbo(pmbbo) struct mbboRecord *pmbbo; { - long status,nRequest=1; + long status; - status = recGblPutLinkValue(&(pmbbo->out),(void *)pmbbo,DBR_ULONG,&(pmbbo->rval), - &nRequest); + status = recGblPutFastLink(&(pmbbo->out), (void *)pmbbo, &(pmbbo->rval)); return(0); } diff --git a/src/dev/devMbboTestAsyn.c b/src/dev/devMbboTestAsyn.c index 2196d63cb..acf99dd93 100644 --- a/src/dev/devMbboTestAsyn.c +++ b/src/dev/devMbboTestAsyn.c @@ -1,5 +1,5 @@ /* devMbboTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbboTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devMbboXVme220.c b/src/dev/devMbboXVme220.c index c5db3de26..62f675644 100644 --- a/src/dev/devMbboXVme220.c +++ b/src/dev/devMbboXVme220.c @@ -1,5 +1,5 @@ /* devMbboXVme220.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devMbboXVme220.c - Device Support Routines */ /* XYcom 32 bit binary output */ diff --git a/src/dev/devMz8310.c b/src/dev/devMz8310.c index 493b53fba..057e101f8 100644 --- a/src/dev/devMz8310.c +++ b/src/dev/devMz8310.c @@ -1,5 +1,5 @@ /* devMz8310.c.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* Device Support Routines for MZ8310 */ /* diff --git a/src/dev/devPtSoft.c b/src/dev/devPtSoft.c index 932670ba6..bf9c406f2 100644 --- a/src/dev/devPtSoft.c +++ b/src/dev/devPtSoft.c @@ -1,5 +1,5 @@ /* devPtSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devPtSoft.c - Device Support Routines for Soft Pulse Generator Output */ /* diff --git a/src/dev/devSiSoft.c b/src/dev/devSiSoft.c index c8b893b07..4b5d6439c 100644 --- a/src/dev/devSiSoft.c +++ b/src/dev/devSiSoft.c @@ -1,5 +1,5 @@ /* devSiSoft.c */ - /* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devSiSoft.c - Device Support Routines for Soft String Input */ /* diff --git a/src/dev/devSiSymb.c b/src/dev/devSiSymb.c index f8dc032fc..55047f7d9 100644 --- a/src/dev/devSiSymb.c +++ b/src/dev/devSiSymb.c @@ -1,3 +1,5 @@ +/* base/src/dev $Id$ */ + /* @(#)devSiSymb.c 1.1 6/4/93 * Device Support for VxWorks Global Symbol String Input Records * diff --git a/src/dev/devSiTestAsyn.c b/src/dev/devSiTestAsyn.c index 11e8dd1da..7043642c2 100644 --- a/src/dev/devSiTestAsyn.c +++ b/src/dev/devSiTestAsyn.c @@ -1,5 +1,5 @@ /* devSiTestAsyn.c */ - /* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devSiTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devSmCompumotor1830.c b/src/dev/devSmCompumotor1830.c index 0af3307f6..475f63334 100644 --- a/src/dev/devSmCompumotor1830.c +++ b/src/dev/devSmCompumotor1830.c @@ -1,5 +1,5 @@ /* devSmCompumotor1830.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devSmCompumotor1830.c - Device Support Routines */ /* diff --git a/src/dev/devSmOms6Axis.c b/src/dev/devSmOms6Axis.c index 5adf7eb64..40e4f0a65 100644 --- a/src/dev/devSmOms6Axis.c +++ b/src/dev/devSmOms6Axis.c @@ -1,5 +1,5 @@ /* devSmOms6Axis.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devSmOms6Axis.c - Device Support Routines */ /* diff --git a/src/dev/devSoSoft.c b/src/dev/devSoSoft.c index f5468af7b..b7123cc0a 100644 --- a/src/dev/devSoSoft.c +++ b/src/dev/devSoSoft.c @@ -1,5 +1,5 @@ /* devSoSoft.c */ - /* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devSoSoft.c - Device Support Routines for Soft String Output */ /* diff --git a/src/dev/devSoSymb.c b/src/dev/devSoSymb.c index 16f7ebf14..0d60f7ec2 100644 --- a/src/dev/devSoSymb.c +++ b/src/dev/devSoSymb.c @@ -1,3 +1,5 @@ +/* base/src/dev $Id$ */ + /* @(#)devSoSymb.c 1.1 6/4/93 * Device Support for VxWorks Global Symbol String Output Records * diff --git a/src/dev/devSoTestAsyn.c b/src/dev/devSoTestAsyn.c index 783d43fd5..3a740fdfa 100644 --- a/src/dev/devSoTestAsyn.c +++ b/src/dev/devSoTestAsyn.c @@ -1,5 +1,5 @@ /* devSoTestAsyn.c */ - /* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devSoTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devTimerMz8310.c b/src/dev/devTimerMz8310.c index 3d67d5c73..747d3c7d6 100644 --- a/src/dev/devTimerMz8310.c +++ b/src/dev/devTimerMz8310.c @@ -1,5 +1,5 @@ /* devMz8310.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* Device Support Routines for MZ8310 Timer */ /* diff --git a/src/dev/devVxiTDM.c b/src/dev/devVxiTDM.c index c4013acb5..edd1241a5 100644 --- a/src/dev/devVxiTDM.c +++ b/src/dev/devVxiTDM.c @@ -1,5 +1,5 @@ /* devVxiTDM.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* Device Support Routines for Custom Vxi Time Delay Module */ /* diff --git a/src/dev/devWfComet.c b/src/dev/devWfComet.c index 860ffda92..bd30000ec 100644 --- a/src/dev/devWfComet.c +++ b/src/dev/devWfComet.c @@ -1,5 +1,5 @@ /* devComet.c */ -/* share/src/dev @(#)devWfComet.c 1.3 3/8/93 */ +/* base/src/dev $Id$ */ /* * Original Author: Bob Dalesio diff --git a/src/dev/devWfDvx2502.c b/src/dev/devWfDvx2502.c index 39b79d4fb..c4822f4dc 100644 --- a/src/dev/devWfDvx2502.c +++ b/src/dev/devWfDvx2502.c @@ -1,4 +1,4 @@ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* Author: John Winans diff --git a/src/dev/devWfJoergerVtr1.c b/src/dev/devWfJoergerVtr1.c index f3a4dcc2e..2602ba6f5 100644 --- a/src/dev/devWfJoergerVtr1.c +++ b/src/dev/devWfJoergerVtr1.c @@ -1,5 +1,5 @@ /* devWfJoergerVtr1.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devWfJoergerVtr1.c - Device Support Routines */ /* diff --git a/src/dev/devWfSoft.c b/src/dev/devWfSoft.c index 80f5c1407..2af08c67e 100644 --- a/src/dev/devWfSoft.c +++ b/src/dev/devWfSoft.c @@ -1,5 +1,5 @@ /* devWfSoft.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devWfSoft.c - Device Support Routines for soft Waveform Records*/ /* diff --git a/src/dev/devWfTestAsyn.c b/src/dev/devWfTestAsyn.c index ae1f41fb2..d798e9e5b 100644 --- a/src/dev/devWfTestAsyn.c +++ b/src/dev/devWfTestAsyn.c @@ -1,5 +1,5 @@ /* devWfTestAsyn.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devWfTestAsyn.c - Device Support Routines for testing asynchronous processing*/ /* diff --git a/src/dev/devWfXy566Sc.c b/src/dev/devWfXy566Sc.c index 1d953aa15..8e5cfc29b 100644 --- a/src/dev/devWfXy566Sc.c +++ b/src/dev/devWfXy566Sc.c @@ -1,5 +1,5 @@ /* devWfXy566Sc.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* devWfXy566Sc.c - Device Support Routines */ /* diff --git a/src/dev/devXy240.c b/src/dev/devXy240.c index 7eff4edcb..ac06e4bc2 100644 --- a/src/dev/devXy240.c +++ b/src/dev/devXy240.c @@ -1,5 +1,5 @@ /* devXy240.c */ -/* share/src/dev $Id$ */ +/* base/src/dev $Id$ */ /* * Original Author: Bob Dalesio