jba Moved set of alarm stat and sevr to macros
This commit is contained in:
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -45,6 +44,7 @@
|
||||
#include <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <aiRecord.h>
|
||||
@@ -114,18 +114,13 @@ static long read_ai(pai)
|
||||
status = dbGetLink(&(pai->inp.value.db_link),pai,DBR_DOUBLE,
|
||||
&(pai->val),&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pai->nsev<VALID_ALARM) {
|
||||
pai->nsev = VALID_ALARM;
|
||||
pai->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pai,LINK_ALARM,VALID_ALARM);
|
||||
} else pai->udf = FALSE;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pai->nsev<VALID_ALARM) {
|
||||
pai->nsev = VALID_ALARM;
|
||||
pai->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pai->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pai->name);
|
||||
strcat(message,": devAiSoft (read_ai) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <aiRecord.h>
|
||||
@@ -110,19 +110,14 @@ static long read_ai(pai)
|
||||
status = dbGetLink(&(pai->inp.value.db_link),pai,DBR_LONG,
|
||||
&(pai->rval),&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pai->nsev<VALID_ALARM) {
|
||||
pai->nsev = VALID_ALARM;
|
||||
pai->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pai,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pai->nsev<VALID_ALARM) {
|
||||
pai->nsev = VALID_ALARM;
|
||||
pai->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pai->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pai->name);
|
||||
strcat(message,": devAiSoftRaw (read_ai) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -73,9 +71,8 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
|
||||
void callbackRequest();
|
||||
@@ -83,18 +80,18 @@ void callbackRequest();
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct aiRecord *pai=(struct aiRecord *)(pcallback->dbAddr.precord);
|
||||
struct aiRecord *pai=(struct aiRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pai->rset);
|
||||
|
||||
dbScanLock(pai);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pai->pdba);
|
||||
dbScanUnlock(pai);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pai,process)
|
||||
static long init_record(pai)
|
||||
struct aiRecord *pai;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -106,12 +103,8 @@ static long init_record(pai,process)
|
||||
pai->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pai->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devAiTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pai;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
pai->val = pai->inp.value.value;
|
||||
pai->udf = FALSE;
|
||||
break;
|
||||
@@ -146,9 +139,7 @@ static long read_ai(pai)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pai->nsev<VALID_ALARM) {
|
||||
pai->nsev = VALID_ALARM;
|
||||
pai->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pai->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pai->name);
|
||||
strcat(message,": devAiTestAsyn (read_ai) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -116,18 +116,11 @@ static long read_ai(pai)
|
||||
status=ai_driver(pvmeio->card,pvmeio->signal,XY566DI,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /* don't convert*/
|
||||
if(pai->nsev<VALID_ALARM ) {
|
||||
pai->nsta = READ_ALARM;
|
||||
pai->nsev = VALID_ALARM;
|
||||
|
||||
}
|
||||
recGblSetSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
return(status);
|
||||
}else if(status==-2) {
|
||||
status=0;
|
||||
if(pai->nsev<VALID_ALARM ) {
|
||||
pai->nsta = HW_LIMIT_ALARM;
|
||||
pai->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pai,HW_LIMIT_ALARM,VALID_ALARM);
|
||||
}
|
||||
if(status!=0) return(status);
|
||||
/*read into hardware as -0x7ff to +0x7ff */
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <cvtTable.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -115,17 +115,11 @@ static long read_ai(pai)
|
||||
status=ai_driver(pvmeio->card,pvmeio->signal,XY566SE,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /*don't convert*/
|
||||
if(pai->nsev<VALID_ALARM ) {
|
||||
pai->nsta = READ_ALARM;
|
||||
pai->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
return(status);
|
||||
}else if(status==-2) {
|
||||
status=0;
|
||||
if(pai->nsev<VALID_ALARM ) {
|
||||
pai->nsta = HW_LIMIT_ALARM;
|
||||
pai->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pai,HW_LIMIT_ALARM,VALID_ALARM);
|
||||
}
|
||||
if(status!=0) return(status);
|
||||
pai->rval = value & 0xfff;
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -42,6 +41,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <special.h>
|
||||
@@ -81,18 +81,13 @@ static long write_ao(pao)
|
||||
status = dbPutLink(&pao->out.value.db_link,pao,DBR_DOUBLE,
|
||||
&pao->oval,1L);
|
||||
if(status!=0) {
|
||||
if(pao->nsev<VALID_ALARM) {
|
||||
pao->nsev = VALID_ALARM;
|
||||
pao->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pao,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pao->nsev<VALID_ALARM) {
|
||||
pao->nsev = VALID_ALARM;
|
||||
pao->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pao,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pao->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pao->name);
|
||||
strcat(message,": devAoSoft (write_ao) Illegal OUT field");
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -41,6 +40,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <special.h>
|
||||
@@ -80,18 +80,13 @@ static long write_ao(pao)
|
||||
status = dbPutLink(&pao->out.value.db_link,pao,DBR_LONG,
|
||||
&pao->rval,1L);
|
||||
if(status!=0) {
|
||||
if(pao->nsev<VALID_ALARM) {
|
||||
pao->nsev = VALID_ALARM;
|
||||
pao->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pao,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pao->nsev<VALID_ALARM) {
|
||||
pao->nsev = VALID_ALARM;
|
||||
pao->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pao,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pao->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pao->name);
|
||||
strcat(message,": devAoSoftRaw (write_ao) Illegal OUT field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -74,27 +73,26 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
void callbackRequest();
|
||||
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct aoRecord *pao=(struct aoRecord *)(pcallback->dbAddr.precord);
|
||||
struct aoRecord *pao=(struct aoRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pao->rset);
|
||||
|
||||
dbScanLock(pao);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pao->pdba);
|
||||
dbScanUnlock(pao);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pao,process)
|
||||
static long init_record(pao)
|
||||
struct aoRecord *pao;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -106,12 +104,8 @@ static long init_record(pao,process)
|
||||
pao->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pao->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devAoTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbComm *)pao;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
break;
|
||||
default :
|
||||
strcpy(message,pao->name);
|
||||
@@ -144,9 +138,7 @@ static long write_ao(pao)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pao->nsev<VALID_ALARM) {
|
||||
pao->nsev = VALID_ALARM;
|
||||
pao->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pao,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pao->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pao->name);
|
||||
strcat(message,": devAoTestAsyn (read_ao) Illegal OUT field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <special.h>
|
||||
@@ -114,16 +114,10 @@ static long write_ao(pao)
|
||||
status = ao_driver(pvmeio->card,pvmeio->signal,VMI4100,&value,&rbvalue);
|
||||
if(status==0 || status==-2) pao->rbv = rbvalue;
|
||||
if(status==-1) {
|
||||
if(pao->nsev<VALID_ALARM ) {
|
||||
pao->nsta = WRITE_ALARM;
|
||||
pao->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pao,WRITE_ALARM,VALID_ALARM);
|
||||
}else if(status==-2) {
|
||||
status=0;
|
||||
if(pao->nsev<VALID_ALARM ) {
|
||||
pao->nsta = HW_LIMIT_ALARM;
|
||||
pao->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pao,HW_LIMIT_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -104,10 +104,7 @@ static long read_bi(pbi)
|
||||
pbi->rval = value;
|
||||
return(0);
|
||||
} else {
|
||||
if(pbi->nsev<VALID_ALARM ) {
|
||||
pbi->nsta = READ_ALARM;
|
||||
pbi->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbi,READ_ALARM,VALID_ALARM);
|
||||
return(2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -111,18 +111,13 @@ static long read_bi(pbi)
|
||||
status = dbGetLink(&(pbi->inp.value.db_link),pbi,DBR_USHORT,
|
||||
&pbi->val,&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pbi->nsev<VALID_ALARM) {
|
||||
pbi->nsev = VALID_ALARM;
|
||||
pbi->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbi,LINK_ALARM,VALID_ALARM);
|
||||
} else pbi->udf = FALSE;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pbi->nsev<VALID_ALARM) {
|
||||
pbi->nsev = VALID_ALARM;
|
||||
pbi->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pbi,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pbi->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pbi->name);
|
||||
strcat(message,": devBiSoft (read_bi) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -110,18 +110,13 @@ static long read_bi(pbi)
|
||||
status = dbGetLink(&(pbi->inp.value.db_link),pbi,DBR_ULONG,
|
||||
&pbi->rval,&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pbi->nsev<VALID_ALARM) {
|
||||
pbi->nsev = VALID_ALARM;
|
||||
pbi->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbi,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pbi->nsev<VALID_ALARM) {
|
||||
pbi->nsev = VALID_ALARM;
|
||||
pbi->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pbi,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pbi->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pbi->name);
|
||||
strcat(message,": devBiSoftRaw (read_bi) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -73,7 +72,7 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
@@ -83,18 +82,18 @@ void callbackRequest();
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct biRecord *pbi=(struct biRecord *)(pcallback->dbAddr.precord);
|
||||
struct biRecord *pbi=(struct biRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pbi->rset);
|
||||
|
||||
dbScanLock(pbi);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pbi->pdba);
|
||||
dbScanUnlock(pbi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pbi,process)
|
||||
static long init_record(pbi)
|
||||
struct biRecord *pbi;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -106,12 +105,8 @@ static long init_record(pbi,process)
|
||||
pbi->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pbi->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devBiTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pbi;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
pbi->val = pbi->inp.value.value;
|
||||
pbi->udf = FALSE;
|
||||
break;
|
||||
@@ -146,9 +141,7 @@ static long read_bi(pbi)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pbi->nsev<VALID_ALARM) {
|
||||
pbi->nsev = VALID_ALARM;
|
||||
pbi->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pbi,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pbi->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pbi->name);
|
||||
strcat(message,": devBiTestAsyn (read_bi) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -104,10 +104,7 @@ static long read_bi(pbi)
|
||||
pbi->rval = value;
|
||||
return(0);
|
||||
} else {
|
||||
if(pbi->nsev<VALID_ALARM ) {
|
||||
pbi->nsta = READ_ALARM;
|
||||
pbi->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbi,READ_ALARM,VALID_ALARM);
|
||||
return(2);
|
||||
}
|
||||
return(status);
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -116,10 +116,7 @@ static long write_bo(pbo)
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
status = bo_driver(pvmeio->card,pbo->rval,pbo->mask,BB902);
|
||||
if(status!=0) {
|
||||
if(pbo->nsev<VALID_ALARM ) {
|
||||
pbo->nsta = WRITE_ALARM;
|
||||
pbo->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -81,18 +81,13 @@ static long write_bo(pbo)
|
||||
case (DB_LINK) :
|
||||
status = dbPutLink(&pbo->out.value.db_link,pbo,DBR_USHORT,&pbo->val,1L);
|
||||
if(status!=0) {
|
||||
if(pbo->nsev<VALID_ALARM) {
|
||||
pbo->nsev = VALID_ALARM;
|
||||
pbo->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbo,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pbo->nsev<VALID_ALARM) {
|
||||
pbo->nsev = VALID_ALARM;
|
||||
pbo->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pbo,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pbo->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pbo->name);
|
||||
strcat(message,": devBoSoft (write_bo) Illegal OUT field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -75,27 +74,26 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
void callbackRequest();
|
||||
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct boRecord *pbo=(struct boRecord *)(pcallback->dbAddr.precord);
|
||||
struct boRecord *pbo=(struct boRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pbo->rset);
|
||||
|
||||
dbScanLock(pbo);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pbo->pdba);
|
||||
dbScanUnlock(pbo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pbo,process)
|
||||
static long init_record(pbo)
|
||||
struct boRecord *pbo;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -107,12 +105,8 @@ static long init_record(pbo,process)
|
||||
pbo->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pbo->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devBoTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pbo;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
break;
|
||||
default :
|
||||
strcpy(message,pbo->name);
|
||||
@@ -145,9 +139,7 @@ static long write_bo(pbo)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pbo->nsev<VALID_ALARM) {
|
||||
pbo->nsev = VALID_ALARM;
|
||||
pbo->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pbo,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pbo->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pbo->name);
|
||||
strcat(message,": devBoTestAsyn (read_bo) Illegal OUT field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -116,10 +116,7 @@ static long write_bo(pbo)
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
status = bo_driver(pvmeio->card,pbo->rval,pbo->mask,XY220);
|
||||
if(status!=0) {
|
||||
if(pbo->nsev<VALID_ALARM ) {
|
||||
pbo->nsta = WRITE_ALARM;
|
||||
pbo->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -72,9 +71,8 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
|
||||
void callbackRequest();
|
||||
@@ -82,18 +80,17 @@ void callbackRequest();
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct histogramRecord *phistogram=(struct histogramRecord *)(pcallback->dbAddr.precord);
|
||||
struct histogramRecord *phistogram=(struct histogramRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(phistogram->rset);
|
||||
|
||||
dbScanLock(phistogram);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(phistogram->pdba);
|
||||
dbScanUnlock(phistogram);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(phistogram,process)
|
||||
static long init_record(phistogram)
|
||||
struct histogramRecord *phistogram;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -105,12 +102,8 @@ static long init_record(phistogram,process)
|
||||
phistogram->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(phistogram->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devHistogramTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)phistogram;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
phistogram->sgnl = phistogram->svl.value.value;
|
||||
break;
|
||||
default :
|
||||
@@ -144,9 +137,7 @@ static long read_histogram(phistogram)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(phistogram->nsev<VALID_ALARM) {
|
||||
phistogram->nsev = VALID_ALARM;
|
||||
phistogram->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(phistogram,SOFT_ALARM,VALID_ALARM)){
|
||||
if(phistogram->stat!=SOFT_ALARM) {
|
||||
strcpy(message,phistogram->name);
|
||||
strcat(message,": devHistogramTestAsyn (read_histogram) Illegal SVL field");
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
*/
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -107,18 +108,13 @@ static long read_longin(plongin)
|
||||
status = dbGetLink(&(plongin->inp.value.db_link),plongin,DBR_LONG,
|
||||
&plongin->val,&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(plongin->nsev<VALID_ALARM) {
|
||||
plongin->nsev = VALID_ALARM;
|
||||
plongin->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(plongin,LINK_ALARM,VALID_ALARM);
|
||||
} else plongin->udf = FALSE;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(plongin->nsev<VALID_ALARM) {
|
||||
plongin->nsev = VALID_ALARM;
|
||||
plongin->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(plongin,SOFT_ALARM,VALID_ALARM)){
|
||||
if(plongin->stat!=SOFT_ALARM) {
|
||||
strcpy(message,plongin->name);
|
||||
strcat(message,": devLiSoft (read_longin) Illegal INP field");
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -77,18 +78,13 @@ static long write_longout(plongout)
|
||||
status = dbPutLink(&plongout->out.value.db_link,plongout,DBR_LONG,
|
||||
&plongout->val,1L);
|
||||
if(status!=0) {
|
||||
if(plongout->nsev<VALID_ALARM) {
|
||||
plongout->nsev = VALID_ALARM;
|
||||
plongout->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(plongout,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(plongout->nsev<VALID_ALARM) {
|
||||
plongout->nsev = VALID_ALARM;
|
||||
plongout->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(plongout,SOFT_ALARM,VALID_ALARM)){
|
||||
if(plongout->stat!=SOFT_ALARM) {
|
||||
strcpy(message,plongout->name);
|
||||
strcat(message,": devLoSoft (write_longout) Illegal OUT field");
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -102,10 +102,7 @@ static long read_mbbi(pmbbi)
|
||||
if(status==0) {
|
||||
pmbbi->rval = value;
|
||||
} else {
|
||||
if(pmbbi->nsev<VALID_ALARM ) {
|
||||
pmbbi->nsta = READ_ALARM;
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbi,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -110,18 +110,13 @@ static long read_mbbi(pmbbi)
|
||||
status = dbGetLink(&(pmbbi->inp.value.db_link),pmbbi,DBR_USHORT,
|
||||
&(pmbbi->val),&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pmbbi->nsev<VALID_ALARM) {
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
pmbbi->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbi,LINK_ALARM,VALID_ALARM);
|
||||
} else pmbbi->udf = FALSE;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pmbbi->nsev<VALID_ALARM) {
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
pmbbi->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pmbbi,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pmbbi->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pmbbi->name);
|
||||
strcat(message,": devMbbiSoft (read_mbbi) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -109,18 +109,13 @@ static long read_mbbi(pmbbi)
|
||||
status = dbGetLink(&(pmbbi->inp.value.db_link),pmbbi,DBR_ULONG,
|
||||
&(pmbbi->rval),&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pmbbi->nsev<VALID_ALARM) {
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
pmbbi->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbi,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pmbbi->nsev<VALID_ALARM) {
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
pmbbi->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pmbbi,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pmbbi->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pmbbi->name);
|
||||
strcat(message,": devMbbiSoftRaw (read_mbbi) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -73,9 +72,8 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
|
||||
void callbackRequest();
|
||||
@@ -83,18 +81,18 @@ void callbackRequest();
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct mbbiRecord *pmbbi=(struct mbbiRecord *)(pcallback->dbAddr.precord);
|
||||
struct mbbiRecord *pmbbi=(struct mbbiRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pmbbi->rset);
|
||||
|
||||
dbScanLock(pmbbi);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pmbbi->pdba);
|
||||
dbScanUnlock(pmbbi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pmbbi,process)
|
||||
static long init_record(pmbbi)
|
||||
struct mbbiRecord *pmbbi;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -106,12 +104,8 @@ static long init_record(pmbbi,process)
|
||||
pmbbi->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pmbbi->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devMbbiTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pmbbi;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
pmbbi->val = pmbbi->inp.value.value;
|
||||
pmbbi->udf = FALSE;
|
||||
break;
|
||||
@@ -146,9 +140,7 @@ static long read_mbbi(pmbbi)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pmbbi->nsev<VALID_ALARM) {
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
pmbbi->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pmbbi,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pmbbi->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pmbbi->name);
|
||||
strcat(message,": devMbbiTestAsyn (read_mbbi) Illegal INP field");
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -102,10 +102,7 @@ static long read_mbbi(pmbbi)
|
||||
if(status==0) {
|
||||
pmbbi->rval = value;
|
||||
} else {
|
||||
if(pmbbi->nsev<VALID_ALARM ) {
|
||||
pmbbi->nsta = READ_ALARM;
|
||||
pmbbi->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbi,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -109,15 +109,9 @@ static long write_mbbo(pmbbo)
|
||||
if(status==0) {
|
||||
status = bo_read(pvmeio->card,pmbbo->mask,&value,BB902);
|
||||
if(status==0) pmbbo->rbv = value;
|
||||
else if(pmbbo->nsev<VALID_ALARM ) {
|
||||
pmbbo->nsta = READ_ALARM;
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
}
|
||||
else recGblSetSevr(pmbbo,READ_ALARM,VALID_ALARM);
|
||||
} else {
|
||||
if(pmbbo->nsev<VALID_ALARM ) {
|
||||
pmbbo->nsta = WRITE_ALARM;
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -84,18 +84,13 @@ static long write_mbbo(pmbbo)
|
||||
status = dbPutLink(&pmbbo->out.value.db_link,pmbbo,DBR_USHORT,
|
||||
&pmbbo->val,1L);
|
||||
if(status!=0) {
|
||||
if(pmbbo->nsev<VALID_ALARM) {
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
pmbbo->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbo,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pmbbo->nsev<VALID_ALARM) {
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
pmbbo->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pmbbo,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pmbbo->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pmbbo->name);
|
||||
strcat(message,": devMbboSoft (write_mbbo) Illegal OUT field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -74,27 +73,26 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
void callbackRequest();
|
||||
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct mbboRecord *pmbbo=(struct mbboRecord *)(pcallback->dbAddr.precord);
|
||||
struct mbboRecord *pmbbo=(struct mbboRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pmbbo->rset);
|
||||
|
||||
dbScanLock(pmbbo);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pmbbo->pdba);
|
||||
dbScanUnlock(pmbbo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pmbbo,process)
|
||||
static long init_record(pmbbo)
|
||||
struct mbboRecord *pmbbo;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -106,12 +104,8 @@ static long init_record(pmbbo,process)
|
||||
pmbbo->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pmbbo->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devMbboTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pmbbo;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
break;
|
||||
default :
|
||||
strcpy(message,pmbbo->name);
|
||||
@@ -144,9 +138,7 @@ static long write_mbbo(pmbbo)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pmbbo->nsev<VALID_ALARM) {
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
pmbbo->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pmbbo,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pmbbo->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pmbbo->name);
|
||||
strcat(message,": devMbboTestAsyn (read_mbbo) Illegal OUT field");
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -108,15 +108,9 @@ static long write_mbbo(pmbbo)
|
||||
if(status==0) {
|
||||
status = bo_read(pvmeio->card,pmbbo->mask,&value,XY220);
|
||||
if(status==0) pmbbo->rbv = value;
|
||||
else if(pmbbo->nsev<VALID_ALARM ) {
|
||||
pmbbo->nsta = READ_ALARM;
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
}
|
||||
else recGblSetSevr(pmbbo,READ_ALARM,VALID_ALARM);
|
||||
} else {
|
||||
if(pmbbo->nsev<VALID_ALARM ) {
|
||||
pmbbo->nsta = WRITE_ALARM;
|
||||
pmbbo->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pmbbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 10-22-91 mrk Initial Implementation
|
||||
* .02 11-26-91 jba Initialized clockDiv to 0
|
||||
* .03 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -48,6 +50,7 @@
|
||||
#include <dbRecType.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbCommon.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <special.h>
|
||||
@@ -204,7 +207,8 @@ getData(preg,pdata)
|
||||
if(mz8310Debug) printf("mz8310:getData: preg=%x data=%x %d\n",preg,*pdata,*pdata);
|
||||
}
|
||||
|
||||
static long init()
|
||||
static long init(after)
|
||||
short after;
|
||||
{
|
||||
int card,chip,channel;
|
||||
/*volatile*/
|
||||
@@ -214,6 +218,7 @@ static long init()
|
||||
unsigned short data;
|
||||
int dummy;
|
||||
|
||||
if(after)return(0);
|
||||
if(sysBusToLocalAdrs(VME_AM_USR_SHORT_IO, 0, &shortaddr)) {
|
||||
logMsg("devMz8310: sysBusToLocalAdrs failed\n");
|
||||
exit(1);
|
||||
@@ -244,7 +249,7 @@ static long init()
|
||||
}
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long report(fp,interest)
|
||||
@@ -413,10 +418,7 @@ static long cmd_pc(pr)
|
||||
}
|
||||
/*set count source selection*/
|
||||
if(pr->clks<0 || pr->clks>15) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : illegal clks value");
|
||||
return(1);
|
||||
@@ -435,15 +437,12 @@ static long cmd_pc(pr)
|
||||
pr->udf = FALSE;
|
||||
break;
|
||||
default:
|
||||
if(pr->nsev<MAJOR_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = MAJOR_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,MAJOR_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : illegal command");
|
||||
return(0);
|
||||
}
|
||||
return(OK);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long write_pd(pr)
|
||||
@@ -457,7 +456,7 @@ static long write_pd(pr)
|
||||
int card,chip,channel,signal;
|
||||
unsigned short load,hold,mode;
|
||||
double clockRate,holdCount,loadCount;
|
||||
int clockDiv;
|
||||
int clockDiv=0;
|
||||
|
||||
if(!pr->dpvt) return(S_dev_NoInit);
|
||||
pvmeio = (struct vmeio *)&(pr->out.value);
|
||||
@@ -471,10 +470,7 @@ static long write_pd(pr)
|
||||
/* compute hold count and load count */
|
||||
clockRate = (pr->csrc==INTERNAL ? INT_CLOCK_RATE : pr->clkr);
|
||||
if(clockRate<=0 || clockRate>MAX_CLOCK_RATE) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : computed illegal clock rate");
|
||||
return(1);
|
||||
@@ -494,10 +490,7 @@ static long write_pd(pr)
|
||||
}
|
||||
}
|
||||
if(loadCount>65536.0 || holdCount>65535.0) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : computed illegal clock rate");
|
||||
return(1);
|
||||
@@ -515,10 +508,7 @@ static long write_pd(pr)
|
||||
mode |= internalCountSource[clockDiv];
|
||||
} else {/*external clock. Determine source*/
|
||||
if(pr->clks<0 || pr->clks>15) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : illegal clks value");
|
||||
return(1);
|
||||
@@ -546,7 +536,7 @@ static long write_pd(pr)
|
||||
putCmd(pcmd,(STEP | (channel+1)));
|
||||
putCmd(pcmd,(ARM | (1<<channel)));
|
||||
pr->udf = FALSE;
|
||||
return(OK);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long write_pt(pr)
|
||||
@@ -560,7 +550,7 @@ static long write_pt(pr)
|
||||
int card,chip,channel,signal;
|
||||
unsigned short load,hold,mode;
|
||||
double clockRate,periodInClockUnits,holdCount,loadCount;
|
||||
int clockDiv;
|
||||
int clockDiv=0;
|
||||
|
||||
if(!pr->dpvt) return(S_dev_NoInit);
|
||||
pvmeio = (struct vmeio *)&(pr->out.value);
|
||||
@@ -591,10 +581,7 @@ static long write_pt(pr)
|
||||
clockRate = (pr->csrc==INTERNAL ? INT_CLOCK_RATE : pr->clkr);
|
||||
periodInClockUnits = pr->per * clockRate;
|
||||
if(clockRate<=0 || clockRate>MAX_CLOCK_RATE || periodInClockUnits<=1) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : computed illegal clock rate");
|
||||
return(1);
|
||||
@@ -613,10 +600,7 @@ static long write_pt(pr)
|
||||
}
|
||||
}
|
||||
if(loadCount>65536.0 || holdCount>65535.0) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : computed illegal clock rate");
|
||||
return(1);
|
||||
@@ -640,10 +624,7 @@ static long write_pt(pr)
|
||||
mode |= internalCountSource[clockDiv];
|
||||
} else {/*external clock. Determine source*/
|
||||
if(pr->clks<0 || pr->clks>15) {
|
||||
if(pr->nsev<VALID_ALARM) {
|
||||
pr->nsta = WRITE_ALARM;
|
||||
pr->nsev = VALID_ALARM;
|
||||
}
|
||||
recGblSetSevr(pr,WRITE_ALARM,VALID_ALARM);
|
||||
recGblRecordError(S_db_badField,pr,
|
||||
"devMz8310 : illegal clks value");
|
||||
return(1);
|
||||
@@ -669,5 +650,5 @@ static long write_pt(pr)
|
||||
/* Load and arm counter*/
|
||||
putCmd(pcmd,(LOADARM | (1<<channel)));
|
||||
pr->udf = FALSE;
|
||||
return(OK);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -42,6 +41,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -80,18 +80,13 @@ static long write_pt(ppt)
|
||||
case (DB_LINK) :
|
||||
status = dbPutLink(&ppt->out.value.db_link,ppt,DBR_SHORT,&ppt->val,1L);
|
||||
if(status!=0) {
|
||||
if(ppt->nsev<VALID_ALARM) {
|
||||
ppt->nsev = VALID_ALARM;
|
||||
ppt->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(ppt,LINK_ALARM,VALID_ALARM);
|
||||
} else ppt->udf=FALSE;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(ppt->nsev<VALID_ALARM) {
|
||||
ppt->nsev = VALID_ALARM;
|
||||
ppt->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(ppt,WRITE_ALARM,VALID_ALARM)){
|
||||
if(ppt->stat!=SOFT_ALARM) {
|
||||
strcpy(message,ppt->name);
|
||||
strcat(message,": devPtSoft (write_pt) Illegal OUT field");
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
*/
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -111,18 +112,13 @@ static long read_stringin(pstringin)
|
||||
status = dbGetLink(&(pstringin->inp.value.db_link),pstringin,DBR_STRING,
|
||||
pstringin->val,&options,&nRequest);
|
||||
if(status!=0) {
|
||||
if(pstringin->nsev<VALID_ALARM) {
|
||||
pstringin->nsev = VALID_ALARM;
|
||||
pstringin->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pstringin,LINK_ALARM,VALID_ALARM);
|
||||
} else pstringin->udf = FALSE;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pstringin->nsev<VALID_ALARM) {
|
||||
pstringin->nsev = VALID_ALARM;
|
||||
pstringin->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pstringin,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pstringin->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pstringin->name);
|
||||
strcat(message,": devSiSoft (read_stringin) Illegal INP field");
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -72,9 +71,8 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
|
||||
void callbackRequest();
|
||||
@@ -82,18 +80,18 @@ void callbackRequest();
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct stringinRecord *pstringin=(struct stringinRecord *)(pcallback->dbAddr.precord);
|
||||
struct stringinRecord *pstringin=(struct stringinRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pstringin->rset);
|
||||
|
||||
dbScanLock(pstringin);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pstringin->pdba);
|
||||
dbScanUnlock(pstringin);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pstringin,process)
|
||||
static long init_record(pstringin)
|
||||
struct stringinRecord *pstringin;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -105,12 +103,8 @@ static long init_record(pstringin,process)
|
||||
pstringin->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pstringin->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devSiTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pstringin;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
if (pstringin->inp.value.value!=0.0) {
|
||||
sprintf(pstringin->val,"%-14.7g",pstringin->inp.value.value);
|
||||
pstringin->udf = FALSE;
|
||||
@@ -147,9 +141,7 @@ static long read_stringin(pstringin)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pstringin->nsev<VALID_ALARM) {
|
||||
pstringin->nsev = VALID_ALARM;
|
||||
pstringin->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pstringin,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pstringin->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pstringin->name);
|
||||
strcat(message,": devSiTestAsyn (read_stringin) Illegal INP field");
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbDefs.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -77,18 +78,13 @@ static long write_stringout(pstringout)
|
||||
status = dbPutLink(&pstringout->out.value.db_link,pstringout,DBR_STRING,
|
||||
pstringout->val,1L);
|
||||
if(status!=0) {
|
||||
if(pstringout->nsev<VALID_ALARM) {
|
||||
pstringout->nsev = VALID_ALARM;
|
||||
pstringout->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pstringout,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pstringout->nsev<VALID_ALARM) {
|
||||
pstringout->nsev = VALID_ALARM;
|
||||
pstringout->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pstringout,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pstringout->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pstringout->name);
|
||||
strcat(message,": devSoSoft (write_stringout) Illegal OUT field");
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -73,27 +72,26 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
void callbackRequest();
|
||||
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct stringoutRecord *pstringout=(struct stringoutRecord *)(pcallback->dbAddr.precord);
|
||||
struct stringoutRecord *pstringout=(struct stringoutRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pstringout->rset);
|
||||
|
||||
dbScanLock(pstringout);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pstringout->pdba);
|
||||
dbScanUnlock(pstringout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long init_record(pstringout,process)
|
||||
static long init_record(pstringout)
|
||||
struct stringoutRecord *pstringout;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -105,12 +103,8 @@ static long init_record(pstringout,process)
|
||||
pstringout->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pstringout->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devSoTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pstringout;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
break;
|
||||
default :
|
||||
strcpy(message,pstringout->name);
|
||||
@@ -143,9 +137,7 @@ static long write_stringout(pstringout)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pstringout->nsev<VALID_ALARM) {
|
||||
pstringout->nsev = VALID_ALARM;
|
||||
pstringout->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pstringout,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pstringout->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pstringout->name);
|
||||
strcat(message,": devSoTestAsyn (read_stringout) Illegal OUT field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <waveformRecord.h>
|
||||
@@ -106,19 +106,14 @@ static long read_wf(pwf)
|
||||
nRequest=pwf->nelm;
|
||||
if(dbGetLink(&(pwf->inp.value.db_link),pwf,pwf->ftvl,
|
||||
pwf->bptr,&options,&nRequest)!=0){
|
||||
if(pwf->nsev < VALID_ALARM) {
|
||||
pwf->nsev = VALID_ALARM;
|
||||
pwf->nsta = LINK_ALARM;
|
||||
}
|
||||
recGblSetSevr(pwf,LINK_ALARM,VALID_ALARM);
|
||||
}
|
||||
pwf->nord = nRequest;
|
||||
break;
|
||||
case (CA_LINK) :
|
||||
break;
|
||||
default :
|
||||
if(pwf->nsev<VALID_ALARM) {
|
||||
pwf->nsev = VALID_ALARM;
|
||||
pwf->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pwf,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pwf->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pwf->name);
|
||||
strcat(message,": devWfSoft (read_wf) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <waveformRecord.h>
|
||||
@@ -72,24 +72,23 @@ struct {
|
||||
struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
struct dbCommon *prec;
|
||||
WDOG_ID wd_id;
|
||||
void (*process)();
|
||||
};
|
||||
void callbackRequest();
|
||||
|
||||
static void myCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct wfRecord *pwf=(struct wfRecord *)(pcallback->dbAddr.precord);
|
||||
struct waveformRecord *pwf=(struct waveformRecord *)(pcallback->prec);
|
||||
struct rset *prset=(struct rset *)(pwf->rset);
|
||||
|
||||
dbScanLock(pwf);
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
(*prset->process)(pwf->pdba);
|
||||
dbScanUnlock(pwf);
|
||||
}
|
||||
static long init_record(pwf,process)
|
||||
static long init_record(pwf)
|
||||
struct waveformRecord *pwf;
|
||||
void (*process)();
|
||||
{
|
||||
char message[100];
|
||||
struct callback *pcallback;
|
||||
@@ -101,12 +100,8 @@ static long init_record(pwf,process)
|
||||
pwf->dpvt = (caddr_t)pcallback;
|
||||
pcallback->callback = myCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
if(dbNameToAddr(pwf->name,&(pcallback->dbAddr))) {
|
||||
logMsg("dbNameToAddr failed in init_record for devWfTestAsyn\n");
|
||||
exit(1);
|
||||
}
|
||||
pcallback->prec = (struct dbCommon *)pwf;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->process = process;
|
||||
pwf->nord = 0;
|
||||
break;
|
||||
default :
|
||||
@@ -140,9 +135,7 @@ static long read_wf(pwf)
|
||||
return(1);
|
||||
}
|
||||
default :
|
||||
if(pwf->nsev<VALID_ALARM) {
|
||||
pwf->nsev = VALID_ALARM;
|
||||
pwf->nsta = SOFT_ALARM;
|
||||
if(recGblSetSevr(pwf,SOFT_ALARM,VALID_ALARM)){
|
||||
if(pwf->stat!=SOFT_ALARM) {
|
||||
strcpy(message,pwf->name);
|
||||
strcat(message,": devWfTestAsyn (read_wf) Illegal INP field");
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy iii Comment
|
||||
* .02 mm-dd-yy iii Comment
|
||||
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
|
||||
* ...
|
||||
*/
|
||||
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <alarm.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbAccess.h>
|
||||
#include <recSup.h>
|
||||
#include <devSup.h>
|
||||
#include <link.h>
|
||||
#include <module_types.h>
|
||||
@@ -92,11 +92,7 @@ static void myCallback(pcallback,no_read,pdata)
|
||||
} else {
|
||||
recGblRecSupError(S_db_badField,&pcallback->dbAddr,
|
||||
"read_wf - illegal ftvl");
|
||||
if(pwf->nsev<VALID_ALARM ) {
|
||||
pwf->nsta = READ_ALARM;
|
||||
pwf->nsev = VALID_ALARM;
|
||||
|
||||
}
|
||||
recGblSetSevr(pwf,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
(pcallback->process)(&pcallback->dbAddr);
|
||||
dbScanUnlock(pwf);
|
||||
@@ -159,11 +155,7 @@ struct waveformRecord *pwf;
|
||||
|
||||
pwf->busy = TRUE;
|
||||
if(wf_driver(XY566WF,pvmeio->card,myCallback,pwf->dpvt)<0) {
|
||||
if(pwf->nsev<VALID_ALARM ) {
|
||||
pwf->nsta = READ_ALARM;
|
||||
pwf->nsev = VALID_ALARM;
|
||||
|
||||
}
|
||||
recGblSetSevr(pwf,READ_ALARM,VALID_ALARM);
|
||||
pwf->busy = FALSE;
|
||||
return(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user