Stage 1 reorganization

Directory moves.

  src/RTEMS/ => src/libCom/RTEMS/
  src/as/ => src/ioc/as/
  src/bpt/ => src/ioc/bpt/
  src/ca/ => src/ca/client/
  src/cap5/ => src/ca/client/perl/
  src/cas/ => src/ca/legacy/pcas/
  src/catools/ => src/ca/client/tools/
  src/db/ => src/ioc/db/
  src/dbStatic/ => src/ioc/dbStatic/
  src/dbtools/ => src/ioc/dbtemplate/
  src/dev/softDev/ => src/std/dev/
  src/dev/testDev/ => src/std/test/
  src/excas/ => src/ca/legacy/pcas/ex/
  src/gdd/ => src/ca/legacy/gdd/
  src/makeBaseApp/ => src/template/base/
  src/makeBaseExt/ => src/template/ext/
  src/misc/ => src/ioc/misc/
  src/rec/ => src/std/rec/
  src/registry/ => src/ioc/registry/
  src/rsrv/ => src/ioc/rsrv/
  src/softIoc/ => src/std/softIoc/
  src/toolsComm/ => src/libCom/tools/
This commit is contained in:
Michael Davidsaver
2010-12-16 15:15:52 -05:00
committed by Andrew Johnson
parent 4a18db9f99
commit 2a36a3906d
748 changed files with 0 additions and 0 deletions

61
src/std/dev/Makefile Normal file
View File

@@ -0,0 +1,61 @@
#*************************************************************************
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
TOP=../../..
include $(TOP)/configure/CONFIG
DBD += devSoft.dbd
LIBSRCS += devAaiSoft.c
LIBSRCS += devAaoSoft.c
LIBSRCS += devAiSoft.c
LIBSRCS += devAiSoftRaw.c
LIBSRCS += devAoSoft.c
LIBSRCS += devAoSoftRaw.c
LIBSRCS += devBiSoft.c
LIBSRCS += devBiSoftRaw.c
LIBSRCS += devBoSoft.c
LIBSRCS += devBoSoftRaw.c
LIBSRCS += devCalcoutSoft.c
LIBSRCS += devEventSoft.c
LIBSRCS += devHistogramSoft.c
LIBSRCS += devLiSoft.c
LIBSRCS += devLoSoft.c
LIBSRCS += devMbbiDirectSoft.c
LIBSRCS += devMbbiDirectSoftRaw.c
LIBSRCS += devMbbiSoft.c
LIBSRCS += devMbbiSoftRaw.c
LIBSRCS += devMbboDirectSoft.c
LIBSRCS += devMbboDirectSoftRaw.c
LIBSRCS += devMbboSoft.c
LIBSRCS += devMbboSoftRaw.c
LIBSRCS += devSASoft.c
LIBSRCS += devSiSoft.c
LIBSRCS += devSoSoft.c
LIBSRCS += devWfSoft.c
LIBSRCS += devGeneralTime.c
LIBSRCS += devAoSoftCallback.c
LIBSRCS += devBoSoftCallback.c
LIBSRCS += devCalcoutSoftCallback.c
LIBSRCS += devLoSoftCallback.c
LIBSRCS += devMbboSoftCallback.c
LIBSRCS += devMbboDirectSoftCallback.c
LIBSRCS += devSoSoftCallback.c
LIBSRCS += devTimestamp.c
LIBSRCS += devSoStdio.c
LIBRARY_IOC += softDevIoc
softDevIoc_LIBS += miscIoc recIoc asIoc dbIoc registryIoc dbStaticIoc ca Com
softDevIoc_RCS = softDevIoc.rc
include $(TOP)/configure/RULES

87
src/std/dev/devAaiSoft.c Normal file
View File

