Merge remote-tracking branch 'lp-anj7/typed-dsets' into 7.0
* lp-anj7/typed-dsets: Bump database version to 3.18.0, use in SHRLIB_VERSION Adjust example code in devSup.h Set USE_TYPED_DSET centrally now everything uses it Update the wording of the Release Notes entry - Record updates: . histogramRecord . eventRecord . aaiRecord . aaoRecord - Record updates: . aoRecord . biRecord . boRecord . mbbiRecord . mbbiDirectRecord . mbboRecord . mbboDirectRecord . longinRecord . longoutRecord . stringoutRecord . stringinRecord . waveformRecord . calcoutRecord . subArrayRecord initial typed-dset changes for ao record Add Release Notes entry about dsets Export and use aidset, set USE_TYPED_DSET Remove duplicated include line Add HAS_<record>dset macros to allow detection Export and use int64outdset, set USE_TYPED_DSET Export and use int64indset, set USE_TYPED_DSET Modify lsodset, set USE_TYPED_DSET Modify lsidset, set USE_TYPED_DSET Modify printfdset, set USE_TYPED_DSET
This commit is contained in:
@@ -90,22 +90,13 @@ rset aaiRSET={
|
||||
};
|
||||
epicsExportAddress(rset,aaiRSET);
|
||||
|
||||
struct aaidset { /* aai dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_aai; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
|
||||
static void monitor(aaiRecord *);
|
||||
static long readValue(aaiRecord *);
|
||||
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct aaiRecord *prec = (struct aaiRecord *)pcommon;
|
||||
struct aaidset *pdset = (struct aaidset *)(prec->dset);
|
||||
aaidset *pdset = (aaidset *)(prec->dset);
|
||||
|
||||
/* must have dset defined */
|
||||
if (!pdset) {
|
||||
@@ -125,8 +116,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
not change after links are established before pass 1
|
||||
*/
|
||||
|
||||
if (pdset->init_record) {
|
||||
long status = pdset->init_record(prec);
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
|
||||
/* init_record may set the bptr to point to the data */
|
||||
if (status)
|
||||
@@ -143,7 +134,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
|
||||
/* must have read_aai function defined */
|
||||
if (pdset->number < 5 || pdset->read_aai == NULL) {
|
||||
if (pdset->common.number < 5 || pdset->read_aai == NULL) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "aai: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -153,7 +144,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct aaiRecord *prec = (struct aaiRecord *)pcommon;
|
||||
struct aaidset *pdset = (struct aaidset *)(prec->dset);
|
||||
aaidset *pdset = (aaidset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact = prec->pact;
|
||||
|
||||
@@ -339,7 +330,7 @@ static void monitor(aaiRecord *prec)
|
||||
|
||||
static long readValue(aaiRecord *prec)
|
||||
{
|
||||
struct aaidset *pdset = (struct aaidset *) prec->dset;
|
||||
aaidset *pdset = (aaidset *) prec->dset;
|
||||
long status;
|
||||
|
||||
/* NB: Device support must post updates to NORD */
|
||||
|
||||
@@ -288,6 +288,15 @@ Scan forward link if necessary, set PACT FALSE, and return.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct aaiRecord;
|
||||
%typedef struct aaidset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_aai)(struct aaiRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} aaidset;
|
||||
%#define HAS_aaidset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
|
||||
@@ -90,22 +90,13 @@ rset aaoRSET={
|
||||
};
|
||||
epicsExportAddress(rset,aaoRSET);
|
||||
|
||||
struct aaodset { /* aao dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_aao; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
|
||||
static void monitor(aaoRecord *);
|
||||
static long writeValue(aaoRecord *);
|
||||
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct aaoRecord *prec = (struct aaoRecord *)pcommon;
|
||||
struct aaodset *pdset = (struct aaodset *)(prec->dset);
|
||||
aaodset *pdset = (aaodset *)(prec->dset);
|
||||
long status;
|
||||
|
||||
/* must have dset defined */
|
||||
@@ -130,9 +121,9 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
not change after links are established before pass 1
|
||||
*/
|
||||
|
||||
if (pdset->init_record) {
|
||||
if (pdset->common.init_record) {
|
||||
/* init_record may set the bptr to point to the data */
|
||||
if ((status = pdset->init_record(prec)))
|
||||
if ((status = pdset->common.init_record(pcommon)))
|
||||
return status;
|
||||
}
|
||||
if (!prec->bptr) {
|
||||
@@ -146,7 +137,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
|
||||
/* must have write_aao function defined */
|
||||
if (pdset->number < 5 || pdset->write_aao == NULL) {
|
||||
if (pdset->common.number < 5 || pdset->write_aao == NULL) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "aao: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
@@ -156,7 +147,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct aaoRecord *prec = (struct aaoRecord *)pcommon;
|
||||
struct aaodset *pdset = (struct aaodset *)(prec->dset);
|
||||
aaodset *pdset = (aaodset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact = prec->pact;
|
||||
|
||||
@@ -339,7 +330,7 @@ static void monitor(aaoRecord *prec)
|
||||
|
||||
static long writeValue(aaoRecord *prec)
|
||||
{
|
||||
struct aaodset *pdset = (struct aaodset *) prec->dset;
|
||||
aaodset *pdset = (aaodset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -288,6 +288,15 @@ Scan forward link if necessary, set PACT FALSE, and return.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct aaoRecord;
|
||||
%typedef struct aaodset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*write_aao)(struct aaoRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} aaodset;
|
||||
%#define HAS_aaodset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
|
||||
@@ -86,17 +86,6 @@ rset aiRSET={
|
||||
};
|
||||
epicsExportAddress(rset,aiRSET);
|
||||
|
||||
typedef struct aidset { /* analog input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_ai;/*(0,2)=> success and convert,don't convert)*/
|
||||
/* if convert then raw value stored in rval */
|
||||
DEVSUPFUN special_linconv;
|
||||
}aidset;
|
||||
|
||||
static void checkAlarms(aiRecord *prec, epicsTimeStamp *lastTime);
|
||||
static void convert(aiRecord *prec);
|
||||
static void monitor(aiRecord *prec);
|
||||
@@ -118,7 +107,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
/* must have read_ai function defined */
|
||||
if( (pdset->number < 6) || (pdset->read_ai == NULL) ) {
|
||||
if ((pdset->common.number < 6) || (pdset->read_ai == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"ai: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
@@ -128,8 +117,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
prec->eoff = prec->egul;
|
||||
}
|
||||
|
||||
if( pdset->init_record ) {
|
||||
long status=(*pdset->init_record)(prec);
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
if (prec->linr == menuConvertSLOPE) {
|
||||
prec->eoff = eoff;
|
||||
prec->eslo = eslo;
|
||||
@@ -190,7 +179,7 @@ static long special(DBADDR *paddr,int after)
|
||||
|
||||
switch(special_type) {
|
||||
case(SPC_LINCONV):
|
||||
if(pdset->number<6) {
|
||||
if (pdset->common.number < 6) {
|
||||
recGblDbaddrError(S_db_noMod,paddr,"ai: special");
|
||||
return(S_db_noMod);
|
||||
}
|
||||
|
||||
@@ -221,6 +221,16 @@ monitoring functionality.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct aiRecord;
|
||||
%typedef struct aidset {
|
||||
% dset common;
|
||||
% long (*read_ai)(struct aiRecord *prec);
|
||||
% long (*special_linconv)(struct aiRecord *prec, int after);
|
||||
%} aidset;
|
||||
%#define HAS_aidset
|
||||
%
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Current EGU Value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -81,20 +81,10 @@ rset aoRSET={
|
||||
put_enum_str,
|
||||
get_graphic_double,
|
||||
get_control_double,
|
||||
get_alarm_double };
|
||||
|
||||
struct aodset { /* analog input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (0,2)=>(success,success no convert)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_ao;/*(0)=>(success ) */
|
||||
DEVSUPFUN special_linconv;
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset,aoRSET);
|
||||
|
||||
|
||||
static void checkAlarms(aoRecord *);
|
||||
static long fetch_value(aoRecord *, double *);
|
||||
static void convert(aoRecord *, double);
|
||||
@@ -104,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;
|
||||
@@ -113,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);
|
||||
}
|
||||
@@ -122,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);
|
||||
}
|
||||
@@ -132,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;
|
||||
@@ -174,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;
|
||||
@@ -245,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);
|
||||
}
|
||||
@@ -555,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) {
|
||||
|
||||
@@ -268,6 +268,16 @@ more information on these fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct aoRecord;
|
||||
%typedef struct aodset {
|
||||
% 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
|
||||
%
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Desired Output")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
static long init_record(struct dbCommon *prec, int pass);
|
||||
static long init_record(struct dbCommon *pcommon, int pass);
|
||||
static long process(struct dbCommon *prec);
|
||||
static long special(DBADDR *paddr, int after);
|
||||
#define get_value NULL
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -662,6 +662,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)
|
||||
|
||||
@@ -80,14 +80,6 @@ rset eventRSET={
|
||||
};
|
||||
epicsExportAddress(rset,eventRSET);
|
||||
|
||||
struct eventdset { /* event input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_event;/*(0)=> success */
|
||||
};
|
||||
static void monitor(eventRecord *);
|
||||
static long readValue(eventRecord *);
|
||||
|
||||
@@ -95,7 +87,7 @@ static long readValue(eventRecord *);
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct eventRecord *prec = (struct eventRecord *)pcommon;
|
||||
struct eventdset *pdset;
|
||||
eventdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
@@ -103,8 +95,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
recGblInitConstantLink(&prec->siol, DBF_STRING, &prec->sval);
|
||||
|
||||
if( (pdset=(struct eventdset *)(prec->dset)) && (pdset->init_record) )
|
||||
status=(*pdset->init_record)(prec);
|
||||
if( (pdset=(eventdset *)(prec->dset)) && (pdset->common.init_record) )
|
||||
status=(*pdset->common.init_record)(pcommon);
|
||||
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
|
||||
@@ -114,11 +106,11 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct eventRecord *prec = (struct eventRecord *)pcommon;
|
||||
struct eventdset *pdset = (struct eventdset *)(prec->dset);
|
||||
eventdset *pdset = (eventdset *)(prec->dset);
|
||||
long status=0;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
if((pdset!=NULL) && (pdset->number >= 5) && pdset->read_event )
|
||||
if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event )
|
||||
status=readValue(prec); /* read the new value */
|
||||
/* check if device support set pact */
|
||||
if ( !pact && prec->pact ) return(0);
|
||||
@@ -173,7 +165,7 @@ static void monitor(eventRecord *prec)
|
||||
|
||||
static long readValue(eventRecord *prec)
|
||||
{
|
||||
struct eventdset *pdset = (struct eventdset *) prec->dset;
|
||||
eventdset *pdset = (eventdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -44,6 +44,16 @@ simulation mode parameters
|
||||
recordtype(event) {
|
||||
include "dbCommon.dbd"
|
||||
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct eventRecord;
|
||||
%typedef struct eventdset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_event)(struct eventRecord *prec); /*(0)=> success */
|
||||
%} eventdset;
|
||||
%#define HAS_eventdset
|
||||
%
|
||||
|
||||
=head3 Scan Parameters
|
||||
|
||||
The event record has the standard fields for specifying under what circumstances
|
||||
|
||||
@@ -87,17 +87,6 @@ epicsExportAddress(rset,histogramRSET);
|
||||
int histogramSDELprecision = 2;
|
||||
epicsExportAddress(int, histogramSDELprecision);
|
||||
|
||||
struct histogramdset { /* histogram input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_histogram;/*(0,2)=> success and add_count, don't add_count)*/
|
||||
/* if add_count then sgnl added to array */
|
||||
DEVSUPFUN special_linconv;
|
||||
};
|
||||
|
||||
/* control block for callback*/
|
||||
typedef struct myCallback {
|
||||
epicsCallback callback;
|
||||
@@ -160,7 +149,7 @@ static void wdogInit(histogramRecord *prec)
|
||||
static long init_record(struct dbCommon *pcommon, int pass)
|
||||
{
|
||||
struct histogramRecord *prec = (struct histogramRecord *)pcommon;
|
||||
struct histogramdset *pdset;
|
||||
histogramdset *pdset;
|
||||
|
||||
if (pass == 0) {
|
||||
/* allocate space for histogram array */
|
||||
@@ -181,21 +170,21 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitConstantLink(&prec->siol, DBF_DOUBLE, &prec->sval);
|
||||
|
||||
/* must have device support defined */
|
||||
pdset = (struct histogramdset *) prec->dset;
|
||||
pdset = (histogramdset *) prec->dset;
|
||||
if (!pdset) {
|
||||
recGblRecordError(S_dev_noDSET, prec, "histogram: init_record");
|
||||
return S_dev_noDSET;
|
||||
}
|
||||
|
||||
/* must have read_histogram function defined */
|
||||
if (pdset->number < 6 || !pdset->read_histogram) {
|
||||
if (pdset->common.number < 6 || !pdset->read_histogram) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "histogram: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
|
||||
/* call device support init_record */
|
||||
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;
|
||||
@@ -206,7 +195,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct histogramRecord *prec = (struct histogramRecord *)pcommon;
|
||||
struct histogramdset *pdset = (struct histogramdset *) prec->dset;
|
||||
histogramdset *pdset = (histogramdset *) prec->dset;
|
||||
int pact = prec->pact;
|
||||
long status;
|
||||
|
||||
@@ -375,7 +364,7 @@ static long clear_histogram(histogramRecord *prec)
|
||||
|
||||
static long readValue(histogramRecord *prec)
|
||||
{
|
||||
struct histogramdset *pdset = (struct histogramdset *) prec->dset;
|
||||
histogramdset *pdset = (histogramdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -140,6 +140,16 @@ simulation mode fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct histogramRecord;
|
||||
%typedef struct histogramdset {
|
||||
% dset common; /*init_record returns: (-1,0)=>(failure,success)*/
|
||||
% long (*read_histogram)(struct histogramRecord *prec); /*(0,2)=> success and add_count, don't add_count); if add_count then sgnl added to array*/
|
||||
% long (*special_linconv)(struct histogramRecord *prec, int after);
|
||||
%} histogramdset;
|
||||
%#define HAS_histogramdset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
asl(ASL0)
|
||||
|
||||
@@ -83,14 +83,6 @@ rset int64inRSET={
|
||||
epicsExportAddress(rset,int64inRSET);
|
||||
|
||||
|
||||
struct int64indset { /* int64in input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_int64in; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
static void checkAlarms(int64inRecord *prec, epicsTimeStamp *timeLast);
|
||||
static void monitor(int64inRecord *prec);
|
||||
static long readValue(int64inRecord *prec);
|
||||
@@ -99,7 +91,7 @@ static long readValue(int64inRecord *prec);
|
||||
static long init_record(dbCommon *pcommon, int pass)
|
||||
{
|
||||
int64inRecord *prec = (int64inRecord*)pcommon;
|
||||
struct int64indset *pdset;
|
||||
int64indset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
@@ -108,17 +100,17 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
recGblInitConstantLink(&prec->siol, DBF_INT64, &prec->sval);
|
||||
|
||||
if(!(pdset = (struct int64indset *)(prec->dset))) {
|
||||
if(!(pdset = (int64indset *)(prec->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,(void *)prec,"int64in: init_record");
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
/* must have read_int64in function defined */
|
||||
if( (pdset->number < 5) || (pdset->read_int64in == NULL) ) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_int64in == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"int64in: 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->alst = prec->val;
|
||||
@@ -129,7 +121,7 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
static long process(dbCommon *pcommon)
|
||||
{
|
||||
int64inRecord *prec = (int64inRecord*)pcommon;
|
||||
struct int64indset *pdset = (struct int64indset *)(prec->dset);
|
||||
int64indset *pdset = (int64indset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
epicsTimeStamp timeLast;
|
||||
@@ -397,7 +389,7 @@ static void monitor(int64inRecord *prec)
|
||||
|
||||
static long readValue(int64inRecord *prec)
|
||||
{
|
||||
struct int64indset *pdset = (struct int64indset *) prec->dset;
|
||||
int64indset *pdset = (int64indset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -111,6 +111,15 @@ monitoring deadband functionality.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct int64inRecord;
|
||||
%typedef struct int64indset {
|
||||
% dset common;
|
||||
% long (*read_int64in)(struct int64inRecord *prec);
|
||||
%} int64indset;
|
||||
%#define HAS_int64indset
|
||||
%
|
||||
field(VAL,DBF_INT64) {
|
||||
prompt("Current value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
@@ -80,14 +80,6 @@ rset int64outRSET={
|
||||
epicsExportAddress(rset,int64outRSET);
|
||||
|
||||
|
||||
struct int64outdset { /* int64out input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN write_int64out;/*(-1,0)=>(failure,success*/
|
||||
};
|
||||
static void checkAlarms(int64outRecord *prec);
|
||||
static void monitor(int64outRecord *prec);
|
||||
static long writeValue(int64outRecord *prec);
|
||||
@@ -97,19 +89,19 @@ static void convert(int64outRecord *prec, epicsInt64 value);
|
||||
static long init_record(dbCommon *pcommon, int pass)
|
||||
{
|
||||
int64outRecord *prec = (int64outRecord*)pcommon;
|
||||
struct int64outdset *pdset;
|
||||
int64outdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass == 0) return 0;
|
||||
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
|
||||
if(!(pdset = (struct int64outdset *)(prec->dset))) {
|
||||
if(!(pdset = (int64outdset *)(prec->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,(void *)prec,"int64out: init_record");
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
/* must have write_int64out functions defined */
|
||||
if( (pdset->number < 5) || (pdset->write_int64out == NULL) ) {
|
||||
if ((pdset->common.number < 5) || (pdset->write_int64out == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"int64out: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
@@ -117,8 +109,8 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
if(recGblInitConstantLink(&prec->dol,DBF_INT64,&prec->val))
|
||||
prec->udf=FALSE;
|
||||
}
|
||||
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->alst = prec->val;
|
||||
@@ -129,7 +121,7 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
static long process(dbCommon *pcommon)
|
||||
{
|
||||
int64outRecord *prec = (int64outRecord*)pcommon;
|
||||
struct int64outdset *pdset = (struct int64outdset *)(prec->dset);
|
||||
int64outdset *pdset = (int64outdset *)(prec->dset);
|
||||
long status=0;
|
||||
epicsInt64 value;
|
||||
unsigned char pact=prec->pact;
|
||||
@@ -377,7 +369,7 @@ static void monitor(int64outRecord *prec)
|
||||
|
||||
static long writeValue(int64outRecord *prec)
|
||||
{
|
||||
struct int64outdset *pdset = (struct int64outdset *) prec->dset;
|
||||
int64outdset *pdset = (int64outdset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -137,6 +137,15 @@ monitoring deadband functionality.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct int64outRecord;
|
||||
%typedef struct int64outdset {
|
||||
% dset common;
|
||||
% long (*write_int64out)(struct int64outRecord *prec);
|
||||
%} int64outdset;
|
||||
%#define HAS_int64outdset
|
||||
%
|
||||
field(VAL,DBF_INT64) {
|
||||
prompt("Desired Output")
|
||||
promptgroup("50 - Output")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -66,13 +66,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have a read_string function */
|
||||
if (pdset->number < 5 || !pdset->read_string) {
|
||||
if (pdset->common.number < 5 || !pdset->read_string) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "lsi: 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;
|
||||
@@ -221,7 +221,7 @@ static void monitor(lsiRecord *prec)
|
||||
|
||||
static long readValue(lsiRecord *prec)
|
||||
{
|
||||
struct lsidset *pdset = (struct lsidset *) prec->dset;
|
||||
lsidset *pdset = (lsidset *) prec->dset;
|
||||
long status = 0;
|
||||
|
||||
if (!prec->pact) {
|
||||
|
||||
@@ -44,17 +44,14 @@ See L<Address Specification> for information on specifying links.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct lsiRecord;
|
||||
%typedef struct lsidset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN read_string;
|
||||
% dset common;
|
||||
% long (*read_string)(struct lsiRecord *prec);
|
||||
%} lsidset;
|
||||
%#define HAS_lsidset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Current Value")
|
||||
|
||||
@@ -70,15 +70,15 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
/* must have a write_string function defined */
|
||||
if (pdset->number < 5 || !pdset->write_string) {
|
||||
if (pdset->common.number < 5 || !pdset->write_string) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "lso: init_record");
|
||||
return S_dev_missingSup;
|
||||
}
|
||||
|
||||
dbLoadLinkLS(&prec->dol, prec->val, prec->sizv, &prec->len);
|
||||
|
||||
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;
|
||||
|
||||
@@ -109,17 +109,14 @@ lists other fields related to a alarms that are common to all record types.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct lsoRecord;
|
||||
%typedef struct lsodset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN write_string;
|
||||
% dset common;
|
||||
% long (*write_string)(struct lsoRecord *prec);
|
||||
%} lsodset;
|
||||
%#define HAS_lsodset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Current Value")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -336,13 +336,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
if (!pdset)
|
||||
return 0; /* Device support is optional */
|
||||
|
||||
if (pdset->number < 5) {
|
||||
if (pdset->common.number < 5) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "printf::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;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ static long process(struct dbCommon *pcommon)
|
||||
/* Call device support */
|
||||
pdset = (printfdset *) prec->dset;
|
||||
if (pdset &&
|
||||
pdset->number >= 5 &&
|
||||
pdset->common.number >= 5 &&
|
||||
pdset->write_string) {
|
||||
status = pdset->write_string(prec);
|
||||
|
||||
|
||||
@@ -171,17 +171,14 @@ description (DESC) fields.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct printfRecord;
|
||||
%typedef struct printfdset {
|
||||
% long number;
|
||||
% DEVSUPFUN report;
|
||||
% DEVSUPFUN init;
|
||||
% DEVSUPFUN init_record;
|
||||
% DEVSUPFUN get_ioint_info;
|
||||
% DEVSUPFUN write_string;
|
||||
% dset common;
|
||||
% long (*write_string)(struct printfRecord *prec);
|
||||
%} printfdset;
|
||||
%#define HAS_printfdset
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Result")
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -314,6 +314,15 @@ INP is expected to point to an array field of a waveform record or similar.
|
||||
=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) {
|
||||
|
||||
@@ -374,6 +374,15 @@ If the INP link type is constant, then NORD is set to zero.
|
||||
=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