- Record updates:
. aoRecord . biRecord . boRecord . mbbiRecord . mbbiDirectRecord . mbboRecord . mbboDirectRecord . longinRecord . longoutRecord . stringoutRecord . stringinRecord . waveformRecord . calcoutRecord . subArrayRecord - Device support updates: . devAoSoft, devAoSoftCallback, devAoSoftRaw (aoRecord) . devBiSoft, devBiSoftCallback, devBiSoftRaw, devBiDbState (biRecord) . devBoSoft, devBoSoftCallback, devBoSoftRaw, devBoDbState, devGeneralTime (boRecord) . devMbbiSoft, devMbbiSoftCallback, devMbbiSoftRaw (mbbiRecord) . devMbboSoft, devMbboSoftCallback, devMbboSoftRaw (mbboRecord) . devMbbiDirectSoft, devMbbiDirectSoftCallback, devMbbiDirectSoftRaw (mbbiDirectRecord) . devMbboDirectSoft, devMbboDirectSoftCallback, devMbboDirectSoftRaw (mbboDirectRecord) . devGeneralTime, devLiSoft, devLiSoftCallback (longinRecord) . devLoSoft, devLoSoftCallback (longoutRecord) . devSoSoft, devSoSoftCallback, devStdio (stringoutRecord) . devSiSoft, devSiSoftCallback, devEnviron, devGeneralTime, devTimestamp (stringinRecord) . devWfSoft (waveformRecord) . devCalcoutSoft, devCalcoutSoftCallback (recordCalcout) . devSASoft (subArrayRecord)
This commit is contained in:
@@ -18,9 +18,12 @@ aoRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += aiRecord
|
||||
stdRecords += aoRecord
|
||||
stdRecords += aSubRecord
|
||||
biRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += biRecord
|
||||
boRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += boRecord
|
||||
stdRecords += calcRecord
|
||||
calcoutRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += calcoutRecord
|
||||
stdRecords += compressRecord
|
||||
stdRecords += dfanoutRecord
|
||||
@@ -31,15 +34,21 @@ int64inRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += int64inRecord
|
||||
int64outRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += int64outRecord
|
||||
longinRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += longinRecord
|
||||
longoutRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += longoutRecord
|
||||
lsiRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += lsiRecord
|
||||
lsoRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += lsoRecord
|
||||
mbbiRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += mbbiRecord
|
||||
mbbiDirectRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += mbbiDirectRecord
|
||||
mbboRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += mbboRecord
|
||||
mbboDirectRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += mbboDirectRecord
|
||||
stdRecords += permissiveRecord
|
||||
printfRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
@@ -48,9 +57,12 @@ stdRecords += selRecord
|
||||
stdRecords += seqRecord
|
||||
stdRecords += stateRecord
|
||||
stdRecords += stringinRecord
|
||||
stringoutRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += stringoutRecord
|
||||
stdRecords += subRecord
|
||||
subArrayRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += subArrayRecord
|
||||
waveformRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += waveformRecord
|
||||
|
||||
DBDINC += $(stdRecords)
|
||||
|
||||
@@ -81,7 +81,9 @@ rset aoRSET={
|
||||
put_enum_str,
|
||||
get_graphic_double,
|
||||
get_control_double,
|
||||
get_alarm_double };
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset,aoRSET);
|
||||
|
||||
static void checkAlarms(aoRecord *);
|
||||
static long fetch_value(aoRecord *, double *);
|
||||
@@ -92,7 +94,7 @@ static long writeValue(aoRecord *);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct aoRecord *prec = (struct aoRecord *)pcommon;
|
||||
struct aodset *pdset;
|
||||
aodset *pdset;
|
||||
double eoff = prec->eoff, eslo = prec->eslo;
|
||||
double value;
|
||||
long status = 0;
|
||||
@@ -101,7 +103,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
|
||||
if(!(pdset = (struct aodset *)(prec->dset))) {
|
||||
if(!(pdset = (aodset *)(prec->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,(void *)prec,"ao: init_record");
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
@@ -110,7 +112,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
prec->udf = isnan(prec->val);
|
||||
|
||||
/* must have write_ao function defined */
|
||||
if ((pdset->number < 6) || (pdset->write_ao ==NULL)) {
|
||||
if ((pdset->common.number < 6) || (pdset->write_ao ==NULL)) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"ao: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
@@ -120,8 +122,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
prec->eoff = prec->egul;
|
||||
}
|
||||
|
||||
if (pdset->init_record) {
|
||||
status = (*pdset->init_record)(prec);
|
||||
if (pdset->common.init_record) {
|
||||
status = pdset->common.init_record(pcommon);
|
||||
if (prec->linr == menuConvertSLOPE) {
|
||||
prec->eoff = eoff;
|
||||
prec->eslo = eslo;
|
||||
@@ -162,7 +164,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct aoRecord *prec = (struct aoRecord *)pcommon;
|
||||
struct aodset *pdset = (struct aodset *)(prec->dset);
|
||||
aodset *pdset = (aodset *)(prec->dset);
|
||||
long status=0;
|
||||
unsigned char pact=prec->pact;
|
||||
double value;
|
||||
@@ -233,12 +235,12 @@ static long process(struct dbCommon *pcommon)
|
||||
static long special(DBADDR *paddr, int after)
|
||||
{
|
||||
aoRecord *prec = (aoRecord *)(paddr->precord);
|
||||
struct aodset *pdset = (struct aodset *) (prec->dset);
|
||||
aodset *pdset = (aodset *) (prec->dset);
|
||||
int special_type = paddr->special;
|
||||
|
||||
switch(special_type) {
|
||||
case(SPC_LINCONV):
|
||||
if(pdset->number<6 ) {
|
||||
if(pdset->common.number<6 ) {
|
||||
recGblDbaddrError(S_db_noMod,paddr,"ao: special");
|
||||
return(S_db_noMod);
|
||||
}
|
||||
@@ -543,7 +545,7 @@ static void monitor(aoRecord *prec)
|
||||
|
||||
static long writeValue(aoRecord *prec)
|
||||
{
|
||||
struct aodset *pdset = (struct aodset *) prec->dset;
|
||||
aodset *pdset = (aodset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -273,8 +273,9 @@ information on these fields.
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct aoRecord;
|
||||
%typedef struct aodset {
|
||||
% dset common;
|
||||
% long (*write_ao)(struct aoRecord *prec);
|
||||
% dset common; /*init_record returns: (0,2)=>(success,success no convert)*/
|
||||
% long (*write_ao)(struct aoRecord *prec); /*(0)=>(success ) */
|
||||
% long (*special_linconv)(struct aoRecord *prec, int after);
|
||||
%} aodset;
|
||||
%#define HAS_aodset
|
||||
%
|
||||
|
||||
@@ -75,17 +75,10 @@ rset biRSET={
|
||||
put_enum_str,
|
||||
get_graphic_double,
|
||||
get_control_double,
|
||||
get_alarm_double };
|
||||
struct bidset { /* binary input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_bi;/*(0,2)=> success and convert, don't convert)*/
|
||||
/* if convert then raw value stored in rval */
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset,biRSET);
|
||||
|
||||
static void checkAlarms(biRecord *);
|
||||
static void monitor(biRecord *);
|
||||
static long readValue(biRecord *);
|
||||
@@ -93,7 +86,7 @@ static long readValue(biRecord *);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct biRecord *prec = (struct biRecord *)pcommon;
|
||||
struct bidset *pdset;
|
||||
bidset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
@@ -101,17 +94,17 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
recGblInitConstantLink(&prec->siol, DBF_USHORT, &prec->sval);
|
||||
|
||||
if(!(pdset = (struct bidset *)(prec->dset))) {
|
||||
if(!(pdset = (bidset *)(prec->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,(void *)prec,"bi: init_record");
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
/* must have read_bi function defined */
|
||||
if( (pdset->number < 5) || (pdset->read_bi == NULL) ) {
|
||||
if( (pdset->common.number < 5) || (pdset->read_bi == NULL) ) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"bi: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(prec))) return(status);
|
||||
if( pdset->common.init_record ) {
|
||||
if((status=(*pdset->common.init_record)(pcommon))) return(status);
|
||||
}
|
||||
prec->mlst = prec->val;
|
||||
prec->lalm = prec->val;
|
||||
@@ -122,7 +115,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct biRecord *prec = (struct biRecord *)pcommon;
|
||||
struct bidset *pdset = (struct bidset *)(prec->dset);
|
||||
bidset *pdset = (bidset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
@@ -275,7 +268,7 @@ static void monitor(biRecord *prec)
|
||||
|
||||
static long readValue(biRecord *prec)
|
||||
{
|
||||
struct bidset *pdset = (struct bidset *)prec->dset;
|
||||
bidset *pdset = (bidset *)prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -163,6 +163,15 @@ these fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct biRecord;
|
||||
%typedef struct bidset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_bi)(struct biRecord *prec);/*(0,2)=> success and convert, don't convert); if convert then raw value stored in rval */
|
||||
%} bidset;
|
||||
%#define HAS_bidset
|
||||
%
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -86,16 +86,6 @@ epicsExportAddress(int, boHIGHprecision);
|
||||
double boHIGHlimit = 100000;
|
||||
epicsExportAddress(double, boHIGHlimit);
|
||||
|
||||
struct bodset { /* binary output dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns:(0,2)=>(success,success no convert*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_bo;/*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
|
||||
|
||||
/* control block for callback*/
|
||||
typedef struct myCallback {
|
||||
epicsCallback callback;
|
||||
@@ -131,7 +121,7 @@ static void myCallbackFunc(epicsCallback *arg)
|
||||
static long init_record(struct dbCommon *pcommon,int pass)
|
||||
{
|
||||
struct boRecord *prec = (struct boRecord *)pcommon;
|
||||
struct bodset *pdset = (struct bodset *) prec->dset;
|
||||
bodset *pdset = (bodset *) prec->dset;
|
||||
unsigned short ival = 0;
|
||||
long status = 0;
|
||||
myCallback *pcallback;
|
||||
@@ -146,7 +136,7 @@ static long init_record(struct dbCommon *pcommon,int pass)
|
||||
}
|
||||
|
||||
/* must have write_bo functions defined */
|
||||
if ((pdset->number < 5) || (pdset->write_bo == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->write_bo == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "bo: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -163,8 +153,8 @@ static long init_record(struct dbCommon *pcommon,int pass)
|
||||
callbackSetUser(pcallback, &pcallback->callback);
|
||||
pcallback->precord = (struct dbCommon *) prec;
|
||||
|
||||
if (pdset->init_record) {
|
||||
status=(*pdset->init_record)(prec);
|
||||
if (pdset->common.init_record) {
|
||||
status=(*pdset->common.init_record)(pcommon);
|
||||
if(status==0) {
|
||||
if(prec->rval==0) prec->val = 0;
|
||||
else prec->val = 1;
|
||||
@@ -188,7 +178,7 @@ static long init_record(struct dbCommon *pcommon,int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct boRecord *prec = (struct boRecord *)pcommon;
|
||||
struct bodset *pdset = (struct bodset *)(prec->dset);
|
||||
bodset *pdset = (bodset *)(prec->dset);
|
||||
long status=0;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
@@ -420,7 +410,7 @@ static void monitor(boRecord *prec)
|
||||
|
||||
static long writeValue(boRecord *prec)
|
||||
{
|
||||
struct bodset *pdset = (struct bodset *) prec->dset;
|
||||
bodset *pdset = (bodset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -210,6 +210,15 @@ information on these fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct boRecord;
|
||||
%typedef struct bodset {
|
||||
% dset common; /*init_record returns:(0,2)=>(success,success no convert*/
|
||||
% long (*write_bo)(struct boRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} bodset;
|
||||
%#define HAS_bodset
|
||||
%
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Current Value")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -90,16 +90,6 @@ epicsExportAddress(int, calcoutODLYprecision);
|
||||
double calcoutODLYlimit = 100000;
|
||||
epicsExportAddress(double, calcoutODLYlimit);
|
||||
|
||||
typedef struct calcoutDSET {
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write;
|
||||
}calcoutDSET;
|
||||
|
||||
|
||||
/* To provide feedback to the user as to the connection status of the
|
||||
* links (.INxV and .OUTV), the following algorithm has been implemented ...
|
||||
*
|
||||
@@ -142,7 +132,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
double *pvalue;
|
||||
epicsEnum16 *plinkValid;
|
||||
short error_number;
|
||||
calcoutDSET *pcalcoutDSET;
|
||||
calcoutdset *pcalcoutDSET;
|
||||
rpvtStruct *prpvt;
|
||||
|
||||
if (pass == 0) {
|
||||
@@ -150,13 +140,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(pcalcoutDSET = (calcoutDSET *)prec->dset)) {
|
||||
if (!(pcalcoutDSET = (calcoutdset *)prec->dset)) {
|
||||
recGblRecordError(S_dev_noDSET, (void *)prec, "calcout:init_record");
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
/* must have write defined */
|
||||
if ((pcalcoutDSET->number < 5) || (pcalcoutDSET->write ==NULL)) {
|
||||
if ((pcalcoutDSET->common.number < 5) || (pcalcoutDSET->write ==NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, (void *)prec, "calcout:init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -221,7 +211,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
|
||||
prec->epvt = eventNameToHandle(prec->oevt);
|
||||
|
||||
if (pcalcoutDSET->init_record) pcalcoutDSET->init_record(prec);
|
||||
if (pcalcoutDSET->common.init_record) pcalcoutDSET->common.init_record(pcommon);
|
||||
prec->pval = prec->val;
|
||||
prec->mlst = prec->val;
|
||||
prec->alst = prec->val;
|
||||
@@ -768,7 +758,7 @@ static void checkLinks(calcoutRecord *prec)
|
||||
|
||||
static long writeValue(calcoutRecord *prec)
|
||||
{
|
||||
calcoutDSET *pcalcoutDSET = (calcoutDSET *)prec->dset;
|
||||
calcoutdset *pcalcoutDSET = (calcoutdset *)prec->dset;
|
||||
|
||||
|
||||
if (!pcalcoutDSET || !pcalcoutDSET->write) {
|
||||
|
||||
@@ -659,6 +659,14 @@ manner for the VAL field.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct calcoutRecord;
|
||||
%typedef struct calcoutdset {
|
||||
% dset common;
|
||||
% long (*write)(struct calcoutRecord *prec);
|
||||
%} calcoutdset;
|
||||
%#define HAS_calcoutdset
|
||||
%
|
||||
field(RPVT,DBF_NOACCESS) {
|
||||
prompt("Record Private")
|
||||
special(SPC_NOMOD)
|
||||
|
||||
@@ -83,15 +83,6 @@ rset longinRSET={
|
||||
};
|
||||
epicsExportAddress(rset,longinRSET);
|
||||
|
||||
|
||||
struct longindset { /* longin input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_longin; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
static void checkAlarms(longinRecord *prec, epicsTimeStamp *timeLast);
|
||||
static void monitor(longinRecord *prec);
|
||||
static long readValue(longinRecord *prec);
|
||||
@@ -100,7 +91,7 @@ static long readValue(longinRecord *prec);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct longinRecord *prec = (struct longinRecord *)pcommon;
|
||||
struct longindset *pdset = (struct longindset *) prec->dset;
|
||||
longindset *pdset = (longindset *) prec->dset;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
|
||||
@@ -113,13 +104,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have read_longin function defined */
|
||||
if ((pdset->number < 5) || (pdset->read_longin == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_longin == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "longin: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
|
||||
if (pdset->init_record) {
|
||||
long status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -134,7 +125,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct longinRecord *prec = (struct longinRecord *)pcommon;
|
||||
struct longindset *pdset = (struct longindset *)(prec->dset);
|
||||
longindset *pdset = (longindset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
epicsTimeStamp timeLast;
|
||||
@@ -405,7 +396,7 @@ static void monitor(longinRecord *prec)
|
||||
|
||||
static long readValue(longinRecord *prec)
|
||||
{
|
||||
struct longindset *pdset = (struct longindset *) prec->dset;
|
||||
longindset *pdset = (longindset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -305,6 +305,15 @@ sets UDF to FALSE. read_longin returns the status of C<recGblGetLinkValue>.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct longinRecord;
|
||||
%typedef struct longindset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_longin)(struct longinRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} longindset;
|
||||
%#define HAS_longindset
|
||||
%
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Current value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -80,15 +80,6 @@ rset longoutRSET={
|
||||
};
|
||||
epicsExportAddress(rset,longoutRSET);
|
||||
|
||||
|
||||
struct longoutdset { /* longout input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_longout;/*(-1,0)=>(failure,success*/
|
||||
};
|
||||
static void checkAlarms(longoutRecord *prec);
|
||||
static void monitor(longoutRecord *prec);
|
||||
static long writeValue(longoutRecord *prec);
|
||||
@@ -97,7 +88,7 @@ static void convert(longoutRecord *prec, epicsInt32 value);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct longoutRecord *prec = (struct longoutRecord *)pcommon;
|
||||
struct longoutdset *pdset = (struct longoutdset *) prec->dset;
|
||||
longoutdset *pdset = (longoutdset *) prec->dset;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
|
||||
@@ -109,7 +100,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have write_longout functions defined */
|
||||
if ((pdset->number < 5) || (pdset->write_longout == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->write_longout == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "longout: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -117,8 +108,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (recGblInitConstantLink(&prec->dol, DBF_LONG, &prec->val))
|
||||
prec->udf=FALSE;
|
||||
|
||||
if (pdset->init_record) {
|
||||
long status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -133,7 +124,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct longoutRecord *prec = (struct longoutRecord *)pcommon;
|
||||
struct longoutdset *pdset = (struct longoutdset *)(prec->dset);
|
||||
longoutdset *pdset = (longoutdset *)(prec->dset);
|
||||
long status=0;
|
||||
epicsInt32 value;
|
||||
unsigned char pact=prec->pact;
|
||||
@@ -382,7 +373,7 @@ static void monitor(longoutRecord *prec)
|
||||
|
||||
static long writeValue(longoutRecord *prec)
|
||||
{
|
||||
struct longoutdset *pdset = (struct longoutdset *) prec->dset;
|
||||
longoutdset *pdset = (longoutdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -96,6 +96,15 @@ and database links.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct longoutRecord;
|
||||
%typedef struct longoutdset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*write_longout)(struct longoutRecord *prec); /*(-1,0)=>(failure,success*/
|
||||
%} longoutdset;
|
||||
%#define HAS_longoutdset
|
||||
%
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Desired Output")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -81,15 +81,6 @@ rset mbbiDirectRSET={
|
||||
};
|
||||
epicsExportAddress(rset,mbbiDirectRSET);
|
||||
|
||||
struct mbbidset { /* multi bit binary input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure, success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_mbbi; /*returns: (0,2)=>(success, success no convert)*/
|
||||
};
|
||||
|
||||
static void monitor(mbbiDirectRecord *);
|
||||
static long readValue(mbbiDirectRecord *);
|
||||
|
||||
@@ -98,7 +89,7 @@ static long readValue(mbbiDirectRecord *);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct mbbiDirectRecord *prec = (struct mbbiDirectRecord *)pcommon;
|
||||
struct mbbidset *pdset = (struct mbbidset *) prec->dset;
|
||||
mbbidirectdset *pdset = (mbbidirectdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
@@ -108,7 +99,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
if ((pdset->number < 5) || (pdset->read_mbbi == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_mbbi == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "mbbiDirect: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -120,8 +111,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (prec->mask == 0 && prec->nobt <= 32)
|
||||
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;
|
||||
|
||||
if (pdset->init_record) {
|
||||
status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
status = pdset->common.init_record(pcommon);
|
||||
if (status == 0) {
|
||||
epicsUInt32 val = prec->val;
|
||||
epicsUInt8 *pBn = &prec->b0;
|
||||
@@ -141,7 +132,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct mbbiDirectRecord *prec = (struct mbbiDirectRecord *)pcommon;
|
||||
struct mbbidset *pdset = (struct mbbidset *) prec->dset;
|
||||
mbbidirectdset *pdset = (mbbidirectdset *) prec->dset;
|
||||
long status;
|
||||
int pact = prec->pact;
|
||||
|
||||
@@ -248,7 +239,7 @@ static void monitor(mbbiDirectRecord *prec)
|
||||
|
||||
static long readValue(mbbiDirectRecord *prec)
|
||||
{
|
||||
struct mbbidset *pdset = (struct mbbidset *) prec->dset;
|
||||
mbbidirectdset *pdset = (mbbidirectdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -85,6 +85,14 @@ description (DESC) fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct mbbiDirectRecord;
|
||||
%typedef struct mbbidirectdset {
|
||||
% dset common; /* init_record returns: (-1,0) => (failure, success)*/
|
||||
% long (*read_mbbi)(struct mbbiDirectRecord *prec); /* (0, 2) => (success, success no convert)*/
|
||||
%} mbbidirectdset;
|
||||
%#define HAS_mbbidirectdset
|
||||
%
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -83,15 +83,6 @@ rset mbbiRSET = {
|
||||
};
|
||||
epicsExportAddress(rset,mbbiRSET);
|
||||
|
||||
struct mbbidset { /* multi bit binary input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /* returns: (-1,0) => (failure, success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_mbbi;/* (0, 2) => (success, success no convert)*/
|
||||
};
|
||||
|
||||
static void checkAlarms(mbbiRecord *, epicsTimeStamp *);
|
||||
static void monitor(mbbiRecord *);
|
||||
static long readValue(mbbiRecord *);
|
||||
@@ -115,18 +106,17 @@ static void init_common(mbbiRecord *prec)
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct mbbiRecord *prec = (struct mbbiRecord *)pcommon;
|
||||
struct mbbidset *pdset = (struct mbbidset *) prec->dset;
|
||||
mbbidset *pdset = (mbbidset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
|
||||
pdset = (struct mbbidset *) prec->dset;
|
||||
if (!pdset) {
|
||||
recGblRecordError(S_dev_noDSET, prec, "mbbi: init_record");
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
if ((pdset->number < 5) || (pdset->read_mbbi == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_mbbi == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "mbbi: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -138,8 +128,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (prec->mask == 0 && prec->nobt <= 32)
|
||||
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;
|
||||
|
||||
if (pdset->init_record)
|
||||
status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record)
|
||||
status = pdset->common.init_record(pcommon);
|
||||
|
||||
init_common(prec);
|
||||
|
||||
@@ -152,7 +142,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct mbbiRecord *prec = (struct mbbiRecord *)pcommon;
|
||||
struct mbbidset *pdset = (struct mbbidset *) prec->dset;
|
||||
mbbidset *pdset = (mbbidset *) prec->dset;
|
||||
long status;
|
||||
int pact = prec->pact;
|
||||
epicsTimeStamp timeLast;
|
||||
@@ -380,7 +370,7 @@ static void monitor(mbbiRecord *prec)
|
||||
|
||||
static long readValue(mbbiRecord *prec)
|
||||
{
|
||||
struct mbbidset *pdset = (struct mbbidset *) prec->dset;
|
||||
mbbidset *pdset = (mbbidset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -119,6 +119,14 @@ description (DESC) fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct mbbiRecord;
|
||||
%typedef struct mbbidset {
|
||||
% dset common; /* init_record returns: (-1,0) => (failure, success)*/
|
||||
% long (*read_mbbi)(struct mbbiRecord *prec); /* (0, 2) => (success, success no convert)*/
|
||||
%} mbbidset;
|
||||
%#define HAS_mbbidset
|
||||
%
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -81,16 +81,6 @@ rset mbboDirectRSET = {
|
||||
};
|
||||
epicsExportAddress(rset, mbboDirectRSET);
|
||||
|
||||
struct mbbodset { /* multi bit binary output dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (0, 2)=>(success, success no convert)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_mbbo; /*returns: (0, 2)=>(success, success no convert)*/
|
||||
};
|
||||
|
||||
|
||||
static void convert(mbboDirectRecord *);
|
||||
static void monitor(mbboDirectRecord *);
|
||||
static long writeValue(mbboDirectRecord *);
|
||||
@@ -100,7 +90,7 @@ static long writeValue(mbboDirectRecord *);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct mbboDirectRecord *prec = (struct mbboDirectRecord *)pcommon;
|
||||
struct mbbodset *pdset = (struct mbbodset *) prec->dset;
|
||||
mbbodirectdset *pdset = (mbbodirectdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
@@ -110,7 +100,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
if ((pdset->number < 5) || (pdset->write_mbbo == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->write_mbbo == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "mbboDirect: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -124,8 +114,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (prec->mask == 0 && prec->nobt <= 32)
|
||||
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;
|
||||
|
||||
if (pdset->init_record) {
|
||||
status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
status = pdset->common.init_record(pcommon);
|
||||
if (status == 0) {
|
||||
/* Convert initial read-back */
|
||||
epicsUInt32 rval = prec->rval;
|
||||
@@ -162,7 +152,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct mbboDirectRecord *prec = (struct mbboDirectRecord *)pcommon;
|
||||
struct mbbodset *pdset = (struct mbbodset *)(prec->dset);
|
||||
mbbodirectdset *pdset = (mbbodirectdset *)(prec->dset);
|
||||
long status = 0;
|
||||
int pact = prec->pact;
|
||||
|
||||
@@ -356,7 +346,7 @@ static void convert(mbboDirectRecord *prec)
|
||||
|
||||
static long writeValue(mbboDirectRecord *prec)
|
||||
{
|
||||
struct mbbodset *pdset = (struct mbbodset *) prec->dset;
|
||||
mbbodirectdset *pdset = (mbbodirectdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -90,6 +90,14 @@ description (DESC) fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct mbboDirectRecord;
|
||||
%typedef struct mbbodirectdset {
|
||||
% dset common; /*init_record returns: (0, 2)=>(success, success no convert)*/
|
||||
% long (*write_mbbo)(struct mbboDirectRecord *prec); /*returns: (0, 2)=>(success, success no convert)*/
|
||||
%} mbbodirectdset;
|
||||
%#define HAS_mbbodirectdset
|
||||
%
|
||||
field(VAL,DBF_LONG) {
|
||||
prompt("Word")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -82,15 +82,6 @@ rset mbboRSET = {
|
||||
};
|
||||
epicsExportAddress(rset,mbboRSET);
|
||||
|
||||
struct mbbodset { /* multi bit binary output dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (0, 2) => (success, success no convert)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_mbbo; /*returns: (0, 2) => (success, success no convert)*/
|
||||
};
|
||||
|
||||
|
||||
static void checkAlarms(mbboRecord *);
|
||||
static void convert(mbboRecord *);
|
||||
@@ -117,7 +108,7 @@ static void init_common(mbboRecord *prec)
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct mbboRecord *prec = (struct mbboRecord *)pcommon;
|
||||
struct mbbodset *pdset;
|
||||
mbbodset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass == 0) {
|
||||
@@ -125,13 +116,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return 0;
|
||||
}
|
||||
|
||||
pdset = (struct mbbodset *) prec->dset;
|
||||
pdset = (mbbodset *) prec->dset;
|
||||
if (!pdset) {
|
||||
recGblRecordError(S_dev_noDSET, prec, "mbbo: init_record");
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
if ((pdset->number < 5) || (pdset->write_mbbo == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->write_mbbo == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "mbbo: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -145,8 +136,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (prec->mask == 0 && prec->nobt <= 32)
|
||||
prec->mask = ((epicsUInt64) 1u << prec->nobt) - 1;
|
||||
|
||||
if (pdset->init_record) {
|
||||
status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
status = pdset->common.init_record(pcommon);
|
||||
init_common(prec);
|
||||
if (status == 0) {
|
||||
/* Convert initial read-back */
|
||||
@@ -194,7 +185,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct mbboRecord *prec = (struct mbboRecord *)pcommon;
|
||||
struct mbbodset *pdset = (struct mbbodset *) prec->dset;
|
||||
mbbodset *pdset = (mbbodset *) prec->dset;
|
||||
long status = 0;
|
||||
int pact = prec->pact;
|
||||
|
||||
@@ -439,7 +430,7 @@ static void convert(mbboRecord *prec)
|
||||
|
||||
static long writeValue(mbboRecord *prec)
|
||||
{
|
||||
struct mbbodset *pdset = (struct mbbodset *) prec->dset;
|
||||
mbbodset *pdset = (mbbodset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -173,6 +173,14 @@ mode fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct mbboRecord;
|
||||
%typedef struct mbbodset {
|
||||
% dset common; /*init_record returns: (0, 2) => (success, success no convert)*/
|
||||
% long (*write_mbbo)(struct mbboRecord *prec); /*returns: (0, 2) => (success, success no convert)*/
|
||||
%} mbbodset;
|
||||
%#define HAS_mbbodset
|
||||
%
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Desired Value")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -80,14 +80,6 @@ rset stringinRSET={
|
||||
};
|
||||
epicsExportAddress(rset,stringinRSET);
|
||||
|
||||
struct stringindset { /* stringin input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_stringin; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
static void monitor(stringinRecord *);
|
||||
static long readValue(stringinRecord *);
|
||||
|
||||
@@ -97,7 +89,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
struct stringinRecord *prec = (struct stringinRecord *)pcommon;
|
||||
STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
|
||||
STATIC_ASSERT(sizeof(prec->sval)==sizeof(prec->val));
|
||||
struct stringindset *pdset = (struct stringindset *) prec->dset;
|
||||
stringindset *pdset = (stringindset *) prec->dset;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
|
||||
@@ -110,13 +102,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have read_stringin function defined */
|
||||
if ((pdset->number < 5) || (pdset->read_stringin == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_stringin == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "stringin: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
|
||||
if (pdset->init_record) {
|
||||
long status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -130,7 +122,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct stringinRecord *prec = (struct stringinRecord *)pcommon;
|
||||
struct stringindset *pdset = (struct stringindset *)(prec->dset);
|
||||
stringindset *pdset = (stringindset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
@@ -196,7 +188,7 @@ static void monitor(stringinRecord *prec)
|
||||
|
||||
static long readValue(stringinRecord *prec)
|
||||
{
|
||||
struct stringindset *pdset = (struct stringindset *) prec->dset;
|
||||
stringindset *pdset = (stringindset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -24,6 +24,15 @@ menu(stringinPOST) {
|
||||
}
|
||||
recordtype(stringin) {
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct stringinRecord;
|
||||
%typedef struct stringindset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_stringin)(struct stringinRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} stringindset;
|
||||
%#define HAS_stringindset
|
||||
%
|
||||
field(VAL,DBF_STRING) {
|
||||
prompt("Current Value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -82,14 +82,6 @@ rset stringoutRSET={
|
||||
};
|
||||
epicsExportAddress(rset,stringoutRSET);
|
||||
|
||||
struct stringoutdset { /* stringout input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_stringout;/*(-1,0)=>(failure,success)*/
|
||||
};
|
||||
static void monitor(stringoutRecord *);
|
||||
static long writeValue(stringoutRecord *);
|
||||
|
||||
@@ -99,7 +91,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
struct stringoutRecord *prec = (struct stringoutRecord *)pcommon;
|
||||
STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
|
||||
STATIC_ASSERT(sizeof(prec->ivov)==sizeof(prec->val));
|
||||
struct stringoutdset *pdset = (struct stringoutdset *) prec->dset;
|
||||
stringoutdset *pdset = (stringoutdset *) prec->dset;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
|
||||
@@ -111,7 +103,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have write_stringout functions defined */
|
||||
if ((pdset->number < 5) || (pdset->write_stringout == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->write_stringout == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "stringout: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -120,8 +112,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (recGblInitConstantLink(&prec->dol, DBF_STRING, prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
if (pdset->init_record) {
|
||||
long status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
|
||||
if(status)
|
||||
return status;
|
||||
@@ -133,7 +125,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct stringoutRecord *prec = (struct stringoutRecord *)pcommon;
|
||||
struct stringoutdset *pdset = (struct stringoutdset *)(prec->dset);
|
||||
stringoutdset *pdset = (stringoutdset *)(prec->dset);
|
||||
long status=0;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
@@ -228,7 +220,7 @@ static void monitor(stringoutRecord *prec)
|
||||
|
||||
static long writeValue(stringoutRecord *prec)
|
||||
{
|
||||
struct stringoutdset *pdset = (struct stringoutdset *) prec->dset;
|
||||
stringoutdset *pdset = (stringoutdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -24,6 +24,15 @@ menu(stringoutPOST) {
|
||||
}
|
||||
recordtype(stringout) {
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct stringoutRecord;
|
||||
%typedef struct stringoutdset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*write_stringout)(struct stringoutRecord *prec); /*(-1,0)=>(failure,success)*/
|
||||
%} stringoutdset;
|
||||
%#define HAS_stringoutdset
|
||||
%
|
||||
field(VAL,DBF_STRING) {
|
||||
prompt("Current Value")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -82,15 +82,6 @@ rset subArrayRSET={
|
||||
};
|
||||
epicsExportAddress(rset,subArrayRSET);
|
||||
|
||||
struct sadset { /* subArray dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_sa; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
|
||||
static void monitor(subArrayRecord *prec);
|
||||
static long readValue(subArrayRecord *prec);
|
||||
|
||||
@@ -98,7 +89,7 @@ static long readValue(subArrayRecord *prec);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct subArrayRecord *prec = (struct subArrayRecord *)pcommon;
|
||||
struct sadset *pdset;
|
||||
sadset *pdset;
|
||||
|
||||
if (pass==0){
|
||||
if (prec->malm <= 0)
|
||||
@@ -114,19 +105,19 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have dset defined */
|
||||
if (!(pdset = (struct sadset *)(prec->dset))) {
|
||||
if (!(pdset = (sadset *)(prec->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,(void *)prec,"sa: init_record");
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
/* must have read_sa function defined */
|
||||
if ( (pdset->number < 5) || (pdset->read_sa == NULL) ) {
|
||||
if ( (pdset->common.number < 5) || (pdset->read_sa == NULL) ) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"sa: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
|
||||
if (pdset->init_record)
|
||||
return pdset->init_record(prec);
|
||||
if (pdset->common.init_record)
|
||||
return pdset->common.init_record(pcommon);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -134,7 +125,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct subArrayRecord *prec = (struct subArrayRecord *)pcommon;
|
||||
struct sadset *pdset = (struct sadset *)(prec->dset);
|
||||
sadset *pdset = (sadset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
@@ -309,7 +300,7 @@ static void monitor(subArrayRecord *prec)
|
||||
static long readValue(subArrayRecord *prec)
|
||||
{
|
||||
long status;
|
||||
struct sadset *pdset = (struct sadset *) (prec->dset);
|
||||
sadset *pdset = (sadset *) (prec->dset);
|
||||
|
||||
if (prec->nelm > prec->malm)
|
||||
prec->nelm = prec->malm;
|
||||
|
||||
@@ -315,6 +315,15 @@ INP is expected to point to a waveform record.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct subArrayRecord;
|
||||
%typedef struct sadset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_sa)(struct subArrayRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} sadset;
|
||||
%#define HAS_sadset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
|
||||
@@ -80,14 +80,6 @@ rset waveformRSET={
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset,waveformRSET);
|
||||
struct wfdset { /* waveform dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_wf; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
|
||||
static void monitor(waveformRecord *);
|
||||
static long readValue(waveformRecord *);
|
||||
@@ -95,7 +87,7 @@ static long readValue(waveformRecord *);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct waveformRecord *prec = (struct waveformRecord *)pcommon;
|
||||
struct wfdset *pdset;
|
||||
wfdset *pdset;
|
||||
|
||||
if (pass == 0) {
|
||||
if (prec->nelm <= 0)
|
||||
@@ -111,25 +103,25 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
|
||||
/* must have dset defined */
|
||||
if (!(pdset = (struct wfdset *)(prec->dset))) {
|
||||
if (!(pdset = (wfdset *)(prec->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,(void *)prec,"wf: init_record");
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
/* must have read_wf function defined */
|
||||
if ((pdset->number < 5) || (pdset->read_wf == NULL)) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_wf == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"wf: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
if (!pdset->init_record)
|
||||
if (!pdset->common.init_record)
|
||||
return 0;
|
||||
|
||||
return pdset->init_record(prec);
|
||||
return pdset->common.init_record(pcommon);
|
||||
}
|
||||
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct waveformRecord *prec = (struct waveformRecord *)pcommon;
|
||||
struct wfdset *pdset = (struct wfdset *)(prec->dset);
|
||||
wfdset *pdset = (wfdset *)(prec->dset);
|
||||
unsigned char pact=prec->pact;
|
||||
long status;
|
||||
|
||||
@@ -328,7 +320,7 @@ static void monitor(waveformRecord *prec)
|
||||
|
||||
static long readValue(waveformRecord *prec)
|
||||
{
|
||||
struct wfdset *pdset = (struct wfdset *) prec->dset;
|
||||
wfdset *pdset = (wfdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -397,6 +397,15 @@ NORD is set to the number of values returned and read_wf returns.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct waveformRecord;
|
||||
%typedef struct wfdset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_wf)(struct waveformRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} wfdset;
|
||||
%#define HAS_wfdset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
|
||||
Reference in New Issue
Block a user