@@ -0,0 +1,87 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
* devAaiSoft.c - Device Support Routines for soft Waveform Records
*
* Original Author: Bob Dalesio
* Current Author: Dirk Zimoch
* Date: 27-MAY-2010
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "cantProceed.h"
#include "menuYesNo.h"
#include "aaiRecord.h"
#include "epicsExport.h"
/* Create the dset for devAaiSoft */
static long init_record();
static long read_aai();
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_aai;
} devAaiSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_aai
};
epicsExportAddress(dset,devAaiSoft);
static long init_record(aaiRecord *prec)
{
/* INP must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
prec->nord = 0;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default :
recGblRecordError(S_db_badField, (void *)prec,
"devAaiSoft (init_record) Illegal INP field");
return(S_db_badField);
}
return 0;
}
static long read_aai(aaiRecord *prec)
{
long nRequest = prec->nelm;
dbGetLink(prec->simm == menuYesNoYES ? &prec->siol : &prec->inp,
prec->ftvl, prec->bptr, 0, &nRequest);
if (nRequest > 0) {
prec->nord = nRequest;
prec->udf=FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 0;
}

79
src/std/dev/devAaoSoft.c Normal file
View File

@@ -0,0 +1,79 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
* devAaoSoft.c - Device Support Routines for soft Waveform Records
*
* Original Author: Bob Dalesio
* Current Author: Dirk Zimoch
* Date: 27-MAY-2010
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "cantProceed.h"
#include "menuYesNo.h"
#include "aaoRecord.h"
#include "epicsExport.h"
/* Create the dset for devAaoSoft */
static long init_record();
static long write_aao();
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_aao;
} devAaoSoft = {
5,
NULL,
NULL,
init_record,
NULL,
write_aao
};
epicsExportAddress(dset,devAaoSoft);
static long init_record(aaoRecord *prec)
{
/* OUT must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/
switch (prec->out.type) {
case CONSTANT:
prec->nord = 0;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default :
recGblRecordError(S_db_badField, prec,
"devAaoSoft (init_record) Illegal OUT field");
return(S_db_badField);
}
return 0;
}
static long write_aao(aaoRecord *prec)
{
long nRequest = prec->nord;
dbPutLink(prec->simm == menuYesNoYES ? &prec->siol : &prec->out,
prec->ftvl, prec->bptr, nRequest);
return 0;
}

96
src/std/dev/devAiSoft.c Normal file
View File

@@ -0,0 +1,96 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 3/6/91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "aiRecord.h"
#include "epicsExport.h"
/* Create the dset for devAiSoft */
static long init_record(aiRecord *prec);
static long read_ai(aiRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_ai;
DEVSUPFUN special_linconv;
} devAiSoft = {
6,
NULL,
NULL,
init_record,
NULL,
read_ai,
NULL
};
epicsExportAddress(dset, devAiSoft);
static long init_record(aiRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_DOUBLE, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devAiSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_ai(aiRecord *prec)
{
double val;
if (prec->inp.type == CONSTANT)
return 2;
if (!dbGetLink(&prec->inp, DBR_DOUBLE, &val, 0, 0)) {
/* Apply smoothing algorithm */
if (prec->smoo != 0.0 && prec->dpvt)
prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo);
else
prec->val = val;
prec->udf = FALSE;
prec->dpvt = &devAiSoft; /* Any non-zero value */
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
} else {
prec->dpvt = NULL;
}
return 2;
}

View File

@@ -0,0 +1,78 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "aiRecord.h"
#include "epicsExport.h"
/* Create the dset for devAiSoftRaw */
static long init_record(aiRecord *prec);
static long read_ai(aiRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_ai;
DEVSUPFUN special_linconv;
} devAiSoftRaw = {
6,
NULL,
NULL,
init_record,
NULL,
read_ai,
NULL
};
epicsExportAddress(dset, devAiSoftRaw);
static long init_record(aiRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
recGblInitConstantLink(&prec->inp, DBF_LONG, &prec->rval);
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devAiSoftRaw (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_ai(aiRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_LONG, &prec->rval, 0, 0) &&
prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
return 0;
}

75
src/std/dev/devAoSoft.c Normal file
View File

@@ -0,0 +1,75 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devAoSoft.c */
/* base/src/dev $Revision-Id$ */
/* Device Support Routines for soft Analog Output Records*/
/*
* Original Author: Bob Dalesio
* Current Author: Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "special.h"
#include "aoRecord.h"
#include "epicsExport.h"
/* added for Channel Access Links */
static long init_record(aoRecord *prec);
/* Create the dset for devAoSoft */
static long write_ao(aoRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_ao;
DEVSUPFUN special_linconv;
}devAoSoft={
6,
NULL,
NULL,
init_record,
NULL,
write_ao,
NULL};
epicsExportAddress(dset,devAoSoft);
static long init_record(aoRecord *prec)
{
long status=0;
status = 2;
return status;
} /* end init_record() */
static long write_ao(aoRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_DOUBLE, &prec->oval,1);
return(status);
}

View File

@@ -0,0 +1,70 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devAoSoftCallbackCallback.c */
/*
* Author: Marty Kraimer
* Date: 04NOV2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "dbCa.h"
#include "link.h"
#include "special.h"
#include "aoRecord.h"
#include "epicsExport.h"
/* Create the dset for devAoSoftCallback */
static long write_ao(aoRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_ao;
DEVSUPFUN special_linconv;
}devAoSoftCallback={
6,
NULL,
NULL,
NULL,
NULL,
write_ao,
NULL};
epicsExportAddress(dset,devAoSoftCallback);
static long write_ao(aoRecord *prec)
{
struct link *plink = &prec->out;
long status;
if(prec->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(plink,DBR_DOUBLE,&prec->oval,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_DOUBLE,&prec->oval,1,
dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
prec->pact = TRUE;
return(0);
}

View File

@@ -0,0 +1,63 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devAoSoftRaw.c */
/* base/src/dev $Revision-Id$ */
/* Device Support Routines for soft raw Analog Output Records*/
/*
* Author: Janet Anderson
* Date: 09-25-91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "dbEvent.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "special.h"
#include "aoRecord.h"
#include "epicsExport.h"
/* Create the dset for devAoSoftRaw */
static long write_ao(aoRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_ao;
DEVSUPFUN special_linconv;
}devAoSoftRaw={
6,
NULL,
NULL,
NULL,
NULL,
write_ao,
NULL
};
epicsExportAddress(dset,devAoSoftRaw);
static long write_ao(aoRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_LONG,&prec->rval,1);
return(status);
}

79
src/std/dev/devBiSoft.c Normal file
View File

@@ -0,0 +1,79 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "biRecord.h"
#include "epicsExport.h"
/* Create the dset for devBiSoft */
static long init_record(biRecord *prec);
static long read_bi(biRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_bi;
} devBiSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_bi
};
epicsExportAddress(dset, devBiSoft);
static long init_record(biRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devBiSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_bi(biRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0)) {
if (prec->inp.type != CONSTANT)
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 2;
}

View File

@@ -0,0 +1,76 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "biRecord.h"
#include "epicsExport.h"
/* Create the dset for devBiSoftRaw */
static long init_record(biRecord *prec);
static long read_bi(biRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_bi;
} devBiSoftRaw = {
5,
NULL,
NULL,
init_record,
NULL,
read_bi
};
epicsExportAddress(dset, devBiSoftRaw);
static long init_record(biRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devBiSoftRaw (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_bi(biRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_ULONG, &prec->rval, 0, 0) &&
prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
return 0;
}

74
src/std/dev/devBoSoft.c Normal file
View File

@@ -0,0 +1,74 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devBoSoft.c */
/* base/src/dev $Revision-Id$ */
/* devBoSoft.c - Device Support Routines for Soft Binary Output*/
/*
* Original Author: Bob Dalesio
* Current Author: Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "boRecord.h"
#include "epicsExport.h"
static long init_record(boRecord *prec);
/* Create the dset for devBoSoft */
static long write_bo(boRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_bo;
}devBoSoft={
5,
NULL,
NULL,
init_record,
NULL,
write_bo
};
epicsExportAddress(dset,devBoSoft);
static long init_record(boRecord *prec)
{
long status=0;
/* dont convert */
status=2;
return status;
} /* end init_record() */
static long write_bo(boRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_USHORT,&prec->val,1);
return(status);
}

View File

@@ -0,0 +1,70 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devBoCallbackSoft.c */
/*
* Author: Marty Kraimer
* Date: 04NOV2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbLock.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "boRecord.h"
#include "epicsExport.h"
/* Create the dset for devBoCallbackSoft */
static long write_bo(boRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_bo;
}devBoSoftCallback={
5,
NULL,
NULL,
NULL,
NULL,
write_bo
};
epicsExportAddress(dset,devBoSoftCallback);
static long write_bo(boRecord *prec)
{
struct link *plink = &prec->out;
long status;
if(prec->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(plink,DBR_USHORT,&prec->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_USHORT,&prec->val,1,
dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
prec->pact = TRUE;
return(0);
}

View File

@@ -0,0 +1,73 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devBoSoftRaw.c */
/* base/src/dev $Revision-Id$ */
/* devBoSoftRaw.c - Device Support Routines for SoftRaw Binary Output*/
/*
* Author: Janet Anderson
* Date: 3-28-92
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "boRecord.h"
#include "epicsExport.h"
/* added for Channel Access Links */
static long init_record(boRecord *prec);
/* Create the dset for devBoSoftRaw */
static long write_bo(boRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_bo;
}devBoSoftRaw={
5,
NULL,
NULL,
init_record,
NULL,
write_bo
};
epicsExportAddress(dset,devBoSoftRaw);
static long init_record(boRecord *prec)
{
long status;
/*Don't convert*/
status = 2;
return status;
} /* end init_record() */
static long write_bo(boRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_LONG, &prec->rval,1);
return(status);
}

View File

@@ -0,0 +1,49 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devCalcoutSoft.c */
/*
* Author: Marty Kraimer
* Date: 05DEC2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "special.h"
#include "postfix.h"
#include "calcoutRecord.h"
#include "epicsExport.h"
static long write_calcout(calcoutRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write;
} devCalcoutSoft = {
5, NULL, NULL, NULL, NULL, write_calcout
};
epicsExportAddress(dset, devCalcoutSoft);
static long write_calcout(calcoutRecord *prec)
{
return dbPutLink(&prec->out, DBR_DOUBLE, &prec->oval, 1);
}

View File

@@ -0,0 +1,64 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devCalcoutSoftCallback.c */
/*
* Author: Marty Kraimer
* Date: 05DEC2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "special.h"
#include "postfix.h"
#include "calcoutRecord.h"
#include "epicsExport.h"
static long write_calcout(calcoutRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write;
} devCalcoutSoftCallback = {
5, NULL, NULL, NULL, NULL, write_calcout
};
epicsExportAddress(dset, devCalcoutSoftCallback);
static long write_calcout(calcoutRecord *prec)
{
struct link *plink = &prec->out;
long status;
if (prec->pact) return 0;
if (plink->type != CA_LINK) {
status = dbPutLink(plink, DBR_DOUBLE, &prec->oval, 1);
return status;
}
status = dbCaPutLinkCallback(plink, DBR_DOUBLE, &prec->oval, 1,
dbCaCallbackProcess, plink);
if (status) {
recGblSetSevr(prec, LINK_ALARM, INVALID_ALARM);
return status;
}
prec->pact = TRUE;
return 0;
}

View File

@@ -0,0 +1,81 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Author: Janet Anderson
* Date: 04-21-91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "eventRecord.h"
#include "epicsExport.h"
/* Create the dset for devEventSoft */
static long init_record(eventRecord *prec);
static long read_event(eventRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_event;
} devEventSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_event
};
epicsExportAddress(dset, devEventSoft);
static long init_record(eventRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_USHORT, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devEventSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_event(eventRecord *prec)
{
long status;
status = dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0);
if (!status) {
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return status;
}

View File

@@ -0,0 +1,298 @@
/*************************************************************************\
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$ */
/*
* Original Author: Sheng Peng, ORNL / SNS Project
* Date: 07/2004
*
* EPICS device support for general timestamp support
*
* Integrated into base by Peter Denison, Diamond Light Source
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "epicsString.h"
#include "epicsGeneralTime.h"
#include "epicsExport.h"
#include "aiRecord.h"
#include "boRecord.h"
#include "longinRecord.h"
#include "stringinRecord.h"
/********* ai record **********/
static int getCurrentTime(double * pseconds)
{
epicsTimeStamp ts;
if (epicsTimeERROR != epicsTimeGetCurrent(&ts)) {
*pseconds = ts.secPastEpoch + ((double)(ts.nsec)) * 1e-9;
return 0;
}
return -1;
}
static struct ai_channel {
char *name;
int (*get)(double *);
} ai_channels[] = {
{"TIME", getCurrentTime},
};
static long init_ai(aiRecord *prec)
{
int i;
if (prec->inp.type != INST_IO) {
recGblRecordError(S_db_badField, (void *)prec,
"devAiGeneralTime::init_ai: Illegal INP field");
prec->pact = TRUE;
return S_db_badField;
}
for (i = 0; i < NELEMENTS(ai_channels); i++) {
struct ai_channel *pchan = &ai_channels[i];
if (!epicsStrCaseCmp(prec->inp.value.instio.string, pchan->name)) {
prec->dpvt = pchan;
return 0;
}
}
recGblRecordError(S_db_badField, (void *)prec,
"devAiGeneralTime::init_ai: Bad parm");
prec->pact = TRUE;
prec->dpvt = NULL;
return S_db_badField;
}
static long read_ai(aiRecord *prec)
{
struct ai_channel *pchan = (struct ai_channel *)prec->dpvt;
if (!pchan) return -1;
if (pchan->get(&prec->val) == 0) {
prec->udf = FALSE;
return 2;
}
prec->udf = TRUE;
recGblSetSevr(prec, READ_ALARM, INVALID_ALARM);
return -1;
}
struct {
dset common;
DEVSUPFUN read_write;
DEVSUPFUN special_linconv;
} devAiGeneralTime = {
{6, NULL, NULL, init_ai, NULL}, read_ai, NULL
};
epicsExportAddress(dset, devAiGeneralTime);
/********* bo record **********/
static void resetErrors(void)
{
generalTimeResetErrorCounts();
}
static struct bo_channel {
char *name;
void (*put)(void);
} bo_channels[] = {
{"RSTERRCNT", resetErrors},
};
static long init_bo(boRecord *prec)
{
int i;
if (prec->out.type != INST_IO) {
recGblRecordError(S_db_badField, (void *)prec,
"devAiGeneralTime::init_ai: Illegal INP field");
prec->pact = TRUE;
return S_db_badField;
}
for (i = 0; i < NELEMENTS(bo_channels); i++) {
struct bo_channel *pchan = &bo_channels[i];
if (!epicsStrCaseCmp(prec->out.value.instio.string, pchan->name)) {
prec->dpvt = pchan;
prec->mask = 0;
return 2;
}
}
recGblRecordError(S_db_badField, (void *)prec,
"devBoGeneralTime::init_bo: Bad parm");
prec->pact = TRUE;
prec->dpvt = NULL;
return S_db_badField;
}
static long write_bo(boRecord *prec)
{
struct bo_channel *pchan = (struct bo_channel *)prec->dpvt;
if (!pchan) return -1;
pchan->put();
return 0;
}
struct {
dset common;
DEVSUPFUN read_write;
} devBoGeneralTime = {
{5, NULL, NULL, init_bo, NULL}, write_bo
};
epicsExportAddress(dset, devBoGeneralTime);
/******* longin record *************/
static int errorCount(void)
{
return generalTimeGetErrorCounts();
}
static struct li_channel {
char *name;
int (*get)(void);
} li_channels[] = {
{"GETERRCNT", errorCount},
};
static long init_li(longinRecord *prec)
{
int i;
if (prec->inp.type != INST_IO) {
recGblRecordError(S_db_badField, (void *)prec,
"devLiGeneralTime::init_li: Illegal INP field");
prec->pact = TRUE;
return S_db_badField;
}
for (i = 0; i < NELEMENTS(li_channels); i++) {
struct li_channel *pchan = &li_channels[i];
if (!epicsStrCaseCmp(prec->inp.value.instio.string, pchan->name)) {
prec->dpvt = pchan;
return 0;
}
}
recGblRecordError(S_db_badField, (void *)prec,
"devLiGeneralTime::init_li: Bad parm");
prec->pact = TRUE;
prec->dpvt = NULL;
return S_db_badField;
}
static long read_li(longinRecord *prec)
{
struct li_channel *pchan = (struct li_channel *)prec->dpvt;
if (!pchan) return -1;
prec->val = pchan->get();
return 0;
}
struct {
dset common;
DEVSUPFUN read_write;
} devLiGeneralTime = {
{5, NULL, NULL, init_li, NULL}, read_li
};
epicsExportAddress(dset, devLiGeneralTime);
/********** stringin record **********/
static const char * timeProvider(void)
{
return generalTimeCurrentProviderName();
}
static const char * highestProvider(void)
{
return generalTimeHighestCurrentName();
}
static const char * eventProvider(void)
{
return generalTimeEventProviderName();
}
static struct si_channel {
char *name;
const char * (*get)(void);
} si_channels[] = {
{"BESTTCP", timeProvider},
{"TOPTCP", highestProvider},
{"BESTTEP", eventProvider},
};
static long init_si(stringinRecord *prec)
{
int i;
if (prec->inp.type != INST_IO) {
recGblRecordError(S_db_badField, (void *)prec,
"devSiGeneralTime::init_si: Illegal INP field");
prec->pact = TRUE;
return S_db_badField;
}
for (i = 0; i < NELEMENTS(si_channels); i++) {
struct si_channel *pchan = &si_channels[i];
if (!epicsStrCaseCmp(prec->inp.value.instio.string, pchan->name)) {
prec->dpvt = pchan;
return 0;
}
}
recGblRecordError(S_db_badField, (void *)prec,
"devSiGeneralTime::init_si: Bad parm");
prec->pact = TRUE;
prec->dpvt = NULL;
return S_db_badField;
}
static long read_si(stringinRecord *prec)
{
struct si_channel *pchan = (struct si_channel *)prec->dpvt;
const char *name;
if (!pchan) return -1;
name = pchan->get();
if (name) {
strncpy(prec->val, name, sizeof(prec->val));
prec->val[sizeof(prec->val) - 1] = '\0';
} else {
strcpy(prec->val, "No working providers");
recGblSetSevr(prec, READ_ALARM, MAJOR_ALARM);
}
prec->udf = FALSE;
return 0;
}
struct {
dset common;
DEVSUPFUN read_write;
} devSiGeneralTime = {
{5, NULL, NULL, init_si, NULL}, read_si
};
epicsExportAddress(dset, devSiGeneralTime);

View File

@@ -0,0 +1,81 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devHistogramSoft.c */
/* base/src/dev $Revision-Id$ */
/*
* Author: Janet Anderson
* Date: 07/02/91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "cvtTable.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "histogramRecord.h"
#include "epicsExport.h"
/* Create the dset for devHistogramSoft */
static long init_record(histogramRecord *prec);
static long read_histogram(histogramRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_histogram;
DEVSUPFUN special_linconv;
}devHistogramSoft={
6,
NULL,
NULL,
init_record,
NULL,
read_histogram,
NULL
};
epicsExportAddress(dset,devHistogramSoft);
static long init_record(histogramRecord *prec)
{
long status = 0;
/* histogram.svl must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/
switch (prec->svl.type) {
case (CONSTANT) :
if(recGblInitConstantLink(&prec->svl,DBF_DOUBLE,&prec->sgnl))
prec->udf = FALSE;
break;
case (PV_LINK) :
case (DB_LINK) :
case (CA_LINK) :
break;
default :
recGblRecordError(S_db_badField,(void *)prec,
"devHistogramSoft (init_record) Illegal SVL field");
return(S_db_badField);
}
return(status);
}
static long read_histogram(histogramRecord *prec)
{
long status;
status = dbGetLink(&prec->svl,DBR_DOUBLE, &prec->sgnl,0,0);
return(0); /*add count*/
}

79
src/std/dev/devLiSoft.c Normal file
View File

@@ -0,0 +1,79 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Author: Janet Anderson
* Date: 09-23-91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "longinRecord.h"
#include "epicsExport.h"
/* Create the dset for devLiSoft */
static long init_record(longinRecord *prec);
static long read_longin(longinRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_longin;
} devLiSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_longin
};
epicsExportAddress(dset, devLiSoft);
static long init_record(longinRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_LONG, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devLiSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_longin(longinRecord *prec)
{
long status;
status = dbGetLink(&prec->inp, DBR_LONG, &prec->val, 0, 0);
if (!status &&
prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
return status;
}

60
src/std/dev/devLoSoft.c Normal file
View File

@@ -0,0 +1,60 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devLoSoft.c */
/* base/src/dev $Revision-Id$ */
/*
* Author: Janet Anderson
* Date: 09-23-91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "longoutRecord.h"
#include "epicsExport.h"
/* Create the dset for devLoSoft */
static long init_record(longoutRecord *prec);
static long write_longout(longoutRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_longout;
}devLoSoft={
5,
NULL,
NULL,
init_record,
NULL,
write_longout
};
epicsExportAddress(dset,devLoSoft);
static long init_record(longoutRecord *prec)
{
return(0);
} /* end init_record() */
static long write_longout(longoutRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_LONG, &prec->val,1);
return(0);
}

View File

@@ -0,0 +1,67 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devLoSoftCallback.c */
/*
* Author: Marty Kraimer
* Date: 04NOV2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "longoutRecord.h"
#include "epicsExport.h"
/* Create the dset for devLoSoftCallback */
static long write_longout(longoutRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_longout;
}devLoSoftCallback={
5,
NULL,
NULL,
NULL,
NULL,
write_longout
};
epicsExportAddress(dset,devLoSoftCallback);
static long write_longout(longoutRecord *prec)
{
struct link *plink = &prec->out;
long status;
if(prec->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(plink,DBR_LONG,&prec->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_LONG,&prec->val,1,
dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
prec->pact = TRUE;
return(0);
}

View File

@@ -0,0 +1,79 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Matthew Needes
* Date: 10-08-93
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "mbbiDirectRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbbiDirectSoft */
static long init_record(mbbiDirectRecord *prec);
static long read_mbbi(mbbiDirectRecord *prec);
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
};
epicsExportAddress(dset, devMbbiDirectSoft);
static long init_record(mbbiDirectRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devMbbiDirectSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_mbbi(mbbiDirectRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0)) {
if (prec->inp.type != CONSTANT)
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 2;
}

View File

@@ -0,0 +1,80 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Matthew Needes
* Date: 10-08-93
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "mbbiDirectRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbbiDirectSoftRaw */
static long init_record(mbbiDirectRecord *prec);
static long read_mbbi(mbbiDirectRecord *prec);
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
};
epicsExportAddress(dset, devMbbiDirectSoftRaw);
static long init_record(mbbiDirectRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devMbbiDirectSoftRaw (init_record) Illegal INP field");
return S_db_badField;
}
/*to preserve old functionality*/
if (prec->nobt == 0) prec->mask = 0xffffffff;
prec->mask <<= prec->shft;
return 0;
}
static long read_mbbi(mbbiDirectRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_LONG, &prec->rval, 0, 0)) {
prec->rval &= prec->mask;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 0;
}

