From 4617d55523ac124d33e11f10436df9806e7e45f0 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Tue, 8 Jun 1993 15:03:02 +0000 Subject: [PATCH] Initial revision --- src/dev/devAiSymb.c | 128 ++++++++++++++++++++++++++++++++++++++++++++ src/dev/devAoSymb.c | 119 ++++++++++++++++++++++++++++++++++++++++ src/dev/devLiSymb.c | 124 ++++++++++++++++++++++++++++++++++++++++++ src/dev/devLoSymb.c | 119 ++++++++++++++++++++++++++++++++++++++++ src/dev/devSiSymb.c | 125 ++++++++++++++++++++++++++++++++++++++++++ src/dev/devSoSymb.c | 122 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 737 insertions(+) create mode 100644 src/dev/devAiSymb.c create mode 100644 src/dev/devAoSymb.c create mode 100644 src/dev/devLiSymb.c create mode 100644 src/dev/devLoSymb.c create mode 100644 src/dev/devSiSymb.c create mode 100644 src/dev/devSoSymb.c diff --git a/src/dev/devAiSymb.c b/src/dev/devAiSymb.c new file mode 100644 index 000000000..1c5de14f4 --- /dev/null +++ b/src/dev/devAiSymb.c @@ -0,0 +1,128 @@ +/* @(#)devAiSymb.c 1.1 6/4/93 + * Device Support for VxWorks Global Symbol Analog Input Records + * + * + * Author: Carl Lionberger + * Date: 060893 + * + * 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 + * + * The Control Systems Group + * Systems Engineering Department + * Lawrence Berkeley Laboratory + * + * NOTES: + * Derived from soft record device support. + * Modification Log: + * ----------------- + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Create the dset for devAiSymb */ +long init_record(); +long read_ai(); +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_ai; + DEVSUPFUN special_linconv; +}devAiSymb={ + 6, + NULL, + NULL, + init_record, + NULL, + read_ai, + NULL}; + +double testd = 5.5; + + +static long init_record(pai) +/* + Looks for record name in global symbol table. Strips off any + prefix separated by a ":" before the lookup, to allow same variable + name in multiple ioc's. Strips off suffixes separated by ";", to + allow multiple references to same variable in an ioc. +*/ + struct aiRecord *pai; +{ + char *nptr, pname[29]; + SYM_TYPE stype; + + /* variable names from c have a prepended underscore */ + strcpy(pname,"_"); /* in case it is unprefixed */ + strcat(pname, pai->name); + nptr = strrchr(pname, ';'); /* find any suffix and */ + if (nptr) + *nptr = '\0'; /* terminate it. */ + nptr = strchr(pname, ':'); /* find any prefix and */ + if (nptr) /* bypass it */ + *nptr = '_'; /* overwrite : with _ */ + else + nptr = pname; + if (symFindByName(sysSymTbl, nptr, (char **)&pai->dpvt, &stype)) + { + recGblRecordError(S_db_badField,(void *)pai, + "devAiSymb (init_record) Illegal NAME field"); + return(S_db_badField); + } + + pai->linr=0; /* prevent any conversions */ + return(0); +} + +static long read_ai(pai) + struct aiRecord *pai; +{ + long status; + + if (pai->dpvt) + { + pai->val = *(double *)(pai->dpvt); + status = 0; + } + else + status = 1; + + if(RTN_SUCCESS(status)) pai->udf=FALSE; + + return(2); /*don't convert*/ +} diff --git a/src/dev/devAoSymb.c b/src/dev/devAoSymb.c new file mode 100644 index 000000000..e099bce31 --- /dev/null +++ b/src/dev/devAoSymb.c @@ -0,0 +1,119 @@ +/* @(#)devAoSymb.c 1.1 6/4/93 + * Device Support for VxWorks Global Symbol Analog Output Records + * + * + * Author: Carl Lionberger + * Date: 060893 + * + * 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 + * + * The Control Systems Group + * Systems Engineering Department + * Lawrence Berkeley Laboratory + * + * NOTES: + * Derived from soft record device support. + * Modification Log: + * ----------------- + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +/* Create the dset for devAoSymb */ +long init_record(); +long write_ao(); +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_ao; + DEVSUPFUN special_linconv; +}devAoSymb={ + 6, + NULL, + NULL, + init_record, + NULL, + write_ao, + NULL}; + + + +static long init_record(pao) +/* + Looks for record name in global symbol table. strips off any + prefix separated by a ":" before the lookup, to allow same variable + name in multiple ioc's. Strips off suffixes separated by ";", to + allow multiple references to same variable in an ioc. +*/ + struct aoRecord *pao; +{ + char *nptr, pname[29]; + SYM_TYPE stype; + + /* variable names from c have a prepended underscore */ + strcpy(pname,"_"); /* in case it is unprefixed */ + strcat(pname, pao->name); + nptr = strrchr(pname, ';'); /* find any suffix and */ + if (nptr) + *nptr = '\0'; /* terminate it. */ + nptr = strchr(pname, ':'); /* strip off prefix, if any */ + if (nptr) + *nptr = '_'; /* overwrite : with _ */ + else + nptr = pname; + if (symFindByName(sysSymTbl, nptr, (char **)&pao->dpvt, &stype)) + { + recGblRecordError(S_db_badField,(void *)pao, + "devAoSymb (init_record) Illegal NAME field"); + return(S_db_badField); + } + + return(2); /* don't convert */ +} + +static long write_ao(pao) + struct aoRecord *pao; +{ + if (pao->dpvt) + *(double *)(pao->dpvt) = pao->val; + else + return(1); + + return(0); +} diff --git a/src/dev/devLiSymb.c b/src/dev/devLiSymb.c new file mode 100644 index 000000000..617ff4e85 --- /dev/null +++ b/src/dev/devLiSymb.c @@ -0,0 +1,124 @@ +/* @(#)devLiSymb.c 1.1 6/4/93 + * Device Support for VxWorks Global Symbol Longin Input Records + * + * + * Author: Carl Lionberger + * Date: 060893 + * + * 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 + * + * The Control Systems Group + * Systems Engineering Department + * Lawrence Berkeley Laboratory + * + * NOTES: + * Derived from soft record device support. + * Modification Log: + * ----------------- + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* Create the dset for devLiSymb */ +long init_record(); +long read_longin(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_longin; +}devLiSymb={ + 5, + NULL, + NULL, + init_record, + NULL, + read_longin}; + +long testl = 5463; + + +static long init_record(plongin) +/* + Looks for record name in global symbol table. strips off any + prefix separated by a ":" before the lookup, to allow same variable + name in multiple ioc's. Strips off suffixes separated by ";", to + allow multiple references to same variable in an ioc. +*/ + struct longinRecord *plongin; +{ + char *nptr, pname[29]; + SYM_TYPE stype; + + /* variable names from c have a prepended underscore */ + strcpy(pname,"_"); /* in case it is unprefixed */ + strcat(pname, plongin->name); + nptr = strrchr(pname, ';'); /* find any suffix and */ + if (nptr) + *nptr = '\0'; /* terminate it. */ + nptr = strchr(pname, ':'); /* strip off prefix, if any */ + if (nptr) + *nptr = '_'; /* overwrite : with _ */ + else + nptr = pname; + if (symFindByName(sysSymTbl, nptr, (char **)&plongin->dpvt, &stype)) + { + recGblRecordError(S_db_badField,(void *)plongin, + "devLiSymb (init_record) Illegal NAME field"); + return(S_db_badField); + } + + return(0); +} + +static long read_longin(plongin) + struct longinRecord *plongin; +{ + long status; + + if (plongin->dpvt) + { + plongin->val = *(long *)(plongin->dpvt); + status = 0; + } + else + status = 1; + + if(RTN_SUCCESS(status)) plongin->udf=FALSE; + + return(status); +} diff --git a/src/dev/devLoSymb.c b/src/dev/devLoSymb.c new file mode 100644 index 000000000..95f7951a6 --- /dev/null +++ b/src/dev/devLoSymb.c @@ -0,0 +1,119 @@ +/* @(#)devLoSymb.c 1.1 6/4/93 + * Device Support for VxWorks Global Symbol Longout Output Records + * + * + * Author: Carl Lionberger + * Date: 060893 + * + * 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 + * + * The Control Systems Group + * Systems Engineering Department + * Lawrence Berkeley Laboratory + * + * NOTES: + * Derived from soft record device support. + * Modification Log: + * ----------------- + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +long init_record(); +long write_longout(); + +/* Create the dset for devLoSymb */ + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_longout; +}devLoSymb={ + 5, + NULL, + NULL, + init_record, + NULL, + write_longout}; + + +static long init_record(plongout) +/* + Looks for record name in global symbol table. strips off any + prefix separated by a ":" before the lookup, to allow same variable + name in multiple ioc's. Strips off suffixes separated by ";", to + allow multiple references to same variable in an ioc. +*/ + struct longoutRecord *plongout; +{ + char *nptr, pname[29]; + SYM_TYPE stype; + + /* variable names from c have a prepended underscore */ + strcpy(pname,"_"); /* in case it is unprefixed */ + strcat(pname, plongout->name); + nptr = strrchr(pname, ';'); /* find any suffix and */ + if (nptr) + *nptr = '\0'; /* terminate it. */ + nptr = strchr(pname, ':'); /* strip off prefix, if any */ + if (nptr) + *nptr = '_'; /* overwrite : with _ */ + else + nptr = pname; + if (symFindByName(sysSymTbl, nptr, (char **)&plongout->dpvt, &stype)) + { + recGblRecordError(S_db_badField,(void *)plongout, + "devLoSymb (init_record) Illegal NAME field"); + return(S_db_badField); + } + + return(0); +} + +static long write_longout(plongout) + struct longoutRecord *plongout; +{ + if (plongout->dpvt) + *(long *)(plongout->dpvt) = plongout->val; + else + return(1); + + plongout->udf=FALSE; + + return(0); +} diff --git a/src/dev/devSiSymb.c b/src/dev/devSiSymb.c new file mode 100644 index 000000000..2a698341b --- /dev/null +++ b/src/dev/devSiSymb.c @@ -0,0 +1,125 @@ +/* @(#)devSiSymb.c 1.1 6/4/93 + * Device Support for VxWorks Global Symbol String Input Records + * + * + * Author: Carl Lionberger + * Date: 060893 + * + * 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 + * + * The Control Systems Group + * Systems Engineering Department + * Lawrence Berkeley Laboratory + * + * NOTES: + * Derived from soft record device support. + * Modification Log: + * ----------------- + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* Create the dset for devSiSymb */ +long init_record(); +long read_stringin(); + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN read_stringin; +}devSiSymb={ + 5, + NULL, + NULL, + init_record, + NULL, + read_stringin}; + +char tests[] = {"01234567891123456789212345678931234567894123456789"}; + +static long init_record(pstringin) +/* + Looks for record name in global symbol table. strips off any + prefix separated by a ":" before the lookup, to allow same variable + name in multiple ioc's. Strips off suffixes separated by ";", to + allow multiple references to same variable in an ioc. +*/ + struct stringinRecord *pstringin; +{ + char *nptr, pname[29]; + SYM_TYPE stype; + + /* variable names from c have a prepended underscore */ + strcpy(pname,"_"); /* in case it is unprefixed */ + strcat(pname, pstringin->name); + nptr = strrchr(pname, ';'); /* find any suffix and */ + if (nptr) + *nptr = '\0'; /* terminate it. */ + nptr = strchr(pname, ':'); /* strip off prefix, if any */ + if (nptr) + *nptr = '_'; /* overwrite : with _ */ + else + nptr = pname; + if (symFindByName(sysSymTbl, nptr, (char **)&pstringin->dpvt, &stype)) + { + recGblRecordError(S_db_badField,(void *)pstringin, + "devSiSymb (init_record) Illegal NAME field"); + return(S_db_badField); + } + + return(0); +} + +static long read_stringin(pstringin) + struct stringinRecord *pstringin; +{ + long status; + + if (pstringin->dpvt) + { + pstringin->val[39] = '\0'; + strncpy(pstringin->val,(char *)pstringin->dpvt,39); + status = 0; + } + else + status = 1; + + if(RTN_SUCCESS(status)) pstringin->udf=FALSE; + + return(status); +} diff --git a/src/dev/devSoSymb.c b/src/dev/devSoSymb.c new file mode 100644 index 000000000..46b3a043f --- /dev/null +++ b/src/dev/devSoSymb.c @@ -0,0 +1,122 @@ +/* @(#)devSoSymb.c 1.1 6/4/93 + * Device Support for VxWorks Global Symbol String Output Records + * + * + * Author: Carl Lionberger + * Date: 060893 + * + * 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 + * + * The Control Systems Group + * Systems Engineering Department + * Lawrence Berkeley Laboratory + * + * NOTES: + * Derived from soft record device support. + * Modification Log: + * ----------------- + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +long init_record(); +long write_stringout(); + +/* Create the dset for devSoSymb */ + +struct { + long number; + DEVSUPFUN report; + DEVSUPFUN init; + DEVSUPFUN init_record; + DEVSUPFUN get_ioint_info; + DEVSUPFUN write_stringout; +}devSoSymb={ + 5, + NULL, + NULL, + init_record, + NULL, + write_stringout}; + + +static long init_record(pstringout) +/* + Looks for record name in global symbol table. strips off any + prefix separated by a ":" before the lookup, to allow same variable + name in multiple ioc's. Strips off suffixes separated by ";", to + allow multiple references to same variable in an ioc. +*/ + struct stringoutRecord *pstringout; +{ + char *nptr, pname[29]; + SYM_TYPE stype; + + /* variable names from c have a prepended underscore */ + strcpy(pname,"_"); /* in case it is unprefixed */ + strcat(pname, pstringout->name); + nptr = strrchr(pname, ';'); /* find any suffix and */ + if (nptr) + *nptr = '\0'; /* terminate it. */ + nptr = strchr(pname, ':'); /* strip off prefix, if any */ + if (nptr) + *nptr = '_'; /* overwrite : with _ */ + else + nptr = pname; + if (symFindByName(sysSymTbl, nptr, (char **)&pstringout->dpvt, &stype)) + { + recGblRecordError(S_db_badField,(void *)pstringout, + "devSoSymb (init_record) Illegal NAME field"); + return(S_db_badField); + } + + return(0); +} + +static long write_stringout(pstringout) + struct stringoutRecord *pstringout; +{ + if (pstringout->dpvt) + { + pstringout->val[39] = '\0'; + strcpy((char *)pstringout->dpvt,pstringout->val); + } + else + return(1); + + pstringout->udf = FALSE; + + return(0); +}