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,21 @@
|
||||
TOP = ../../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
SRCS.c += ../devAiXy566Di.c
|
||||
SRCS.c += ../devAiXy566DiL.c
|
||||
SRCS.c += ../devAiXy566Se.c
|
||||
SRCS.c += ../devBiXVme210.c
|
||||
SRCS.c += ../devBoXVme220.c
|
||||
SRCS.c += ../devMbbiDirectXVme210.c
|
||||
SRCS.c += ../devMbbiXVme210.c
|
||||
SRCS.c += ../devMbboDirectXVme220.c
|
||||
SRCS.c += ../devMbboXVme220.c
|
||||
SRCS.c += ../devWfXy566Sc.c
|
||||
SRCS.c += ../devXy240.c
|
||||
|
||||
|
||||
PROD = $(SRCS.c:../%.c=%.o)
|
||||
|
||||
include $(TOP)/config/RULES.Vx
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/* devAiXy566Di.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiXy566Di.c - Device Support Routines */
|
||||
/*
|
||||
* 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 <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
#include <aiRecord.h>
|
||||
|
||||
static long init_record();
|
||||
static long read_ai();
|
||||
static long special_linconv();
|
||||
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_ai;
|
||||
DEVSUPFUN special_linconv;
|
||||
} devAiXy566Di={
|
||||
6,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
read_ai,
|
||||
special_linconv};
|
||||
|
||||
|
||||
static long init_record(pai)
|
||||
struct aiRecord *pai;
|
||||
{
|
||||
unsigned short value;
|
||||
struct vmeio *pvmeio;
|
||||
long status;
|
||||
|
||||
/* ai.inp must be an VME_IO */
|
||||
switch (pai->inp.type) {
|
||||
case (VME_IO) :
|
||||
break;
|
||||
default :
|
||||
recGblRecordError(S_db_badField,(void *)pai,
|
||||
"devAiXy566Di (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
|
||||
/* set linear conversion slope*/
|
||||
pai->eslo = (pai->eguf -pai->egul)/4095.0;
|
||||
|
||||
/* call driver so that it configures card */
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DI,&value)) {
|
||||
recGblRecordError(status,(void *)pai,
|
||||
"devAiXy566Di (init_record) ai_xy566_driver error");
|
||||
return(status);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_ai(pai)
|
||||
struct aiRecord *pai;
|
||||
{
|
||||
unsigned short value;
|
||||
struct vmeio *pvmeio;
|
||||
long status;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DI,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /* don't convert*/
|
||||
if(recGblSetSevr(pai,READ_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pai->stat!=READ_ALARM || pai->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pai,"ai_xy566_driver Error");
|
||||
return(status);
|
||||
}else if(status==-2) {
|
||||
status=0;
|
||||
recGblSetSevr(pai,HW_LIMIT_ALARM,INVALID_ALARM);
|
||||
}
|
||||
if(status!=0) return(status);
|
||||
pai->rval = value;
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long special_linconv(pai,after)
|
||||
struct aiRecord *pai;
|
||||
int after;
|
||||
{
|
||||
|
||||
if(!after) return(0);
|
||||
/* set linear conversion slope*/
|
||||
pai->eslo = (pai->eguf -pai->egul)/4095.0;
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/* devAiXy566DiL.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiXy566DiL.c - Device Support Routines */
|
||||
/*
|
||||
* 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 12-02-91 jba Added cmd control to io-interrupt processing
|
||||
* .03 12-12-91 jba Set cmd to zero in io-interrupt processing
|
||||
* .04 03-13-92 jba ANSI C changes
|
||||
* .05 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 <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <dbScan.h>
|
||||
#include <module_types.h>
|
||||
#include <aiRecord.h>
|
||||
|
||||
static long init_record();
|
||||
static long get_ioint_info();
|
||||
static long read_ai();
|
||||
static long special_linconv();
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_ai;
|
||||
DEVSUPFUN special_linconv;
|
||||
} devAiXy566DiL={
|
||||
6,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
get_ioint_info,
|
||||
read_ai,
|
||||
special_linconv};
|
||||
|
||||
|
||||
static long init_record(pai)
|
||||
struct aiRecord *pai;
|
||||
{
|
||||
unsigned short value;
|
||||
struct vmeio *pvmeio;
|
||||
long status;
|
||||
|
||||
/* ai.inp must be an VME_IO */
|
||||
switch (pai->inp.type) {
|
||||
case (VME_IO) :
|
||||
break;
|
||||
default :
|
||||
recGblRecordError(S_db_badField,(void *)pai,
|
||||
"devAiXy566DiL (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
|
||||
/* set linear conversion slope*/
|
||||
pai->eslo = (pai->eguf -pai->egul)/4095.0;
|
||||
|
||||
/* call driver so that it configures card */
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DIL,&value)) {
|
||||
recGblRecordError(status,(void *)pai,
|
||||
"devAiXy566DiL (init_record) ai_xy566_driver error");
|
||||
return(status);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_ioint_info(int cmd, struct aiRecord *pai,IOSCANPVT *ppvt)
|
||||
{
|
||||
ai_xy566_getioscanpvt(pai->inp.value.vmeio.card,ppvt);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_ai(pai)
|
||||
struct aiRecord *pai;
|
||||
{
|
||||
unsigned short value;
|
||||
struct vmeio *pvmeio;
|
||||
long status;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DIL,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /*don't convert*/
|
||||
if(recGblSetSevr(pai,READ_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pai->stat!=READ_ALARM || pai->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pai,"ai_xy566_driver Error");
|
||||
return(status);
|
||||
}else if(status==-2) {
|
||||
status=0;
|
||||
recGblSetSevr(pai,HW_LIMIT_ALARM,INVALID_ALARM);
|
||||
}
|
||||
if(status!=0) return(status);
|
||||
pai->rval = value;
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long special_linconv(pai,after)
|
||||
struct aiRecord *pai;
|
||||
int after;
|
||||
{
|
||||
|
||||
if(!after) return(0);
|
||||
/* set linear conversion slope*/
|
||||
pai->eslo = (pai->eguf -pai->egul)/4095.0;
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
/* devAiXy566Se.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devAiXy566Se.c - Device Support Routines */
|
||||
/*
|
||||
* 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 <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
#include <aiRecord.h>
|
||||
|
||||
static long init_record();
|
||||
static long read_ai();
|
||||
static long special_linconv();
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_ai;
|
||||
DEVSUPFUN special_linconv;
|
||||
} devAiXy566Se={
|
||||
6,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
read_ai,
|
||||
special_linconv};
|
||||
|
||||
|
||||
static long init_record(pai)
|
||||
struct aiRecord *pai;
|
||||
{
|
||||
unsigned short value;
|
||||
struct vmeio *pvmeio;
|
||||
long status;
|
||||
|
||||
/* ai.inp must be an VME_IO */
|
||||
switch (pai->inp.type) {
|
||||
case (VME_IO) :
|
||||
break;
|
||||
default :
|
||||
recGblRecordError(S_db_badField,(void *)pai,
|
||||
"devAiXy566Se (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
|
||||
/* set linear conversion slope*/
|
||||
pai->eslo = (pai->eguf -pai->egul)/4095.0;
|
||||
|
||||
/* call driver so that it configures card */
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566SE,&value)) {
|
||||
recGblRecordError(status,(void *)pai,
|
||||
"devAiXy566Se (init_record) ai_xy566_driver error");
|
||||
return(status);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_ai(pai)
|
||||
struct aiRecord *pai;
|
||||
{
|
||||
unsigned short value;
|
||||
struct vmeio *pvmeio;
|
||||
long status;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566SE,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /*don't convert*/
|
||||
if(recGblSetSevr(pai,READ_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pai->stat!=READ_ALARM || pai->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pai,"ai_xy566_driver Error");
|
||||
return(status);
|
||||
}else if(status==-2) {
|
||||
status=0;
|
||||
recGblSetSevr(pai,HW_LIMIT_ALARM,INVALID_ALARM);
|
||||
}
|
||||
if(status!=0) return(status);
|
||||
pai->rval = value & 0xfff;
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long special_linconv(pai,after)
|
||||
struct aiRecord *pai;
|
||||
int after;
|
||||
{
|
||||
|
||||
if(!after) return(0);
|
||||
/* set linear conversion slope*/
|
||||
pai->eslo = (pai->eguf -pai->egul)/4095.0;
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/* devBiXVme210.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devBiXVme210.c - Device Support Routines for XYcom 32 bit 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 devBiXVme210 */
|
||||
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;
|
||||
}devBiXVme210={
|
||||
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,
|
||||
"devBiXVme210 (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_bi(pbi)
|
||||
struct biRecord *pbi;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
long value;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbi->inp.value);
|
||||
status = xy210_driver(pvmeio->card,pbi->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,"xy210_driver Error");
|
||||
return(2);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/* devBoXVme220.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devBoXVme220.c - Device Support Routines for XYcom 32 bit 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 devAiBoXVme220 */
|
||||
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;
|
||||
}devBoXVme220={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
write_bo};
|
||||
|
||||
static long init_record(pbo)
|
||||
struct boRecord *pbo;
|
||||
{
|
||||
unsigned int value;
|
||||
int status=0;
|
||||
struct vmeio *pvmeio;
|
||||
|
||||
/* 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;
|
||||
status = xy220_read(pvmeio->card,pbo->mask,&value);
|
||||
if(status == 0) pbo->rbv = pbo->rval = value;
|
||||
else status = 2;
|
||||
break;
|
||||
default :
|
||||
status = S_db_badField;
|
||||
recGblRecordError(status,(void *)pbo,
|
||||
"devBoXVme220 (init_record) Illegal OUT field");
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long write_bo(pbo)
|
||||
struct boRecord *pbo;
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
status = xy220_driver(pvmeio->card,&pbo->rval,pbo->mask);
|
||||
if(status!=0) {
|
||||
if(recGblSetSevr(pbo,WRITE_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pbo->stat!=WRITE_ALARM || pbo->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pbo,"xy220_driver Error");
|
||||
}
|
||||
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 <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 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);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/* devMbbiXVme210.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbbiXVme210.c - Device Support Routines */
|
||||
/* XYcom 32 bit 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-08-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 devAiMbbiXVme210 */
|
||||
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;
|
||||
}devMbbiXVme210={
|
||||
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,
|
||||
"devMbbiXVme210 (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 long value;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pmbbi->inp.value);
|
||||
status = xy210_driver(pvmeio->card,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,"xy210_driver Error");
|
||||
return(2);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
@@ -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 <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 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);
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
/* devMbboXVme220.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devMbboXVme220.c - Device Support Routines */
|
||||
/* XYcom 32 bit 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 <mbboRecord.h>
|
||||
|
||||
|
||||
/* Create the dset for devAiMbboXVme220 */
|
||||
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;
|
||||
}devMbboXVme220={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
write_mbbo};
|
||||
|
||||
static long init_record(pmbbo)
|
||||
struct mbboRecord *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,
|
||||
"devMbboXVme220 (init_record) Illegal OUT field");
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long write_mbbo(pmbbo)
|
||||
struct mbboRecord *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 {
|
||||
if(recGblSetSevr(pmbbo,WRITE_ALARM,INVALID_ALARM) && errVerbose
|
||||
&& (pmbbo->stat!=WRITE_ALARM || pmbbo->sevr!=INVALID_ALARM))
|
||||
recGblRecordError(-1,(void *)pmbbo,"xy220_driver Error");
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/* devWfXy566Sc.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/* devWfXy566Sc.c - Device Support Routines */
|
||||
/*
|
||||
* 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 02-05-92 jba Changed function arguments from paddr to precord
|
||||
* .03 02-28-92 jba Changed callback handling, ANSI C changes
|
||||
* .04 03-13-92 jba ANSI C changes
|
||||
* .05 04-18-92 jba removed process from init_record parms
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#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 <link.h>
|
||||
#include <module_types.h>
|
||||
#include <waveformRecord.h>
|
||||
|
||||
static long init_record();
|
||||
static long read_wf();
|
||||
static long arm_wf();
|
||||
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_wf;
|
||||
} devWfXy566Sc={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
read_wf};
|
||||
|
||||
|
||||
static void myCallback(pwf,no_read,pdata)
|
||||
struct waveformRecord *pwf;
|
||||
int no_read;
|
||||
unsigned char *pdata;
|
||||
{
|
||||
struct rset *prset=(struct rset *)(pwf->rset);
|
||||
short ftvl = pwf->ftvl;
|
||||
|
||||
if(!pwf->busy) return;
|
||||
dbScanLock((struct dbCommon *)pwf);
|
||||
pwf->busy = FALSE;
|
||||
if(ftvl==DBF_SHORT || ftvl==DBF_USHORT) {
|
||||
memcpy(pwf->bptr,pdata,no_read*2);
|
||||
pwf->nord = no_read; /* number of values read */
|
||||
} else {
|
||||
recGblRecordError(S_db_badField,(void *)pwf,
|
||||
"read_wf - illegal ftvl");
|
||||
recGblSetSevr(pwf,READ_ALARM,INVALID_ALARM);
|
||||
}
|
||||
(*prset->process)(pwf);
|
||||
dbScanUnlock((struct dbCommon *)pwf);
|
||||
}
|
||||
|
||||
static long init_record(pwf)
|
||||
struct waveformRecord *pwf;
|
||||
{
|
||||
|
||||
/* wf.inp must be an VME_IO */
|
||||
switch (pwf->inp.type) {
|
||||
case (VME_IO) :
|
||||
break;
|
||||
default :
|
||||
recGblRecordError(S_db_badField,(void *)pwf,
|
||||
"devWfXy566Sc (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_wf(pwf)
|
||||
struct waveformRecord *pwf;
|
||||
{
|
||||
|
||||
/* determine if wave form is to be rearmed*/
|
||||
/* If not active then request rearm */
|
||||
if(!pwf->pact) arm_wf(pwf);
|
||||
/* if already active then call is from myCallback. check rarm*/
|
||||
else if(pwf->rarm) {
|
||||
(void)arm_wf(pwf);
|
||||
pwf->rarm = 0;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long arm_wf(pwf)
|
||||
struct waveformRecord *pwf;
|
||||
{
|
||||
struct vmeio *pvmeio = (struct vmeio *)&(pwf->inp.value);
|
||||
|
||||
pwf->busy = TRUE;
|
||||
if(xy566_driver(pvmeio->card,myCallback,pwf)<0) {
|
||||
recGblSetSevr(pwf,READ_ALARM,INVALID_ALARM);
|
||||
pwf->busy = FALSE;
|
||||
return(0);
|
||||
}
|
||||
pwf->pact=TRUE;
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
/* devXy240.c */
|
||||
/* base/src/dev $Id$ */
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 09-02-92
|
||||
*
|
||||
* 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 08-02-92 mrk Original version
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alarm.h>
|
||||
#include <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <dbScan.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
#include <biRecord.h>
|
||||
#include <boRecord.h>
|
||||
#include <mbbiRecord.h>
|
||||
#include <mbboRecord.h>
|
||||
|
||||
|
||||
static long init_bi();
|
||||
static long init_bo();
|
||||
static long init_mbbi();
|
||||
static long init_mbbo();
|
||||
static long bi_ioinfo();
|
||||
static long mbbi_ioinfo();
|
||||
static long read_bi();
|
||||
static long write_bo();
|
||||
static long read_mbbi();
|
||||
static long write_mbbo();
|
||||
|
||||
|
||||
typedef struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_write;
|
||||
} BINARYDSET;
|
||||
|
||||
|
||||
BINARYDSET devBiXy240= {6,NULL,NULL,init_bi, bi_ioinfo, read_bi};
|
||||
BINARYDSET devBoXy240= {6,NULL,NULL,init_bo, NULL, write_bo};
|
||||
BINARYDSET devMbbiXy240={6,NULL,NULL,init_mbbi,mbbi_ioinfo,read_mbbi};
|
||||
BINARYDSET devMbboXy240={6,NULL,NULL,init_mbbo, NULL,write_mbbo};
|
||||
|
||||
static long init_bi( 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,
|
||||
"devBiXy240 (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long bi_ioinfo(
|
||||
int cmd,
|
||||
struct biRecord *pbi,
|
||||
IOSCANPVT *ppvt)
|
||||
{
|
||||
xy240_getioscanpvt(pbi->inp.value.vmeio.card,ppvt);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_bi(struct biRecord *pbi)
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
long value;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbi->inp.value);
|
||||
status = xy240_bi_driver(pvmeio->card,pbi->mask,&value);
|
||||
if(status==0) {
|
||||
pbi->rval = value;
|
||||
return(0);
|
||||
} else {
|
||||
recGblSetSevr(pbi,READ_ALARM,INVALID_ALARM);
|
||||
return(2);
|
||||
}
|
||||
}
|
||||
|
||||
static long init_bo(struct boRecord *pbo)
|
||||
{
|
||||
unsigned int value;
|
||||
int status=0;
|
||||
struct vmeio *pvmeio;
|
||||
|
||||
/* 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;
|
||||
status = xy240_bo_read(pvmeio->card,pbo->mask,&value);
|
||||
if(status == 0) pbo->rbv = pbo->rval = value;
|
||||
else status = 2;
|
||||
break;
|
||||
default :
|
||||
status = S_db_badField;
|
||||
recGblRecordError(status,(void *)pbo,
|
||||
"devBoXy240 (init_record) Illegal OUT field");
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long write_bo(struct boRecord *pbo)
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
status = xy240_bo_driver(pvmeio->card,pbo->rval,pbo->mask);
|
||||
if(status!=0) {
|
||||
recGblSetSevr(pbo,WRITE_ALARM,INVALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long init_mbbi(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,
|
||||
"devMbbiXy240 (init_record) Illegal INP field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long mbbi_ioinfo(
|
||||
int cmd,
|
||||
struct mbbiRecord *pmbbi,
|
||||
IOSCANPVT *ppvt)
|
||||
{
|
||||
xy240_getioscanpvt(pmbbi->inp.value.vmeio.card,ppvt);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long read_mbbi(struct mbbiRecord *pmbbi)
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
unsigned long value;
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pmbbi->inp.value);
|
||||
status = xy240_bi_driver(pvmeio->card,pmbbi->mask,&value);
|
||||
if(status==0) {
|
||||
pmbbi->rval = value;
|
||||
} else {
|
||||
recGblSetSevr(pmbbi,READ_ALARM,INVALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long init_mbbo(struct mbboRecord *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 = xy240_bo_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,
|
||||
"devMbboXy240 (init_record) Illegal OUT field");
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long write_mbbo(struct mbboRecord *pmbbo)
|
||||
{
|
||||
struct vmeio *pvmeio;
|
||||
int status;
|
||||
unsigned long value;
|
||||
|
||||
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
status = xy240_bo_driver(pvmeio->card,pmbbo->rval,pmbbo->mask);
|
||||
if(status==0) {
|
||||
status = xy240_bo_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);
|
||||
}
|
||||
Reference in New Issue
Block a user