79
src/std/dev/devMbbiSoft.c Normal file
View File

@@ -0,0 +1,79 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "mbbiRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbbiSoft */
static long init_record(mbbiRecord *prec);
static long read_mbbi(mbbiRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_mbbi;
} devMbbiSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_mbbi
};
epicsExportAddress(dset, devMbbiSoft);
static long init_record(mbbiRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devMbbiSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_mbbi(mbbiRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0)) {
if (prec->inp.type != CONSTANT)
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 2;
}

View File

@@ -0,0 +1,80 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "mbbiRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbbiSoftRaw */
static long init_record(mbbiRecord *prec);
static long read_mbbi(mbbiRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_mbbi;
} devMbbiSoftRaw = {
5,
NULL,
NULL,
init_record,
NULL,
read_mbbi
};
epicsExportAddress(dset, devMbbiSoftRaw);
static long init_record(mbbiRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devMbbiSoftRaw (init_record) Illegal INP field");
return S_db_badField;
}
/*to preserve old functionality*/
if (prec->nobt == 0) prec->mask = 0xffffffff;
prec->mask <<= prec->shft;
return 0;
}
static long read_mbbi(mbbiRecord *prec)
{
if (!dbGetLink(&prec->inp, DBR_LONG, &prec->rval, 0, 0)) {
prec->rval &= prec->mask;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 0;
}

View File

@@ -0,0 +1,66 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboDirectSoft.c */
/* base/src/dev $Revision-Id$ */
/*
* Original Author: Bob Dalesio
* Current Author: Matthew Needes
* Date: 10-08-93
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "mbboDirectRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbboSoft */
static long init_record(mbboDirectRecord *prec);
static long write_mbbo(mbboDirectRecord *prec);
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
};
epicsExportAddress(dset,devMbboDirectSoft);
static long init_record(mbboDirectRecord *prec)
{
long status = 0;
/* dont convert */
status = 2;
return status;
} /* end init_record() */
static long write_mbbo(mbboDirectRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_USHORT,&prec->val,1);
return(0);
}

