Merge of LANL's device support with ANL's device support for 3.12
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* devAiDvx2502.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiDvx2502.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAiKscV215.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
|
||||
+16
-11
@@ -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*/
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* @(#)devAiSymb.c 1.1 6/4/93
|
||||
* Device Support for VxWorks Global Symbol Analog Input Records
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAiTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAiXy566Di.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiXy566Di.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAiXy566DiL.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiXy566DiL.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAiXy566Se.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiXy566Se.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
+214
-4
@@ -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 <biRecord.h>
|
||||
#include <boRecord.h>
|
||||
#include <mbbiRecord.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
#include <mbboRecord.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
#include <drvAb.h>
|
||||
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
||||
+5
-8
@@ -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 <aoRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
+5
-12
@@ -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 <special.h>
|
||||
#include <aoRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* @(#)devAoSymb.c 1.1 6/4/93
|
||||
* Device Support for VxWorks Global Symbol Analog Output Records
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAoTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAoTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devAoVmiVme4100.c.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* Device Support Routines for VMI4100 analog output*/
|
||||
/*
|
||||
|
||||
+98
-2
@@ -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 <vxWorks.h>
|
||||
@@ -54,7 +56,9 @@
|
||||
#include <biRecord.h>
|
||||
#include <boRecord.h>
|
||||
#include <mbbiRecord.h>
|
||||
#include <mbboRecord.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
#include <mbboRecord.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
#include <timerRecord.h>
|
||||
|
||||
#include <drvAt5Vxi.h>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devAt8At8Fp.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
|
||||
@@ -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 */
|
||||
/*
|
||||
|
||||
+8
-11
@@ -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;
|
||||
|
||||
|
||||
+9
-10
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devBiTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devBiTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -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*/
|
||||
/*
|
||||
|
||||
@@ -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 */
|
||||
/*
|
||||
|
||||
+6
-10
@@ -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 <module_types.h>
|
||||
#include <boRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
+7
-10
@@ -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 <boRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devBoTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devBoTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -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*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* devCommonGpib.c */
|
||||
/* share/src/devOpt $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Author: John Winans
|
||||
* Origional Author: Ned D. Arnold
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devEventSoft.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devEventSoft.c - Device Support Routines for Soft Event Input */
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devEventTestIoEvent.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devEventTestIoEvent.c - Device Support Routines for ioEvent*/
|
||||
/*
|
||||
|
||||
@@ -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 <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <histogramRecord.h>
|
||||
@@ -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*/
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devHistogramTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devHistogramTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devHpe1368a.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
|
||||
+8
-9
@@ -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;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* @(#)devLiSymb.c 1.1 6/4/93
|
||||
* Device Support for VxWorks Global Symbol Longin Input Records
|
||||
*
|
||||
|
||||
+8
-15
@@ -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 <module_types.h>
|
||||
#include <longoutRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* @(#)devLoSymb.c 1.1 6/4/93
|
||||
* Device Support for VxWorks Global Symbol Longout Output Records
|
||||
*
|
||||
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <wdLib.h>
|
||||
#include <memLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <callback.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <rec/dbCommon.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbbiDirectRecord.h>
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 */
|
||||
|
||||
+12
-20
@@ -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;
|
||||
|
||||
|
||||
+11
-20
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devMbbiTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbbiTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <wdLib.h>
|
||||
#include <memLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <callback.h>
|
||||
#include <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <rec/dbCommon.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -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 <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbboDirectRecord.h>
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devMbboMpv902.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbboMpv902.c - Device Support Routines */
|
||||
/* Burr Brown MPV 902 */
|
||||
|
||||
@@ -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 <module_types.h>
|
||||
#include <mbboRecord.h>
|
||||
|
||||
/* 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;
|
||||
|
||||
|
||||
@@ -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 <module_types.h>
|
||||
#include <mbboRecord.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devMbboTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbboTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devMbboXVme220.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbboXVme220.c - Device Support Routines */
|
||||
/* XYcom 32 bit binary output */
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devMz8310.c.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* Device Support Routines for MZ8310 */
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devPtSoft.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devPtSoft.c - Device Support Routines for Soft Pulse Generator Output */
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devSiSoft.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devSiSoft.c - Device Support Routines for Soft String Input */
|
||||
/*
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* @(#)devSiSymb.c 1.1 6/4/93
|
||||
* Device Support for VxWorks Global Symbol String Input Records
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devSiTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devSiTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devSmCompumotor1830.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devSmCompumotor1830.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devSmOms6Axis.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devSmOms6Axis.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devSoSoft.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devSoSoft.c - Device Support Routines for Soft String Output */
|
||||
/*
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* @(#)devSoSymb.c 1.1 6/4/93
|
||||
* Device Support for VxWorks Global Symbol String Output Records
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devSoTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devSoTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devMz8310.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* Device Support Routines for MZ8310 Timer */
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devVxiTDM.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* Device Support Routines for Custom Vxi Time Delay Module */
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devComet.c */
|
||||
/* share/src/dev @(#)devWfComet.c 1.3 3/8/93 */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
Author: John Winans
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devWfJoergerVtr1.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devWfJoergerVtr1.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devWfSoft.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devWfSoft.c - Device Support Routines for soft Waveform Records*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devWfTestAsyn.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devWfTestAsyn.c - Device Support Routines for testing asynchronous processing*/
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* devWfXy566Sc.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devWfXy566Sc.c - Device Support Routines */
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* devXy240.c */
|
||||
/* share/src/dev $Id$ */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
|
||||
Reference in New Issue
Block a user