restructure; new Symb support
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
TOP=../../..
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
include $(TOP)/config/RULES_ARCHS
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
TOP = ../../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
SRCS.c += ../devBiMpv910.c
|
||||
SRCS.c += ../devBoMpv902.c
|
||||
SRCS.c += ../devMbbiDirectMpv910.c
|
||||
SRCS.c += ../devMbbiMpv910.c
|
||||
SRCS.c += ../devMbboDirectMpv902.c
|
||||
SRCS.c += ../devMbboMpv902.c
|
||||
|
||||
PROD = $(SRCS.c:../%.c=%.o)
|
||||
|
||||
include $(TOP)/config/RULES.Vx
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/* devBiMpv910.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devBiMpv910.c - Device Support Routines for Burr Brown MPV 910 Binary input */
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 6-1-90
|
||||
*
|
||||
* 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:
|
||||
* -----------------
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* .02 03-13-92 jba ANSI C changes
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <biRecord.h>
|
||||
|
||||
|
||||
/* Create the dset for devAiBiMpv910 */
|
||||
static long init_record();
|
||||
static long read_bi();
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_bi;
|
||||
}devBiMpv910={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
read_bi};
|
||||
|
||||
static long init_record(pbi)
|
||||
struct biRecord *pbi;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
|
||||
/* bi.inp must be an VME_IO */
|
||||
switch (pbi->inp.type) {
|
||||
case (VME_IO) :
|
||||
pvmeio = (struct vmeio *)&(pbi->inp.value);
|
||||
pbi->mask=1;
|
||||
pbi->mask <<= pvmeio->signal;
|
||||
break;
|
||||
default :
|
||||
recGblRecordError(S_db_badField,(void *)pbi,
|
||||
"devBiMpv910 (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_bi(pbi)
|
||||
struct biRecord *pbi;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
unsigned int value,mask;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbi->inp.value);
|
||||
mask = pbi->mask;
|
||||
status = bb910_driver(pvmeio->card,mask,&value);
|
||||
if(status==0) {
|
||||
pbi->rval = value;
|
||||
return(0);
|
||||
} else {
|
||||
if(recGblSetSevr(pbi,READ_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pbi->stat!=READ_ALARM || pbi->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pbi,"bb910_driver Error");
|
||||
return(2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/* devBoMpv902.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devBoMpv902.c - Device Support Routines for Burr Brown MPV 902 Binary output */
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 6-1-90
|
||||
*
|
||||
* 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:
|
||||
* -----------------
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* .02 03-13-92 jba ANSI C changes
|
||||
* .03 02-08-94 mrk Issue Hardware Errors BUT prevent Error Message Storms
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <boRecord.h>
|
||||
|
||||
|
||||
/* Create the dset for devAiBoMpv902 */
|
||||
static long init_record();
|
||||
static long write_bo();
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_bo;
|
||||
}devBoMpv902={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
write_bo};
|
||||
|
||||
static long init_record(pbo)
|
||||
struct boRecord *pbo;
|
||||
{
|
||||
int status=0;
|
||||
struct vmeio *pvmeio;
|
||||
unsigned int value,mask;
|
||||
|
||||
/* bo.out must be an VME_IO */
|
||||
switch (pbo->out.type) {
|
||||
case (VME_IO) :
|
||||
pvmeio = (struct vmeio *)(&pbo->out.value);
|
||||
pbo->mask = 1;
|
||||
pbo->mask <<= pvmeio->signal;
|
||||
/* read the value via bo driver */
|
||||
mask = pbo->mask;
|
||||
status = bb902_read(pvmeio->card,mask,&value);
|
||||
if(status == 0) pbo->rbv = pbo->rval = value;
|
||||
else status = 2;
|
||||
break;
|
||||
default :
|
||||
status = S_db_badField;
|
||||
recGblRecordError(status,(void *)pbo,
|
||||
"devBoMpv902 (init_record) Illegal OUT field");
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long write_bo(pbo)
|
||||
struct boRecord *pbo;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
unsigned int value,mask;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
value = pbo->rval;
|
||||
mask = pbo->mask;
|
||||
status = bb902_driver(pvmeio->card,value,mask);
|
||||
if(status==0) {
|
||||
status = bb902_read(pvmeio->card,mask,&value);
|
||||
if(status==0) pbo->rbv = value;
|
||||
else{
|
||||
if(recGblSetSevr(pbo,READ_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pbo->stat!=READ_ALARM || pbo->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pbo,"bb902_read Error");
|
||||
}
|
||||
} else {
|
||||
if(recGblSetSevr(pbo,WRITE_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pbo->stat!=WRITE_ALARM || pbo->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pbo,"bb902_driver Error");
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -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 <stdlib.h>
|
||||
#include <stdio.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,112 @@
|
||||
/* devMbbiMpv910.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbbiMpv910.c - Device Support Routines*/
|
||||
/* Burr Brown MPV 910 Multibit Binary input */
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 6-1-90
|
||||
*
|
||||
* 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:
|
||||
* -----------------
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* .02 03-13-92 jba ANSI C changes
|
||||
* .03 02--8-94 mrk Prevent error message storms
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbbiRecord.h>
|
||||
|
||||
|
||||
/* Create the dset for devAiMbbiMpv910 */
|
||||
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;
|
||||
}devMbbiMpv910={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
read_mbbi};
|
||||
|
||||
static long init_record(pmbbi)
|
||||
struct mbbiRecord *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,
|
||||
"devMbbiMpv910 (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_mbbi(pmbbi)
|
||||
struct mbbiRecord *pmbbi;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
unsigned int value,mask;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pmbbi->inp.value);
|
||||
mask = pmbbi->mask;
|
||||
status = bb910_driver(pvmeio->card,&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,"bb910_driver Error");
|
||||
return(2);
|
||||
}
|
||||
}
|
||||
@@ -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 <stdlib.h>
|
||||
#include <stdio.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,127 @@
|
||||
/* devMbboMpv902.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbboMpv902.c - Device Support Routines */
|
||||
/* Burr Brown MPV 902 */
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 6-1-90
|
||||
*
|
||||
* 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:
|
||||
* -----------------
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* .02 03-13-92 jba ANSI C changes
|
||||
* .03 02-08-94 mrk Issue Hardware Errors BUT prevent Error Message Storms
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <module_types.h>
|
||||
#include <mbboRecord.h>
|
||||
|
||||
|
||||
/* Create the dset for devAiMbboMpv902 */
|
||||
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;
|
||||
}devMbboMpv902={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
write_mbbo};
|
||||
|
||||
static long init_record(pmbbo)
|
||||
struct mbboRecord *pmbbo;
|
||||
{
|
||||
unsigned int value,mask;
|
||||
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;
|
||||
mask = pmbbo->mask;
|
||||
status = bb902_read(pvmeio->card,mask,&value);
|
||||
if(status==0) pmbbo->rbv = pmbbo->rval = value;
|
||||
else status = 2;
|
||||
break;
|
||||
default :
|
||||
status = S_db_badField;
|
||||
recGblRecordError(status,(void *)pmbbo,
|
||||
"devMbboMpv902 (init_record) Illegal OUT field");
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long write_mbbo(pmbbo)
|
||||
struct mbboRecord *pmbbo;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
unsigned int value,mask;
|
||||
|
||||
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
|
||||
value = pmbbo->rval;
|
||||
mask = pmbbo->mask;
|
||||
status = bb902_driver(pvmeio->card,value,mask);
|
||||
if(status==0) {
|
||||
status = bb902_read(pvmeio->card,mask,&value);
|
||||
if(status==0) pmbbo->rbv = value;
|
||||
else {
|
||||
if(recGblSetSevr(pmbbo,READ_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pmbbo->stat!=READ_ALARM || pmbbo->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pmbbo,"bb902_read Error");
|
||||
}
|
||||
} else {
|
||||
if(recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pmbbo->stat!=WRITE_ALARM || pmbbo->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pmbbo,"bb902_driver Error");
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user