View File

@@ -0,0 +1,66 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboDirectSoftCallback.c */
/*
* Author: Marty Kraimer
* Date: 04NOV2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "mbboDirectRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbboSoft */
static long write_mbbo(mbboDirectRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_mbbo;
}devMbboDirectSoftCallback={
5,
NULL,
NULL,
NULL,
NULL,
write_mbbo
};
epicsExportAddress(dset,devMbboDirectSoftCallback);
static long write_mbbo(mbboDirectRecord *prec)
{
struct link *plink = &prec->out;
long status;
if(prec->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(plink,DBR_USHORT,&prec->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_USHORT,&prec->val,1,
dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
prec->pact = TRUE;
return(0);
}

View File

@@ -0,0 +1,71 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboDirectSoftRaw.c */
/* base/src/dev $Revision-Id$ */
/*
* Author: Janet Anderson
* Current Author: Matthew Needes
* Date: 10-08-93
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "mbboDirectRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbboDirectSoftRaw */
static long init_record(mbboDirectRecord *prec);
static long write_mbbo(mbboDirectRecord *prec);
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
};
epicsExportAddress(dset,devMbboDirectSoftRaw);
static long init_record(mbboDirectRecord *prec)
{
long status = 0;
if (prec->out.type != PV_LINK)
status = 2;
/*to preserve old functionality*/
if(prec->nobt == 0) prec->mask = 0xffffffff;
prec->mask <<= prec->shft;
return status;
} /* end init_record() */
static long write_mbbo(mbboDirectRecord *prec)
{
long status;
unsigned long data;
data = prec->rval & prec->mask;
status = dbPutLink(&prec->out,DBR_LONG, &data,1);
return(0);
}

67
src/std/dev/devMbboSoft.c Normal file
View File

@@ -0,0 +1,67 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboSoft.c */
/* base/src/dev $Revision-Id$ */
/*
* Original Author: Bob Dalesio
* Current Author: Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "mbboRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbboSoft */
static long init_record(mbboRecord *prec);
static long write_mbbo(mbboRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_mbbo;
}devMbboSoft={
5,
NULL,
NULL,
init_record,
NULL,
write_mbbo
};
epicsExportAddress(dset,devMbboSoft);
static long init_record(mbboRecord *prec)
{
long status=0;
/*dont convert*/
status=2;
return status;
} /* end init_record() */
static long write_mbbo(mbboRecord *prec)
{
long status;
status = dbPutLink(&prec->out,DBR_USHORT, &prec->val,1);
return(0);
}

View File

@@ -0,0 +1,66 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboSoftCallback.c */
/*
* Author: Marty Kraimer
* Date: 04NOV2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "mbboRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbboSoftCallback */
static long write_mbbo(mbboRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_mbbo;
}devMbboSoftCallback={
5,
NULL,
NULL,
NULL,
NULL,
write_mbbo
};
epicsExportAddress(dset,devMbboSoftCallback);
static long write_mbbo(mbboRecord *prec)
{
struct link *plink = &prec->out;
long status;
if(prec->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(plink,DBR_USHORT,&prec->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_USHORT,&prec->val,1,
dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
prec->pact = TRUE;
return(0);
}

View File

@@ -0,0 +1,71 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboSoftRaw.c */
/* base/src/dev $Revision-Id$ */
/*
* Author: Janet Anderson
* Date: 3-28-92
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "mbboRecord.h"
#include "epicsExport.h"
/* Create the dset for devMbboSoftRaw */
static long init_record(mbboRecord *prec);
static long write_mbbo(mbboRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_mbbo;
}devMbboSoftRaw={
5,
NULL,
NULL,
init_record,
NULL,
write_mbbo
};
epicsExportAddress(dset,devMbboSoftRaw);
static long init_record(mbboRecord *prec)
{
long status;
/*to preserve old functionality*/
if(prec->nobt == 0) prec->mask = 0xffffffff;
prec->mask <<= prec->shft;
/*dont convert*/
status = 2;
return status;
} /* end init_record() */
static long write_mbbo(mbboRecord *prec)
{
long status;
unsigned long data;
data = prec->rval & prec->mask;
status = dbPutLink(&prec->out,DBR_LONG, &data,1);
return(0);
}

100
src/std/dev/devSASoft.c Normal file
View File

@@ -0,0 +1,100 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 Lawrence Berkeley Laboratory,The Control Systems
* Group, Systems Engineering Department
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Author: Carl Lionberger
* Date: 9-2-93
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "subArrayRecord.h"
#include "epicsExport.h"
/* Create the dset for devSASoft */
static long init_record(subArrayRecord *prec);
static long read_sa(subArrayRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_sa;
} devSASoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_sa
};
epicsExportAddress(dset, devSASoft);
static long init_record(subArrayRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
prec->nord = 0;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devSASoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_sa(subArrayRecord *prec)
{
long nRequest = prec->indx + prec->nelm;
long ecount;
if (nRequest > prec->malm)
nRequest = prec->malm;
if (prec->inp.type == CONSTANT)
nRequest = prec->nord;
else
dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest);
ecount = nRequest - prec->indx;
if (ecount > 0) {
int esize = dbValueSize(prec->ftvl);
if (ecount > prec->nelm)
ecount = prec->nelm;
memmove(prec->bptr, (char *)prec->bptr + prec->indx * esize,
ecount * esize);
} else
ecount = 0;
prec->nord = ecount;
if (nRequest > 0 &&
prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
return 0;
}

84
src/std/dev/devSiSoft.c Normal file
View File

@@ -0,0 +1,84 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Author: Janet Anderson
* Date: 04-21-91
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "epicsTime.h"
#include "recGbl.h"
#include "devSup.h"
#include "link.h"
#include "stringinRecord.h"
#include "epicsExport.h"
/* Create the dset for devSiSoft */
static long init_record(stringinRecord *prec);
static long read_stringin(stringinRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_stringin;
} devSiSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_stringin
};
epicsExportAddress(dset, devSiSoft);
static long init_record(stringinRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_STRING, prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devSiSoft (init_record) Illegal INP field");
return S_db_badField;
}
return 0;
}
static long read_stringin(stringinRecord *prec)
{
long status;
status = dbGetLink(&prec->inp, DBR_STRING, prec->val, 0, 0);
if (!status) {
if (prec->inp.type != CONSTANT)
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return status;
}

54
src/std/dev/devSoSoft.c Normal file
View File

@@ -0,0 +1,54 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$ */
/*
* Author: Janet Anderson
* Date: 21APR1991
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "stringoutRecord.h"
#include "epicsExport.h"
/* Create the dset for devSoSoft */
static long write_stringout(stringoutRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_stringout;
} devSoSoft = {
5,
NULL,
NULL,
NULL,
NULL,
write_stringout
};
epicsExportAddress(dset, devSoSoft);
static long write_stringout(stringoutRecord *prec)
{
long status;
status = dbPutLink(&prec->out, DBR_STRING, prec->val, 1);
return status;
}

View File

@@ -0,0 +1,68 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$ */
/*
* Author: Marty Kraimer
* Date: 04NOV2003
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "stringoutRecord.h"
#include "epicsExport.h"
/* Create the dset for devSoSoftCallback */
static long write_stringout(stringoutRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_stringout;
} devSoSoftCallback = {
5,
NULL,
NULL,
NULL,
NULL,
write_stringout
};
epicsExportAddress(dset, devSoSoftCallback);
static long write_stringout(stringoutRecord *prec)
{
struct link *plink = &prec->out;
long status;
if (prec->pact) return 0;
if (plink->type != CA_LINK) {
return dbPutLink(plink, DBR_STRING, &prec->val, 1);
}
status = dbCaPutLinkCallback(plink, DBR_STRING, &prec->val, 1,
dbCaCallbackProcess, plink);
if (status) {
recGblSetSevr(prec, LINK_ALARM, INVALID_ALARM);
return status;
}
prec->pact = TRUE;
return 0;
}

109
src/std/dev/devSoStdio.c Normal file
View File

@@ -0,0 +1,109 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$ */
#include <stdio.h>
#include <string.h>
#include "dbCommon.h"
#include "devSup.h"
#include "errlog.h"
#include "recGbl.h"
#include "recSup.h"
#include "epicsExport.h"
#include "stringoutRecord.h"
typedef int (*PRINTFFUNC)(const char *fmt, ...);
static int stderrPrintf(const char *fmt, ...);
static int logPrintf(const char *fmt, ...);
static struct outStream {
const char *name;
PRINTFFUNC print;
} outStreams[] = {
{"stdout", printf},
{"stderr", stderrPrintf},
{"errlog", logPrintf},
{NULL, NULL}
};
static int stderrPrintf(const char *fmt, ...) {
va_list pvar;
int retval;
va_start(pvar, fmt);
retval = vfprintf(stderr, fmt, pvar);
va_end (pvar);
return retval;
}
static int logPrintf(const char *fmt, ...) {
va_list pvar;
int retval;
va_start(pvar, fmt);
retval = errlogVprintf(fmt, pvar);
va_end (pvar);
return retval;
}
static long add(dbCommon *pcommon) {
stringoutRecord *prec = (stringoutRecord *) pcommon;
struct outStream *pstream;
if (prec->out.type != INST_IO)
return S_dev_badOutType;
for (pstream = outStreams; pstream->name; ++pstream) {
if (strcmp(prec->out.value.instio.string, pstream->name) == 0) {
prec->dpvt = pstream;
return 0;
}
}
prec->dpvt = NULL;
return -1;
}
static long del(dbCommon *pcommon) {
stringoutRecord *prec = (stringoutRecord *) pcommon;
prec->dpvt = NULL;
return 0;
}
static struct dsxt dsxtSoStdio = {
add, del
};
static long init(int pass)
{
if (pass == 0) devExtend(&dsxtSoStdio);
return 0;
}
static long write_string(stringoutRecord *prec)
{
struct outStream *pstream = (struct outStream *)prec->dpvt;
if (pstream)
pstream->print("%s\n", prec->val);
return 0;
}
/* Create the dset for devSoStdio */
static struct {
dset common;
DEVSUPFUN write;
} devSoStdio = {
{5, NULL, init, NULL, NULL}, write_string
};
epicsExportAddress(dset, devSoStdio);

46
src/std/dev/devSoft.dbd Normal file
View File

@@ -0,0 +1,46 @@
device(aai,CONSTANT,devAaiSoft,"Soft Channel")
device(aao,CONSTANT,devAaoSoft,"Soft Channel")
device(ai,CONSTANT,devAiSoft,"Soft Channel")
device(ao,CONSTANT,devAoSoft,"Soft Channel")
device(bi,CONSTANT,devBiSoft,"Soft Channel")
device(bo,CONSTANT,devBoSoft,"Soft Channel")
device(calcout,CONSTANT,devCalcoutSoft,"Soft Channel")
device(event,CONSTANT,devEventSoft,"Soft Channel")
device(histogram,CONSTANT,devHistogramSoft,"Soft Channel")
device(longin,CONSTANT,devLiSoft,"Soft Channel")
device(longout,CONSTANT,devLoSoft,"Soft Channel")
device(mbbi,CONSTANT,devMbbiSoft,"Soft Channel")
device(mbbiDirect,CONSTANT,devMbbiDirectSoft,"Soft Channel")
device(mbbo,CONSTANT,devMbboSoft,"Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoft,"Soft Channel")
device(stringin,CONSTANT,devSiSoft,"Soft Channel")
device(stringout,CONSTANT,devSoSoft,"Soft Channel")
device(subArray,CONSTANT,devSASoft,"Soft Channel")
device(waveform,CONSTANT,devWfSoft,"Soft Channel")
device(ai,CONSTANT,devAiSoftRaw,"Raw Soft Channel")
device(ao,CONSTANT,devAoSoftRaw,"Raw Soft Channel")
device(bi,CONSTANT,devBiSoftRaw,"Raw Soft Channel")
device(bo,CONSTANT,devBoSoftRaw,"Raw Soft Channel")
device(mbbi,CONSTANT,devMbbiSoftRaw,"Raw Soft Channel")
device(mbbiDirect,CONSTANT,devMbbiDirectSoftRaw,"Raw Soft Channel")
device(mbbo,CONSTANT,devMbboSoftRaw,"Raw Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoftRaw,"Raw Soft Channel")
device(ao,CONSTANT,devAoSoftCallback,"Async Soft Channel")
device(bo,CONSTANT,devBoSoftCallback,"Async Soft Channel")
device(calcout,CONSTANT,devCalcoutSoftCallback,"Async Soft Channel")
device(longout,CONSTANT,devLoSoftCallback,"Async Soft Channel")
device(mbbo,CONSTANT,devMbboSoftCallback,"Async Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoftCallback,"Async Soft Channel")
device(stringout,CONSTANT,devSoSoftCallback,"Async Soft Channel")
device(ai, INST_IO,devTimestampAI,"Soft Timestamp")
device(stringin,INST_IO,devTimestampSI,"Soft Timestamp")
device(ai, INST_IO,devAiGeneralTime,"General Time")
device(bo, INST_IO,devBoGeneralTime,"General Time")
device(longin, INST_IO,devLiGeneralTime,"General Time")
device(stringin,INST_IO,devSiGeneralTime,"General Time")
device(stringout,INST_IO,devSoStdio,"stdio")

View File

@@ -0,0 +1,78 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$ */
/*
* Device support for EPICS time stamps
*
* Original Author: Eric Norum
*/
#include "dbDefs.h"
#include "epicsTime.h"
#include "alarm.h"
#include "devSup.h"
#include "recGbl.h"
#include "epicsExport.h"
#include "aiRecord.h"
#include "stringinRecord.h"
/* Extended device support to allow INP field changes */
static long initAllow(int pass) {
if (pass == 0) devExtend(&devSoft_DSXT);
return 0;
}
/* ai record */
static long read_ai(aiRecord *prec)
{
recGblGetTimeStamp(prec);
prec->val = prec->time.secPastEpoch + (double)prec->time.nsec * 1e-9;
prec->udf = FALSE;
return 2;
}
struct {
dset common;
DEVSUPFUN read_write;
DEVSUPFUN special_linconv;
} devTimestampAI = {
{6, NULL, initAllow, NULL, NULL}, read_ai, NULL
};
epicsExportAddress(dset, devTimestampAI);
/* stringin record */
static long read_stringin (stringinRecord *prec)
{
int len;
recGblGetTimeStamp(prec);
len = epicsTimeToStrftime(prec->val, sizeof prec->val,
prec->inp.value.instio.string, &prec->time);
if (len >= sizeof prec->val) {
prec->udf = TRUE;
recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
return -1;
}
prec->udf = FALSE;
return 0;
}
struct {
dset common;
DEVSUPFUN read_stringin;
} devTimestampSI = {
{5, NULL, initAllow, NULL, NULL}, read_stringin
};
epicsExportAddress(dset, devTimestampSI);

81
src/std/dev/devWfSoft.c Normal file
View File

@@ -0,0 +1,81 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$
*
* Original Authors: Bob Dalesio and Marty Kraimer
* Date: 6-1-90
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "devSup.h"
#include "waveformRecord.h"
#include "epicsExport.h"
/* Create the dset for devWfSoft */
static long init_record(waveformRecord *prec);
static long read_wf(waveformRecord *prec);
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_wf;
} devWfSoft = {
5,
NULL,
NULL,
init_record,
NULL,
read_wf
};
epicsExportAddress(dset, devWfSoft);
static long init_record(waveformRecord *prec)
{
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
prec->nord = 0;
break;
case PV_LINK:
case DB_LINK:
case CA_LINK:
break;
default:
recGblRecordError(S_db_badField, (void *)prec,
"devWfSoft (init_record) Illegal INP field");
return(S_db_badField);
}
return 0;
}
static long read_wf(waveformRecord *prec)
{
long nRequest = prec->nelm;
dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest);
if (nRequest > 0) {
prec->nord = nRequest;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
}
return 0;
}

36
src/std/dev/softDevIoc.rc Executable file
View File

@@ -0,0 +1,36 @@
#include <Winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION EPICS_VERSION,EPICS_REVISION,EPICS_MODIFICATION,EPICS_PATCH_LEVEL
PRODUCTVERSION EPICS_VERSION,EPICS_REVISION,EPICS_MODIFICATION,EPICS_PATCH_LEVEL
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_UNKNOWN
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments","Soft Device Support Library for EPICS\0"
VALUE "CompanyName", "The EPICS collaboration\0"
VALUE "FileDescription", "Soft Device Support Library\0"
VALUE "FileVersion", EPICS_VERSION_STRING "\0"
VALUE "InternalName", "softDevIoc\0"
VALUE "LegalCopyright", "Copyright (C) Univ. of California, Univ. of Chicago\0"
VALUE "OriginalFilename", "softDevIoc.dll\0"
VALUE "ProductName", "Experimental Physics and Industrial Control System (EPICS)\0"
VALUE "ProductVersion", EPICS_VERSION_STRING "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END