Fixed most compiler warning messages

This commit is contained in:
Marty Kraimer
1997-04-30 19:20:01 +00:00
parent 437142b5bb
commit 7cde4f8f2b
46 changed files with 1522 additions and 452 deletions
+2
View File
@@ -16,6 +16,7 @@ RECTYPES += aoRecord.h
RECTYPES += biRecord.h
RECTYPES += boRecord.h
RECTYPES += calcRecord.h
RECTYPES += calcoutRecord.h
RECTYPES += compressRecord.h
RECTYPES += dfanoutRecord.h
RECTYPES += egRecord.h
@@ -59,6 +60,7 @@ SRCS.c += ../aoRecord.c
SRCS.c += ../biRecord.c
SRCS.c += ../boRecord.c
SRCS.c += ../calcRecord.c
SRCS.c += ../calcoutRecord.c
SRCS.c += ../compressRecord.c
SRCS.c += ../dfanoutRecord.c
SRCS.c += ../egRecord.c
+1
View File
@@ -50,6 +50,7 @@
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <dbScan.h>
#include <dbEvent.h>
#include <devSup.h>
#include <errMdef.h>
#include <recSup.h>
+1
View File
@@ -50,6 +50,7 @@
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <dbScan.h>
#include <dbEvent.h>
#include <devSup.h>
#include <errMdef.h>
#include <recSup.h>
+1
View File
@@ -83,6 +83,7 @@
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbScan.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
+2 -11
View File
@@ -80,6 +80,7 @@
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -96,7 +97,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -306,16 +307,6 @@ static long special(paddr,after)
}
}
static long get_value(pao,pvdes)
struct aoRecord *pao;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_DOUBLE;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &pao->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
+2 -11
View File
@@ -66,6 +66,7 @@
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <dbEvent.h>
#include <devSup.h>
#include <errMdef.h>
#include <recSup.h>
@@ -79,7 +80,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -185,16 +186,6 @@ static long process(pbi)
return(status);
}
static long get_value(pbi,pvdes)
struct biRecord *pbi;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_ENUM;
pvdes->no_elements=1;
(unsigned short *)(pvdes->pvalue) = &pbi->val;
return(0);
}
static long get_enum_str(paddr,pstring)
struct dbAddr *paddr;
char *pstring;
+7 -12
View File
@@ -79,6 +79,7 @@
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -95,7 +96,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -156,7 +157,6 @@ static void myCallback(pcallback)
{
struct boRecord *pbo=(struct boRecord *)pcallback->precord;
struct rset *prset=(struct rset *)(pbo->rset);
int wait_time;
dbScanLock((struct dbCommon *)pbo);
@@ -224,6 +224,11 @@ static long init_record(pbo,pass)
pbo->udf = FALSE;
} else if (status==2) status=0;
}
/* convert val to rval */
if ( pbo->mask != 0 ) {
if(pbo->val==0) pbo->rval = 0;
else pbo->rval = pbo->mask;
} else pbo->rval = (unsigned long)pbo->val;
return(status);
}
@@ -314,16 +319,6 @@ static long process(pbo)
return(status);
}
static long get_value(pbo,pvdes)
struct boRecord *pbo;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_ENUM;
pvdes->no_elements=1;
(unsigned short *)(pvdes->pvalue) = &pbo->val;
return(0);
}
static long get_precision(paddr,precision)
struct dbAddr *paddr;
long *precision;
+2 -15
View File
@@ -81,6 +81,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
@@ -95,7 +96,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -134,10 +135,6 @@ static int fetch_values();
#define ARG_MAX 12
/* Fldnames should have as many as ARG_MAX */
static char *Fldnames[ARG_MAX] =
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
static long init_record(pcalc,pass)
struct calcRecord *pcalc;
@@ -217,16 +214,6 @@ static long special(paddr,after)
return(S_db_badChoice);
}
}
static long get_value(pcalc,pvdes)
struct calcRecord *pcalc;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_DOUBLE;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &pcalc->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
+791
View File
@@ -0,0 +1,791 @@
/* calcout.c - Record Support Routines for calc with output records */
/*
* Author : Ned Arnold
* Based on recCalc.c, by ...
* Original Author: Julie Sander and Bob Dalesio
* Current Author: Marty Kraimer
* Date: 7-27-87
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
* .01 08-29-96 nda Created from calcoutRecord.c for EPICS R3.13
* .02 09-13-96 nda Original release for EPICS R3.13beta3
*
*
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <tickLib.h>
#include <wdLib.h>
#include <sysLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbScan.h>
#include <errMdef.h>
#include <recSup.h>
#include <special.h>
#include <callback.h>
#include <taskwd.h>
#define GEN_SIZE_OFFSET
#include <calcoutRecord.h>
#undef GEN_SIZE_OFFSET
#include <menuIvoa.h>
/* Create RSET - Record Support Entry Table*/
#define report NULL
#define initialize NULL
static long init_record();
static long process();
static long special();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
static long get_units();
static long get_precision();
#define get_enum_str NULL
#define get_enum_strs NULL
#define put_enum_str NULL
static long get_graphic_double();
static long get_control_double();
static long get_alarm_double();
struct rset calcoutRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
/* To provide feedback to the user as to the connection status of the
* links (.INxV and .OUTV), the following algorithm has been implemented ...
*
* A new PV_LINK [either in init() or special()] is searched for using
* dbNameToAddr. If local, it is so indicated. If not, a checkLinkCb
* callback is scheduled to check the connectivity later using
* dbCaIsLinkConnected(). Anytime there are unconnected CA_LINKs, another
* callback is scheduled. Once all connections are established, the CA_LINKs
* are checked whenever the record processes.
*
*/
#define NO_CA_LINKS 0
#define CA_LINKS_ALL_OK 1
#define CA_LINKS_NOT_OK 2
struct rpvtStruct {
CALLBACK doOutCb;
WDOG_ID wd_id_0;
CALLBACK checkLinkCb;
WDOG_ID wd_id_1;
short wd_id_1_LOCK;
short caLinkStat; /* NO_CA_LINKS,CA_LINKS_ALL_OK,CA_LINKS_NOT_OK */
};
static void alarm();
static void monitor();
static int fetch_values();
static void execOutput();
static void doOutputCallback();
static void checkLinks();
static void checkLinksCallback();
int calcoutRecDebug;
#define ARG_MAX 12
static long init_record(pcalc,pass)
struct calcoutRecord *pcalc;
int pass;
{
struct link *plink;
int i;
double *pvalue;
unsigned short *plinkValid;
short error_number;
char rpbuf[184];
struct dbAddr *pAddr = 0;
struct rpvtStruct *prpvt;
if (pass==0) {
pcalc->rpvt = (void *)calloc(1, sizeof(struct rpvtStruct));
return(0);
}
prpvt = (struct rpvtStruct *)pcalc->rpvt;
plink = &pcalc->inpa;
pvalue = &pcalc->a;
plinkValid = &pcalc->inav;
for(i=0; i<(ARG_MAX+1); i++, plink++, pvalue++, plinkValid++) {
if (plink->type == CONSTANT) {
/* Don't InitConstantLink the .OUT link */
if(i<ARG_MAX) {
recGblInitConstantLink(plink,DBF_DOUBLE,pvalue);
db_post_events(pcalc,pvalue,DBE_VALUE);
}
*plinkValid = calcoutINAV_CON;
}
/* see if the PV resides on this ioc */
else if(!dbNameToAddr(plink->value.pv_link.pvname, pAddr)) {
*plinkValid = calcoutINAV_LOC;
}
/* pv is not on this ioc. Callback later for connection stat */
else {
*plinkValid = calcoutINAV_EXT_NC;
prpvt->caLinkStat = CA_LINKS_NOT_OK;
}
db_post_events(pcalc,plinkValid,DBE_VALUE);
}
pcalc->clcv=postfix(pcalc->calc,rpbuf,&error_number);
if(pcalc->clcv){
recGblRecordError(S_db_badField,(void *)pcalc,
"calcout: init_record: Illegal CALC field");
return(S_db_badField);
}
else {
memcpy(pcalc->rpcl,rpbuf,sizeof(pcalc->rpcl));
}
db_post_events(pcalc,&pcalc->clcv,DBE_VALUE);
pcalc->oclv=postfix(pcalc->ocal,rpbuf,&error_number);
if(pcalc->oclv){
recGblRecordError(S_db_badField,(void *)pcalc,
"calcout: init_record: Illegal OCAL field");
return(S_db_badField);
}
else {
memcpy(pcalc->orpc,rpbuf,sizeof(pcalc->orpc));
}
db_post_events(pcalc,&pcalc->oclv,DBE_VALUE);
prpvt = (struct rpvtStruct *)pcalc->rpvt;
callbackSetCallback(doOutputCallback, &prpvt->doOutCb);
callbackSetPriority(pcalc->prio, &prpvt->doOutCb);
callbackSetUser(pcalc, &prpvt->doOutCb);
callbackSetCallback(checkLinksCallback, &prpvt->checkLinkCb);
callbackSetPriority(0, &prpvt->checkLinkCb);
callbackSetUser(pcalc, &prpvt->checkLinkCb);
prpvt->wd_id_0 = wdCreate();
prpvt->wd_id_1 = wdCreate();
prpvt->wd_id_1_LOCK = 0;
if(prpvt->caLinkStat == CA_LINKS_NOT_OK) {
wdStart(prpvt->wd_id_1, 60, (FUNCPTR)callbackRequest,
(int)(&prpvt->checkLinkCb));
prpvt->wd_id_1_LOCK = 1;
}
return(0);
}
static long process(pcalc)
struct calcoutRecord *pcalc;
{
struct rpvtStruct *prpvt = (struct rpvtStruct *)pcalc->rpvt;
int wdDelay;
short doOutput = 0;
if(!pcalc->pact) {
pcalc->pact = TRUE;
/* if some links are CA, check connections */
if(prpvt->caLinkStat != NO_CA_LINKS) {
checkLinks(pcalc);
}
if(fetch_values(pcalc)==0) {
if((pcalc->clcv) ||
(pcalc->clcv) ||
calcPerform(&pcalc->a,&pcalc->val,pcalc->rpcl)) {
recGblSetSevr(pcalc,CALC_ALARM,INVALID_ALARM);
} else pcalc->udf = FALSE;
}
recGblGetTimeStamp(pcalc);
/* check for alarms */
alarm(pcalc);
/* check for output link execution */
switch(pcalc->oopt) {
case calcoutOOPT_Every_Time:
doOutput = 1;
break;
case calcoutOOPT_On_Change:
if(fabs(pcalc->pval - pcalc->val) > pcalc->mdel) {
doOutput = 1;
}
break;
case calcoutOOPT_Transition_To_Zero:
if((pcalc->pval != 0) && (pcalc->val == 0)) {
doOutput = 1;
}
break;
case calcoutOOPT_Transition_To_Non_zero:
if((pcalc->pval == 0) && (pcalc->val != 0)) {
doOutput = 1;
}
break;
case calcoutOOPT_When_Zero:
if(!pcalc->val) {
doOutput = 1;
}
break;
case calcoutOOPT_When_Non_zero:
if(pcalc->val) {
doOutput = 1;
}
break;
default:
break;
}
pcalc->pval = pcalc->val;
if(doOutput) {
if(pcalc->odly > 0.0) {
pcalc->dlya = 1;
db_post_events(pcalc,&pcalc->dlya,DBE_VALUE);
wdDelay = pcalc->odly * sysClkRateGet();
callbackSetPriority(pcalc->prio, &prpvt->doOutCb);
wdStart(prpvt->wd_id_0, wdDelay, (FUNCPTR)callbackRequest,
(int)(&prpvt->doOutCb));
}
else {
execOutput(pcalc);
}
}
/* check event list */
monitor(pcalc);
/* if no delay requested, finish processing */
if(!pcalc->dlya) {
/* process the forward scan link record */
recGblFwdLink(pcalc);
pcalc->pact = FALSE;
}
}
else {
execOutput(pcalc);
pcalc->dlya = 0;
db_post_events(pcalc,&pcalc->dlya,DBE_VALUE);
/* process the forward scan link record */
recGblFwdLink(pcalc);
pcalc->pact = FALSE;
}
return(0);
}
static long special(paddr,after)
struct dbAddr *paddr;
int after;
{
struct calcoutRecord *pcalc = (struct calcoutRecord *)(paddr->precord);
struct rpvtStruct *prpvt = (struct rpvtStruct *)pcalc->rpvt;
struct dbAddr *pAddr = 0;
short error_number;
char rpbuf[184];
int fieldIndex = dbGetFieldIndex(paddr);
int lnkIndex;
struct link *plink;
double *pvalue;
unsigned short *plinkValid;
if(!after) return(0);
switch(fieldIndex) {
case(calcoutRecordCALC):
pcalc->clcv=postfix(pcalc->calc,rpbuf,&error_number);
if(pcalc->clcv){
recGblRecordError(S_db_badField,(void *)pcalc,
"calcout: special(): Illegal CALC field");
}
else {
memcpy(pcalc->rpcl,rpbuf,sizeof(pcalc->rpcl));
}
db_post_events(pcalc,&pcalc->clcv,DBE_VALUE);
return(0);
break;
case(calcoutRecordOCAL):
pcalc->oclv=postfix(pcalc->ocal,rpbuf,&error_number);
if(pcalc->oclv){
recGblRecordError(S_db_badField,(void *)pcalc,
"calcout: special(): Illegal OCAL field");
}
else {
memcpy(pcalc->orpc,rpbuf,sizeof(pcalc->orpc));
}
db_post_events(pcalc,&pcalc->oclv,DBE_VALUE);
return(0);
break;
case(calcoutRecordINPA):
case(calcoutRecordINPB):
case(calcoutRecordINPC):
case(calcoutRecordINPD):
case(calcoutRecordINPE):
case(calcoutRecordINPF):
case(calcoutRecordINPG):
case(calcoutRecordINPH):
case(calcoutRecordINPI):
case(calcoutRecordINPJ):
case(calcoutRecordINPK):
case(calcoutRecordINPL):
case(calcoutRecordOUT):
lnkIndex = fieldIndex - calcoutRecordINPA;
plink = &pcalc->inpa + lnkIndex;
pvalue = &pcalc->a + lnkIndex;
plinkValid = &pcalc->inav + lnkIndex;
if (plink->type == CONSTANT) {
if(fieldIndex != calcoutRecordOUT) {
recGblInitConstantLink(plink,DBF_DOUBLE,pvalue);
db_post_events(pcalc,pvalue,DBE_VALUE);
}
*plinkValid = calcoutINAV_CON;
}
/* see if the PV resides on this ioc */
else if(!dbNameToAddr(plink->value.pv_link.pvname, pAddr)) {
*plinkValid = calcoutINAV_LOC;
}
/* pv is not on this ioc. Callback later for connection stat */
else {
*plinkValid = calcoutINAV_EXT_NC;
/* DO_CALLBACK, if not already scheduled */
if(!prpvt->wd_id_1_LOCK) {
wdStart(prpvt->wd_id_1, 30, (FUNCPTR)callbackRequest,
(int)(&prpvt->checkLinkCb));
prpvt->wd_id_1_LOCK = 1;
prpvt->caLinkStat = CA_LINKS_NOT_OK;
}
}
db_post_events(pcalc,plinkValid,DBE_VALUE);
return(0);
break;
default:
recGblDbaddrError(S_db_badChoice,paddr,"calc: special");
return(S_db_badChoice);
}
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
{
struct calcoutRecord *pcalc=(struct calcoutRecord *)paddr->precord;
strncpy(units,pcalc->egu,DB_UNITS_SIZE);
return(0);
}
static long get_precision(paddr,precision)
struct dbAddr *paddr;
long *precision;
{
struct calcoutRecord *pcalc=(struct calcoutRecord *)paddr->precord;
*precision = pcalc->prec;
if(paddr->pfield == (void *)&pcalc->val) return(0);
recGblGetPrec(paddr,precision);
return(0);
}
static long get_graphic_double(paddr,pgd)
struct dbAddr *paddr;
struct dbr_grDouble *pgd;
{
struct calcoutRecord *pcalc=(struct calcoutRecord *)paddr->precord;
if(paddr->pfield==(void *)&pcalc->val
|| paddr->pfield==(void *)&pcalc->hihi
|| paddr->pfield==(void *)&pcalc->high
|| paddr->pfield==(void *)&pcalc->low
|| paddr->pfield==(void *)&pcalc->lolo){
pgd->upper_disp_limit = pcalc->hopr;
pgd->lower_disp_limit = pcalc->lopr;
return(0);
}
if(paddr->pfield>=(void *)&pcalc->a && paddr->pfield<=(void *)&pcalc->l){
pgd->upper_disp_limit = pcalc->hopr;
pgd->lower_disp_limit = pcalc->lopr;
return(0);
}
if(paddr->pfield>=(void *)&pcalc->la && paddr->pfield<=(void *)&pcalc->ll){
pgd->upper_disp_limit = pcalc->hopr;
pgd->lower_disp_limit = pcalc->lopr;
return(0);
}
return(0);
}
static long get_control_double(paddr,pcd)
struct dbAddr *paddr;
struct dbr_ctrlDouble *pcd;
{
struct calcoutRecord *pcalc=(struct calcoutRecord *)paddr->precord;
if(paddr->pfield==(void *)&pcalc->val
|| paddr->pfield==(void *)&pcalc->hihi
|| paddr->pfield==(void *)&pcalc->high
|| paddr->pfield==(void *)&pcalc->low
|| paddr->pfield==(void *)&pcalc->lolo){
pcd->upper_ctrl_limit = pcalc->hopr;
pcd->lower_ctrl_limit = pcalc->lopr;
return(0);
}
if(paddr->pfield>=(void *)&pcalc->a && paddr->pfield<=(void *)&pcalc->l){
pcd->upper_ctrl_limit = pcalc->hopr;
pcd->lower_ctrl_limit = pcalc->lopr;
return(0);
}
if(paddr->pfield>=(void *)&pcalc->la && paddr->pfield<=(void *)&pcalc->ll){
pcd->upper_ctrl_limit = pcalc->hopr;
pcd->lower_ctrl_limit = pcalc->lopr;
return(0);
}
return(0);
}
static long get_alarm_double(paddr,pad)
struct dbAddr *paddr;
struct dbr_alDouble *pad;
{
struct calcoutRecord *pcalc=(struct calcoutRecord *)paddr->precord;
if(paddr->pfield==(void *)&pcalc->val){
pad->upper_alarm_limit = pcalc->hihi;
pad->upper_warning_limit = pcalc->high;
pad->lower_warning_limit = pcalc->low;
pad->lower_alarm_limit = pcalc->lolo;
} else recGblGetAlarmDouble(paddr,pad);
return(0);
}
static void alarm(pcalc)
struct calcoutRecord *pcalc;
{
double val;
float hyst, lalm, hihi, high, low, lolo;
unsigned short hhsv, llsv, hsv, lsv;
if(pcalc->udf == TRUE ){
recGblSetSevr(pcalc,UDF_ALARM,INVALID_ALARM);
return;
}
hihi = pcalc->hihi;
lolo = pcalc->lolo;
high = pcalc->high;
low = pcalc->low;
hhsv = pcalc->hhsv;
llsv = pcalc->llsv;
hsv = pcalc->hsv;
lsv = pcalc->lsv;
val = pcalc->val;
hyst = pcalc->hyst;
lalm = pcalc->lalm;
/* alarm condition hihi */
if (hhsv && (val >= hihi || ((lalm==hihi) && (val >= hihi-hyst)))){
if (recGblSetSevr(pcalc,HIHI_ALARM,pcalc->hhsv))
pcalc->lalm = hihi;
return;
}
/* alarm condition lolo */
if (llsv && (val <= lolo || ((lalm==lolo) && (val <= lolo+hyst)))){
if (recGblSetSevr(pcalc,LOLO_ALARM,pcalc->llsv))
pcalc->lalm = lolo;
return;
}
/* alarm condition high */
if (hsv && (val >= high || ((lalm==high) && (val >= high-hyst)))){
if (recGblSetSevr(pcalc,HIGH_ALARM,pcalc->hsv))
pcalc->lalm = high;
return;
}
/* alarm condition low */
if (lsv && (val <= low || ((lalm==low) && (val <= low+hyst)))){
if (recGblSetSevr(pcalc,LOW_ALARM,pcalc->lsv))
pcalc->lalm = low;
return;
}
/* we get here only if val is out of alarm by at least hyst */
pcalc->lalm = val;
return;
}
static void doOutputCallback(pcallback)
struct callback *pcallback;
{
dbCommon *pcalc;
struct rset *prset;
callbackGetUser(pcalc, pcallback);
prset = (struct rset *)pcalc->rset;
dbScanLock((struct dbCommon *)pcalc);
(*prset->process)(pcalc);
dbScanUnlock((struct dbCommon *)pcalc);
}
static void execOutput(pcalc)
struct calcoutRecord *pcalc;
{
long status;
/* Determine output data */
switch(pcalc->dopt) {
case(calcoutDOPT_Use_VAL):
pcalc->oval = pcalc->val;
break;
case(calcoutDOPT_Use_OVAL):
if(!pcalc->oclv) {
if(calcPerform(&pcalc->a,&pcalc->oval,pcalc->orpc)) {
recGblSetSevr(pcalc,CALC_ALARM,INVALID_ALARM);
}
}
else
recGblSetSevr(pcalc,CALC_ALARM,INVALID_ALARM);
break;
}
/* Check to see what to do if INVALID */
if (pcalc->sevr < INVALID_ALARM ) {
/* Output the value */
status=dbPutLink(&(pcalc->out), DBR_DOUBLE,&(pcalc->oval),1);
/* post event if output event != 0 */
if(pcalc->oevt > 0) {
post_event((int)pcalc->oevt);
}
}
else {
switch (pcalc->ivoa) {
case (menuIvoaContinue_normally) :
/* write the new value */
status=dbPutLink(&(pcalc->out), DBR_DOUBLE,
&(pcalc->oval),1);
/* post event if output event != 0 */
if(pcalc->oevt > 0) {
post_event((int)pcalc->oevt);
}
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
pcalc->oval=pcalc->ivov;
status=dbPutLink(&(pcalc->out), DBR_DOUBLE,
&(pcalc->oval),1);
/* post event if output event != 0 */
if(pcalc->oevt > 0) {
post_event((int)pcalc->oevt);
}
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)pcalc,
"calcout:process Illegal IVOA field");
}
}
}
static void monitor(pcalc)
struct calcoutRecord *pcalc;
{
unsigned short monitor_mask;
double delta;
double *pnew;
double *pprev;
int i;
monitor_mask = recGblResetAlarms(pcalc);
/* check for value change */
delta = pcalc->mlst - pcalc->val;
if(delta<0.0) delta = -delta;
if (delta > pcalc->mdel) {
/* post events for value change */
monitor_mask |= DBE_VALUE;
/* update last value monitored */
pcalc->mlst = pcalc->val;
}
/* check for archive change */
delta = pcalc->alst - pcalc->val;
if(delta<0.0) delta = -delta;
if (delta > pcalc->adel) {
/* post events on value field for archive change */
monitor_mask |= DBE_LOG;
/* update last archive value monitored */
pcalc->alst = pcalc->val;
}
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(pcalc,&pcalc->val,monitor_mask);
}
/* check all input fields for changes*/
for(i=0, pnew=&pcalc->a, pprev=&pcalc->la; i<ARG_MAX;
i++, pnew++, pprev++) {
if((*pnew != *pprev) || (monitor_mask&DBE_ALARM)) {
db_post_events(pcalc,pnew,monitor_mask|DBE_VALUE|DBE_LOG);
*pprev = *pnew;
}
}
/* Check OVAL field */
if(pcalc->povl != pcalc->oval) {
db_post_events(pcalc,&pcalc->oval, monitor_mask|DBE_VALUE|DBE_LOG);
pcalc->povl = pcalc->oval;
}
return;
}
static int fetch_values(pcalc)
struct calcoutRecord *pcalc;
{
struct link *plink; /* structure of the link field */
double *pvalue;
long status = 0;
int i;
for(i=0, plink=&pcalc->inpa, pvalue=&pcalc->a; i<ARG_MAX;
i++, plink++, pvalue++) {
status = dbGetLink(plink,DBR_DOUBLE, pvalue,0,0);
if (!RTN_SUCCESS(status)) return(status);
}
return(0);
}
static void checkLinksCallback(pcallback)
struct callback *pcallback;
{
struct calcoutRecord *pcalc;
struct rpvtStruct *prpvt;
callbackGetUser(pcalc, pcallback);
prpvt = (struct rpvtStruct *)pcalc->rpvt;
dbScanLock((struct dbCommon *)pcalc);
prpvt->wd_id_1_LOCK = 0;
checkLinks(pcalc);
dbScanUnlock((struct dbCommon *)pcalc);
}
static void checkLinks(pcalc)
struct calcoutRecord *pcalc;
{
struct link *plink;
struct rpvtStruct *prpvt = (struct rpvtStruct *)pcalc->rpvt;
int i;
int stat;
int caLink = 0;
int caLinkNc = 0;
unsigned short *plinkValid;
if(calcoutRecDebug) printf("checkLinks() for %p\n", pcalc);
plink = &pcalc->inpa;
plinkValid = &pcalc->inav;
for(i=0; i<ARG_MAX+1; i++, plink++, plinkValid++) {
if (plink->type == CA_LINK) {
caLink = 1;
stat = dbCaIsLinkConnected(plink);
if(!stat && (*plinkValid == calcoutINAV_EXT_NC)) {
caLinkNc = 1;
}
else if(!stat && (*plinkValid == calcoutINAV_EXT)) {
*plinkValid = calcoutINAV_EXT_NC;
db_post_events(pcalc,plinkValid,DBE_VALUE);
caLinkNc = 1;
}
else if(stat && (*plinkValid == calcoutINAV_EXT_NC)) {
*plinkValid = calcoutINAV_EXT;
db_post_events(pcalc,plinkValid,DBE_VALUE);
}
}
}
if(caLinkNc)
prpvt->caLinkStat = CA_LINKS_NOT_OK;
else if(caLink)
prpvt->caLinkStat = CA_LINKS_ALL_OK;
else
prpvt->caLinkStat = NO_CA_LINKS;
if(!prpvt->wd_id_1_LOCK && caLinkNc) {
/* Schedule another CALLBACK */
prpvt->wd_id_1_LOCK = 1;
wdStart(prpvt->wd_id_1, 30, (FUNCPTR)callbackRequest,
(int)(&prpvt->checkLinkCb));
}
}
+577
View File
@@ -0,0 +1,577 @@
menu(calcoutOOPT) {
choice(calcoutOOPT_Every_Time,"Every Time")
choice(calcoutOOPT_On_Change,"On Change")
choice(calcoutOOPT_When_Zero,"When Zero")
choice(calcoutOOPT_When_Non_zero,"When Non-zero")
choice(calcoutOOPT_Transition_To_Zero,"Transition To Zero")
choice(calcoutOOPT_Transition_To_Non_zero,"Transition To Non-zero")
}
menu(calcoutDOPT) {
choice(calcoutDOPT_Use_VAL,"Use CALC")
choice(calcoutDOPT_Use_OVAL,"Use OCAL")
}
menu(calcoutINAP) {
choice(calcoutINAP_No,"No PROC on Change")
choice(calcoutINAP_Yes,"PROC on Change")
}
menu(calcoutINAV) {
choice(calcoutINAV_EXT_NC,"Ext PV NC")
choice(calcoutINAV_EXT,"Ext PV OK")
choice(calcoutINAV_LOC,"Local PV")
choice(calcoutINAV_CON,"Constant")
}
recordtype(calcout) {
include "dbCommon.dbd"
field(VERS,DBF_FLOAT) {
prompt("Code Version")
special(SPC_NOMOD)
initial("1")
}
field(RPVT,DBF_NOACCESS) {
prompt("Record Private")
special(SPC_NOMOD)
interest(4)
size(4)
extra("void * rpvt")
}
field(VAL,DBF_DOUBLE) {
prompt("Result")
asl(ASL0)
}
field(PVAL,DBF_DOUBLE) {
prompt("Previous Value")
}
field(CALC,DBF_STRING) {
prompt("Calculation")
promptgroup(GUI_CALC)
special(SPC_CALC)
pp(TRUE)
size(36)
}
field(CLCV,DBF_LONG) {
prompt("CALC Valid")
interest(1)
}
field(INPA,DBF_INLINK) {
prompt("Input A")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPB,DBF_INLINK) {
prompt("Input B")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPC,DBF_INLINK) {
prompt("Input C")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPD,DBF_INLINK) {
prompt("Input D")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPE,DBF_INLINK) {
prompt("Input E")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPF,DBF_INLINK) {
prompt("Input F")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPG,DBF_INLINK) {
prompt("Input G")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPH,DBF_INLINK) {
prompt("Input H")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPI,DBF_INLINK) {
prompt("Input I")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPJ,DBF_INLINK) {
prompt("Input J")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPK,DBF_INLINK) {
prompt("Input K")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(INPL,DBF_INLINK) {
prompt("Input L")
special(SPC_MOD)
promptgroup(GUI_CALC)
interest(1)
}
field(OUT,DBF_OUTLINK) {
prompt("Output Specification")
special(SPC_MOD)
promptgroup(GUI_OUTPUT)
interest(1)
}
field(INAV,DBF_MENU) {
prompt("INPA PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INBV,DBF_MENU) {
prompt("INPB PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INCV,DBF_MENU) {
prompt("INPC PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INDV,DBF_MENU) {
prompt("INPD PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INEV,DBF_MENU) {
prompt("INPE PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INFV,DBF_MENU) {
prompt("INPF PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INGV,DBF_MENU) {
prompt("INPG PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INHV,DBF_MENU) {
prompt("INPH PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INIV,DBF_MENU) {
prompt("INPI PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INJV,DBF_MENU) {
prompt("INPJ PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INKV,DBF_MENU) {
prompt("INPK PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INLV,DBF_MENU) {
prompt("INPL PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(OUTV,DBF_MENU) {
prompt("OUT PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
}
# Haven't figured out how to do this yet ...
# field(INAP,DBF_MENU) {
# prompt("INPA causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INBP,DBF_MENU) {
# prompt("INPB causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INCP,DBF_MENU) {
# prompt("INPC causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INDP,DBF_MENU) {
# prompt("INPD causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INEP,DBF_MENU) {
# prompt("INPE causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INFP,DBF_MENU) {
# prompt("INPF causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INGP,DBF_MENU) {
# prompt("INPG causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INHP,DBF_MENU) {
# prompt("INPH causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INIP,DBF_MENU) {
# prompt("INPI causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
# field(INJP,DBF_MENU) {
# prompt("INPJ causes PROC")
# promptgroup(GUI_CALC)
# interest(1)
# menu(calcoutINAP)
# initial("0")
# }
field(OOPT,DBF_MENU) {
prompt("Output Execute Opt")
promptgroup(GUI_CALC)
interest(1)
menu(calcoutOOPT)
}
field(ODLY,DBF_FLOAT) {
prompt("Output Execute Delay")
promptgroup(GUI_ALARMS)
asl(ASL0)
interest(1)
}
field(DLYA,DBF_USHORT) {
prompt("Output Delay Active")
special(SPC_NOMOD)
asl(ASL0)
}
field(DOPT,DBF_MENU) {
prompt("Output Data Opt")
promptgroup(GUI_CALC)
interest(1)
menu(calcoutDOPT)
}
field(OCAL,DBF_STRING) {
prompt("Output Calculation")
promptgroup(GUI_CALC)
special(SPC_CALC)
pp(TRUE)
size(36)
}
field(OCLV,DBF_LONG) {
prompt("OCAL Valid")
interest(1)
}
field(OEVT,DBF_USHORT) {
prompt("Event To Issue")
promptgroup(GUI_CLOCK)
asl(ASL0)
}
field(IVOA,DBF_MENU) {
prompt("INVALID output action")
promptgroup(GUI_OUTPUT)
interest(2)
menu(menuIvoa)
}
field(IVOV,DBF_DOUBLE) {
prompt("INVALID output value")
promptgroup(GUI_OUTPUT)
interest(2)
}
field(EGU,DBF_STRING) {
prompt("Units Name")
promptgroup(GUI_DISPLAY)
interest(1)
size(16)
}
field(PREC,DBF_SHORT) {
prompt("Display Precision")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(HOPR,DBF_FLOAT) {
prompt("High Operating Rng")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(LOPR,DBF_FLOAT) {
prompt("Low Operating Range")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(HIHI,DBF_FLOAT) {
prompt("Hihi Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
}
field(LOLO,DBF_FLOAT) {
prompt("Lolo Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
}
field(HIGH,DBF_FLOAT) {
prompt("High Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
}
field(LOW,DBF_FLOAT) {
prompt("Low Alarm Limit")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
}
field(HHSV,DBF_MENU) {
prompt("Hihi Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
menu(menuAlarmSevr)
}
field(LLSV,DBF_MENU) {
prompt("Lolo Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
menu(menuAlarmSevr)
}
field(HSV,DBF_MENU) {
prompt("High Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
menu(menuAlarmSevr)
}
field(LSV,DBF_MENU) {
prompt("Low Severity")
promptgroup(GUI_ALARMS)
pp(TRUE)
interest(1)
menu(menuAlarmSevr)
}
field(HYST,DBF_DOUBLE) {
prompt("Alarm Deadband")
promptgroup(GUI_ALARMS)
interest(1)
}
field(ADEL,DBF_DOUBLE) {
prompt("Archive Deadband")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(MDEL,DBF_DOUBLE) {
prompt("Monitor Deadband")
promptgroup(GUI_DISPLAY)
interest(1)
}
field(A,DBF_DOUBLE) {
prompt("Value of Input A")
pp(TRUE)
}
field(B,DBF_DOUBLE) {
prompt("Value of Input B")
pp(TRUE)
}
field(C,DBF_DOUBLE) {
prompt("Value of Input C")
pp(TRUE)
}
field(D,DBF_DOUBLE) {
prompt("Value of Input D")
pp(TRUE)
}
field(E,DBF_DOUBLE) {
prompt("Value of Input E")
pp(TRUE)
}
field(F,DBF_DOUBLE) {
prompt("Value of Input F")
pp(TRUE)
}
field(G,DBF_DOUBLE) {
prompt("Value of Input G")
pp(TRUE)
}
field(H,DBF_DOUBLE) {
prompt("Value of Input H")
pp(TRUE)
}
field(I,DBF_DOUBLE) {
prompt("Value of Input I")
pp(TRUE)
}
field(J,DBF_DOUBLE) {
prompt("Value of Input J")
pp(TRUE)
}
field(K,DBF_DOUBLE) {
prompt("Value of Input K")
pp(TRUE)
}
field(L,DBF_DOUBLE) {
prompt("Value of Input L")
pp(TRUE)
}
field(OVAL,DBF_DOUBLE) {
prompt("Output Value")
asl(ASL0)
}
field(LA,DBF_DOUBLE) {
prompt("Prev Value of A")
special(SPC_NOMOD)
interest(3)
}
field(LB,DBF_DOUBLE) {
prompt("Prev Value of B")
special(SPC_NOMOD)
interest(3)
}
field(LC,DBF_DOUBLE) {
prompt("Prev Value of C")
special(SPC_NOMOD)
interest(3)
}
field(LD,DBF_DOUBLE) {
prompt("Prev Value of D")
special(SPC_NOMOD)
interest(3)
}
field(LE,DBF_DOUBLE) {
prompt("Prev Value of E")
special(SPC_NOMOD)
interest(3)
}
field(LF,DBF_DOUBLE) {
prompt("Prev Value of F")
special(SPC_NOMOD)
interest(3)
}
field(LG,DBF_DOUBLE) {
prompt("Prev Value of G")
special(SPC_NOMOD)
interest(3)
}
field(LH,DBF_DOUBLE) {
prompt("Prev Value of H")
special(SPC_NOMOD)
interest(3)
}
field(LI,DBF_DOUBLE) {
prompt("Prev Value of I")
special(SPC_NOMOD)
interest(3)
}
field(LJ,DBF_DOUBLE) {
prompt("Prev Value of J")
special(SPC_NOMOD)
interest(3)
}
field(LK,DBF_DOUBLE) {
prompt("Prev Value of K")
special(SPC_NOMOD)
interest(3)
}
field(LL,DBF_DOUBLE) {
prompt("Prev Value of L")
special(SPC_NOMOD)
interest(3)
}
field(POVL,DBF_DOUBLE) {
prompt("Prev Value of OVAL")
asl(ASL0)
}
field(LALM,DBF_DOUBLE) {
prompt("Last Value Alarmed")
special(SPC_NOMOD)
interest(3)
}
field(ALST,DBF_DOUBLE) {
prompt("Last Value Archived")
special(SPC_NOMOD)
interest(3)
}
field(MLST,DBF_DOUBLE) {
prompt("Last Val Monitored")
special(SPC_NOMOD)
interest(3)
}
field(RPCL,DBF_NOACCESS) {
prompt("Reverse Polish Calc")
special(SPC_NOMOD)
interest(4)
size(184)
extra("char rpcl[184]")
}
field(ORPC,DBF_NOACCESS) {
prompt("Reverse Polish OCalc")
special(SPC_NOMOD)
interest(4)
size(184)
extra("char orpc[184]")
}
}
+2
View File
@@ -66,7 +66,9 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbStaticLib.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <special.h>
+2 -12
View File
@@ -22,6 +22,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -37,7 +38,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -96,7 +97,6 @@ static long process(pdfanout)
struct dfanoutRecord *pdfanout;
{
long status=0;
unsigned char pact=pdfanout->pact;
if (!pdfanout->pact && pdfanout->omsl == CLOSED_LOOP){
status = dbGetLink(&(pdfanout->dol),DBR_LONG,&(pdfanout->val),0,0);
@@ -112,16 +112,6 @@ static long process(pdfanout)
pdfanout->pact=FALSE;
return(status);
}
static long get_value(pdfanout,pvdes)
struct dfanoutRecord *pdfanout;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_LONG;
pvdes->no_elements=1;
(long *)(pvdes->pvalue) = &pdfanout->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
+3 -14
View File
@@ -62,6 +62,7 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -83,7 +84,7 @@ STATIC void EgMonitor(struct egRecord *pRec);
STATIC long EgInitRec(struct egRecord *, int);
STATIC long EgProc(struct egRecord *);
#define special NULL
STATIC long EgGetValue();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -103,7 +104,7 @@ struct rset egRSET={
EgInitRec,
EgProc,
special,
EgGetValue,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
@@ -172,18 +173,6 @@ STATIC long EgProc(struct egRecord *pRec)
pRec->pact=FALSE;
return(0);
}
/******************************************************************************
*
* Value fields are worthless.
*
******************************************************************************/
STATIC long EgGetValue(struct egRecord *pRec, struct valueDes *pvdes)
{
pvdes->field_type = DBF_CHAR;
pvdes->no_elements=1;
(char *)(pvdes->pvalue) = pRec->val;
return(0);
}
/******************************************************************************
*
+3 -15
View File
@@ -61,6 +61,7 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -82,7 +83,7 @@ STATIC void EgEventMonitor(struct egeventRecord *pRec);
STATIC long EgEventInitRec(struct egeventRecord *, int);
STATIC long EgEventProc(struct egeventRecord *);
#define special NULL
STATIC long EgEventGetValue();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -102,7 +103,7 @@ struct rset egeventRSET={
EgEventInitRec,
EgEventProc,
special,
EgEventGetValue,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
@@ -168,18 +169,6 @@ STATIC long EgEventProc(struct egeventRecord *pRec)
pRec->pact=FALSE;
return(0);
}
/******************************************************************************
*
* Value fields are worthless.
*
******************************************************************************/
STATIC long EgEventGetValue(struct egeventRecord *pRec, struct valueDes *pvdes)
{
pvdes->field_type = DBF_CHAR;
pvdes->no_elements=1;
(char *)(pvdes->pvalue) = pRec->val;
return(0);
}
/******************************************************************************
*
@@ -253,7 +242,6 @@ static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd)
static long get_alarm_double(struct dbAddr *paddr, struct dbr_alDouble *pad)
{
struct egeventRecord *pRec=(struct egeventRecord *)paddr->precord;
#if 0
{
pad->upper_alarm_limit = 2;
+3 -16
View File
@@ -61,6 +61,7 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -82,7 +83,7 @@ STATIC void ErMonitor(struct erRecord *pRec);
STATIC long ErInitRec(struct erRecord *, int);
STATIC long ErProc(struct erRecord *);
#define ErSpecial NULL
STATIC long ErGetValue();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -102,7 +103,7 @@ struct rset erRSET={
ErInitRec,
ErProc,
ErSpecial,
ErGetValue,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
@@ -208,19 +209,6 @@ STATIC long ErSpecial(struct dbAddr *paddr, int after)
return(0);
}
#endif
/******************************************************************************
*
* Value fields are worthless.
*
******************************************************************************/
STATIC long ErGetValue(struct erRecord *pRec, struct valueDes *pvdes)
{
pvdes->field_type = DBF_CHAR;
pvdes->no_elements=1;
(char *)(pvdes->pvalue) = pRec->val;
return(0);
}
/******************************************************************************
*
* Post any events for fields that might have changed while processing.
@@ -293,7 +281,6 @@ static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd)
static long get_alarm_double(struct dbAddr *paddr, struct dbr_alDouble *pad)
{
struct erRecord *pRec=(struct erRecord *)paddr->precord;
#if 0
{
pad->upper_alarm_limit = 2;
+3 -14
View File
@@ -61,6 +61,7 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -81,7 +82,7 @@ STATIC void ErEventMonitor(struct ereventRecord *pRec);
STATIC long ErEventInitRec(struct ereventRecord *, int);
STATIC long ErEventProc(struct ereventRecord *);
#define special NULL
STATIC long ErEventGetValue();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -101,7 +102,7 @@ struct rset ereventRSET={
ErEventInitRec,
ErEventProc,
special,
ErEventGetValue,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
@@ -166,18 +167,6 @@ STATIC long ErEventProc(struct ereventRecord *pRec)
pRec->pact=FALSE;
return(0);
}
/******************************************************************************
*
* Value fields are worthless.
*
******************************************************************************/
STATIC long ErEventGetValue(struct ereventRecord *pRec, struct valueDes *pvdes)
{
pvdes->field_type = DBF_CHAR;
pvdes->no_elements=1;
(char *)(pvdes->pvalue) = pRec->val;
return(0);
}
/******************************************************************************
*
+1
View File
@@ -46,6 +46,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbScan.h>
#include <dbFldTypes.h>
#include <devSup.h>
+1 -4
View File
@@ -55,6 +55,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
@@ -107,7 +108,6 @@ static long init_record(pfanout,pass)
struct fanoutRecord *pfanout;
int pass;
{
long status;
if (pass==0) return(0);
recGblInitConstantLink(&pfanout->sell,DBF_USHORT,&pfanout->seln);
@@ -117,12 +117,9 @@ static long init_record(pfanout,pass)
static long process(pfanout)
struct fanoutRecord *pfanout;
{
unsigned short stat,sevr,nsta,nsev;
struct link *plink;
unsigned short state;
short i;
long status=0;
unsigned short monitor_mask;
pfanout->pact = TRUE;
+2 -15
View File
@@ -46,6 +46,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
@@ -59,7 +60,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -98,10 +99,6 @@ static long fetch_values();
static void monitor();
#define ARG_MAX 6
/* Fldnames should have as many as ARG_MAX */
static char *Fldnames[ARG_MAX] =
{"A", "B", "C", "D", "E", "F"};
static long init_record(psub,pass)
struct gsubRecord *psub;
@@ -183,16 +180,6 @@ static long process(psub)
return(0);
}
static long get_value(psub,pvdes)
struct gsubRecord *psub;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_FLOAT;
pvdes->no_elements=1;
(float *)(pvdes->pvalue) = &psub->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
+4 -13
View File
@@ -54,6 +54,8 @@
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <epicsPrint.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -69,7 +71,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
static long cvt_dbaddr();
static long get_array_info();
#define put_array_info NULL
@@ -184,7 +186,7 @@ static long init_record(phistogram,pass)
pcallback->callback = wdCallback;
pcallback->priority = priorityLow;
if(dbNameToAddr(phistogram->name,&(pcallback->dbAddr))) {
logMsg("dbNameToAddr failed in init_record for recHistogram\n");
epicsPrintf("dbNameToAddr failed in init_record for recHistogram\n");
exit(1);
}
pcallback->wd_id = wdCreate();
@@ -306,17 +308,6 @@ static void monitor(phistogram)
return;
}
static long get_value(phistogram,pvdes)
struct histogramRecord *phistogram;
struct valueDes *pvdes;
{
pvdes->no_elements=phistogram->nelm;
(unsigned long *)(pvdes->pvalue) = phistogram->bptr;
pvdes->field_type = DBF_ULONG;
return(0);
}
static long cvt_dbaddr(paddr)
struct dbAddr *paddr;
{
+2 -12
View File
@@ -54,6 +54,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -68,7 +69,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -179,17 +180,6 @@ static long process(plongin)
plongin->pact=FALSE;
return(status);
}
static long get_value(plongin,pvdes)
struct longinRecord *plongin;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_LONG;
pvdes->no_elements=1;
(long *)(pvdes->pvalue) = &plongin->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
+1
View File
@@ -52,6 +52,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
+3 -12
View File
@@ -43,6 +43,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -58,7 +59,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -111,7 +112,7 @@ static void refresh_bits(pmbbiDirect)
struct mbbiDirectRecord *pmbbiDirect;
{
int i, mask = 1;
char *bit;
unsigned char *bit;
bit = &(pmbbiDirect->b0);
for (i=0; i<NUM_BITS; i++, mask = mask << 1, bit++) {
@@ -215,16 +216,6 @@ static long process(pmbbiDirect)
return(status);
}
static long get_value(pmbbiDirect,pvdes)
struct mbbiDirectRecord *pmbbiDirect;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_USHORT;
pvdes->no_elements=1;
(unsigned short *)(pvdes->pvalue) = &pmbbiDirect->val;
return(0);
}
static void monitor(pmbbiDirect)
struct mbbiDirectRecord *pmbbiDirect;
{
+1
View File
@@ -63,6 +63,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
+4 -13
View File
@@ -43,6 +43,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -58,7 +59,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -206,7 +207,7 @@ static long special(paddr,after)
{
struct mbboDirectRecord *pmbboDirect = (struct mbboDirectRecord *)(paddr->precord);
int special_type = paddr->special, offset = 1, i;
char *bit;
unsigned char *bit;
if(!after) return(0);
switch(special_type) {
@@ -254,16 +255,6 @@ static long special(paddr,after)
}
}
static long get_value(pmbboDirect,pvdes)
struct mbboDirectRecord *pmbboDirect;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_USHORT;
pvdes->no_elements=1;
(unsigned short *)(pvdes->pvalue) = &pmbboDirect->val;
return(0);
}
static void monitor(pmbboDirect)
struct mbboDirectRecord *pmbboDirect;
{
@@ -272,7 +263,7 @@ static void monitor(pmbboDirect)
monitor_mask = recGblResetAlarms(pmbboDirect);
monitor_mask |= (DBE_LOG|DBE_VALUE);
if(monitor_mask)
db_post_events(pmbboDirect,pmbboDirect->val,monitor_mask);
db_post_events(pmbboDirect,&pmbboDirect->val,monitor_mask);
/* check for value change */
if (pmbboDirect->mlst != pmbboDirect->val){
+4 -11
View File
@@ -70,6 +70,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -86,7 +87,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -219,6 +220,8 @@ static long init_record(pmbbo,pass)
} else if (status==2) status=0;
}
init_common(pmbbo);
/* convert val to rval */
convert(pmbbo);
return(0);
}
@@ -315,16 +318,6 @@ static long special(paddr,after)
}
}
static long get_value(pmbbo,pvdes)
struct mbboRecord *pmbbo;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_ENUM;
pvdes->no_elements=1;
(unsigned short *)(pvdes->pvalue) = &pmbbo->val;
return(0);
}
static long get_enum_str(paddr,pstring)
struct dbAddr *paddr;
char *pstring;
+9 -24
View File
@@ -41,9 +41,11 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
#include <pal.h>
#include <special.h>
#define GEN_SIZE_OFFSET
#include <palRecord.h>
@@ -55,7 +57,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -94,9 +96,6 @@ struct pal * palinit();
#define ARG_MAX 12
/* Fldnames should have as many as ARG_MAX */
static char *Fldnames[ARG_MAX] =
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
#define OUT_MAX 12
@@ -104,12 +103,9 @@ static long init_record(ppal,pass)
struct palRecord *ppal;
int pass;
{
long status;
struct link *plink;
int i;
double *pvalue;
short error_number;
char rpbuf[184];
if (pass==0) return(0);
@@ -130,14 +126,15 @@ static long process(ppal)
{
unsigned char *temp;
int i;
double *tptr;
unsigned int result = 0;
ppal->pact = TRUE;
if (fetch_values(ppal)==0)
{
if(pal(ppal->pptr,&ppal->a,12,&ppal->val))
printf("palrec - error, pptr = %x\n",ppal->pptr);
if(pal(ppal->pptr,&ppal->a,12,&result))
printf("palrec - error, pptr = %p\n",ppal->pptr);
ppal->val = result;
ppal->udf = FALSE;
}
for (i = 0, temp = &ppal->q0; i < OUT_MAX; i++, temp++)
@@ -155,16 +152,6 @@ static long process(ppal)
return(0);
}
static long get_value(ppal,pvdes)
struct palRecord *ppal;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_ULONG;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &ppal->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
@@ -191,8 +178,6 @@ static void monitor(ppal)
struct palRecord *ppal;
{
unsigned short monitor_mask;
double delta;
short stat,sevr,nsta,nsev;
double *pnew;
double *pprev;
int i;
@@ -229,9 +214,9 @@ static int fetch_values(ppal)
struct palRecord *ppal;
{
struct link *plink; /* structure of the link field */
double *pvalue,sval;
double *pvalue;
long status;
int i,j;
int i;
for(i=0, plink=&ppal->inpa, pvalue=&ppal->a; i<ARG_MAX; i++, plink++, pvalue++) {
+2 -12
View File
@@ -44,6 +44,7 @@
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
@@ -57,7 +58,7 @@
#define init_record NULL
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -104,17 +105,6 @@ static long process(ppermissive)
ppermissive->pact=FALSE;
return(0);
}
static long get_value(ppermissive,pvdes)
struct permissiveRecord *ppermissive;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_USHORT;
pvdes->no_elements=1;
(unsigned short *)(pvdes->pvalue) = &(ppermissive->val);
return(0);
}
static void monitor(ppermissive)
struct permissiveRecord *ppermissive;
+1
View File
@@ -55,6 +55,7 @@ unsigned long tickGet();
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
+16 -17
View File
@@ -39,13 +39,15 @@
*/
#include <vxWorks.h>
#include <types.h>
#include <stdioLib.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <lstLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -61,7 +63,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -124,12 +126,15 @@ struct callback {
void callbackRequest();
static void myCallback(struct callback *pcallback)
static void myCallback(CALLBACK *p)
{
struct callback *pcallback;
struct pulseCounterRecord *pc;
struct rset *prset;
struct pulseCounterRecord *pc=(struct pulseCounterRecord *)pcallback->precord;
struct rset *prset=(struct rset *)(pc->rset);
callbackGetUser(pcallback,p);
pc=(struct pulseCounterRecord *)pcallback->precord;
prset=(struct rset *)(pc->rset);
dbScanLock((struct dbCommon *)pc);
(*prset->process)(pc);
dbScanUnlock((struct dbCommon *)pc);
@@ -163,7 +168,9 @@ static long init_record(struct pulseCounterRecord *ppc, int pass)
}
pcallback=(struct callback *)malloc(sizeof(struct callback));
callbackSetCallback(myCallback,(CALLBACK *)pcallback);
callbackSetCallback(myCallback,&pcallback->callback);
callbackSetPriority(ppc->prio,&pcallback->callback);
callbackSetUser(pcallback,&pcallback->callback);
pcallback->precord=(struct dbCommon *)ppc;
/* call device support init_record */
@@ -217,7 +224,7 @@ static long process(struct pulseCounterRecord *ppc)
if(ppc->pact==TRUE)
{
callbackRequest((CALLBACK *)pcallback);
callbackRequest(&pcallback->callback);
return(0);
}
}
@@ -258,14 +265,6 @@ static long process(struct pulseCounterRecord *ppc)
return(status);
}
static long get_value(struct pulseCounterRecord *ppc, struct valueDes *pvdes)
{
pvdes->field_type = DBF_ULONG;
pvdes->no_elements=1;
(short *)pvdes->pvalue = &ppc->val;
return(0);
}
static long get_graphic_double(struct dbAddr *paddr, struct dbr_grDouble *pgd)
{
struct pulseCounterRecord *ppc=(struct pulseCounterRecord *)paddr->precord;
+3 -11
View File
@@ -49,6 +49,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -71,7 +72,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -205,15 +206,6 @@ static long process(ppd)
return(0);
}
static long get_value(ppd,pvdes)
struct pulseDelayRecord *ppd;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_SHORT;
pvdes->no_elements=1;
(short *)pvdes->pvalue = &ppd->val;
return(0);
}
static long get_precision(paddr,precision)
struct dbAddr *paddr;
long *precision;
@@ -321,7 +313,7 @@ static long put_enum_str(struct dbAddr *paddr,char *p)
if(paddr->pfield==(void *)&ppd->hts)
{
if(sscanf(p,"%i",&ppd->hts)<=0)
if(sscanf(p,"%hu",&ppd->hts)<=0)
return(S_db_badChoice);
}
else
+2 -10
View File
@@ -52,6 +52,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -66,7 +67,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -211,15 +212,6 @@ static long process(ppt)
return(0);
}
static long get_value(ppt,pvdes)
struct pulseTrainRecord *ppt;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_SHORT;
pvdes->no_elements=1;
(short *)pvdes->pvalue = &ppt->val;
return(0);
}
static long get_precision(paddr,precision)
struct dbAddr *paddr;
long *precision;
+3 -5
View File
@@ -21,6 +21,7 @@ of this distribution.
#include <sysLib.h>
#include <dbDefs.h>
#include <epicsPrint.h>
#include <taskwd.h>
#include <fast_lock.h>
#include <db_access.h>
@@ -58,9 +59,6 @@ of this distribution.
#define newDBR_DOUBLE newDBF_DOUBLE
#define newDBR_ENUM newDBF_ENUM
#define VALID_newDB_REQ(x) ((x >= 0) && (x <= newDBR_ENUM))
static short mapOldToNew[DBF_DOUBLE+1] = {
newDBR_STRING,newDBR_SHORT,newDBR_FLOAT,newDBR_ENUM,
newDBR_CHAR,newDBR_LONG,newDBR_DOUBLE};
static short mapNewToOld[newDBR_ENUM+1] = {
DBF_STRING,DBF_CHAR,DBF_CHAR,DBF_SHORT,DBF_SHORT,
DBF_LONG,DBF_LONG,DBF_FLOAT,DBF_DOUBLE,DBF_ENUM};
@@ -71,8 +69,8 @@ int recDynLinkQsize = 256;
LOCAL int inpTaskId=0;
LOCAL int outTaskId=0;
LOCAL RING_ID inpRingQ;;
LOCAL RING_ID outRingQ;;
LOCAL RING_ID inpRingQ;
LOCAL RING_ID outRingQ;
LOCAL SEM_ID wakeUpSem;
typedef enum{cmdSearch,cmdClear,cmdPut} cmdType;
+4 -2
View File
@@ -27,7 +27,7 @@ extern int interruptAccept;
int recWaitCaQsize = 256;
LOCAL int taskid=0;
LOCAL RING_ID ringQ;;
LOCAL RING_ID ringQ;
LOCAL FAST_LOCK lock;
typedef enum {cmdNone,cmdAdd,cmdRemove} COMMAND;
@@ -45,7 +45,7 @@ void recWaitCaTask(void);
LOCAL void eventCallback(struct event_handler_args eha)
{
struct dbr_sts_double *pdata = eha.dbr;
const struct dbr_sts_double *pdata = eha.dbr;
CAPVT *pcapvt;
RECWAITCA *pcamonitor;
@@ -84,6 +84,7 @@ long recWaitCaAdd(RECWAITCA *pcamonitor)
if(rngBufPut(ringQ,(void *)&pcapvt,sizeof(pcapvt))
!=sizeof(pcamonitor)) errMessage(0,"recWaitCaAdd: rngBufPut error");
FASTUNLOCK(&lock);
return(0);
}
long recWaitCaDelete(RECWAITCA *pcamonitor)
@@ -95,6 +96,7 @@ long recWaitCaDelete(RECWAITCA *pcamonitor)
if(rngBufPut(ringQ,(void *)&pcapvt,sizeof(pcapvt))
!=sizeof(pcamonitor)) errMessage(0,"recWaitCaDelete: rngBufPut error");
FASTUNLOCK(&lock);
return(0);
}
/*LOCAL */
+24 -47
View File
@@ -124,10 +124,12 @@
#include <semLib.h>
#include <taskLib.h>
#include <wdLib.h>
#include <sysLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbScan.h>
#include <dbDefs.h>
#include <dbFldTypes.h>
@@ -229,7 +231,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
static long cvt_dbaddr();
static long get_array_info();
static long put_array_info();
@@ -397,7 +399,6 @@ static void previewScan(struct scanRecord *pscan);
static void lookupPV(struct scanRecord *pscan, unsigned short i);
static void checkConnections(struct scanRecord *pscan);
static void pvSearchCallback(recDynLink *precDynLink);
static void pvMonitorCallback(recDynLink *precDynLink);
static void posMonCallback(recDynLink *precDynLink);
static void restorePosParms(struct scanRecord *pscan, unsigned short i);
static void savePosParms(struct scanRecord *pscan, unsigned short i);
@@ -416,7 +417,6 @@ static long init_record(pscan,pass)
recPvtStruct *precPvt = (recPvtStruct *)pscan->rpvt;
posFields *pPosFields;
detFields *pDetFields;
long status = 0;
char *ppvn[PVN_SIZE];
unsigned short *pPvStat;
@@ -638,7 +638,7 @@ static long special(paddr,after)
/* postpone the scan for 5 seconds via watchdog */
pscan->alrt = 1;
db_post_events(pscan,&pscan->alrt,DBE_VALUE);
sprintf(pscan->smsg,"Some PV's not connected ...");
strcpy(pscan->smsg,"Some PV's not connected ...");
db_post_events(pscan,&pscan->smsg,DBE_VALUE);
precPvt->phase = SCAN_PENDING;
wdStart(precPvt->wd_id,(3 * sysClkRateGet()),
@@ -656,7 +656,7 @@ static long special(paddr,after)
if(pscan->cmnd == CLEAR_MSG) {
pscan->alrt = 0;
db_post_events(pscan,&pscan->alrt,DBE_VALUE);
sprintf(pscan->smsg,"");
strcpy(pscan->smsg,"");
db_post_events(pscan,&pscan->smsg,DBE_VALUE);
}
else if((pscan->cmnd == CHECK_LIMITS) && !(pscan->exsc)) {
@@ -703,8 +703,8 @@ static long special(paddr,after)
for(i=0; i<NUM_PVS; i++) {
puserPvt = (recDynLinkPvt *)precPvt->caLinkStruct[i].puserPvt;
if((pscan->cmnd == CLEAR_RECORD) ||
(pscan->cmnd == CLEAR_POSITIONERS) &&
(puserPvt->linkType == POSITIONER)) {
((pscan->cmnd == CLEAR_POSITIONERS) &&
(puserPvt->linkType == POSITIONER))) {
/* clear this PV */
pPvStat = &pscan->p1nv + i; /* pointer arithmetic */
oldStat = *pPvStat;
@@ -809,7 +809,7 @@ static long special(paddr,after)
/* resolve linear scan parameters affected by this fields change */
prevAlrt = pscan->alrt;
pscan->alrt = 0;
sprintf(pscan->smsg,"");
strcpy(pscan->smsg,"");
adjLinParms(paddr);
db_post_events(pscan,&pscan->smsg,DBE_VALUE);
if(pscan->alrt != prevAlrt) {
@@ -828,7 +828,7 @@ static long special(paddr,after)
}
prevAlrt = pscan->alrt;
pscan->alrt = 0;
sprintf(pscan->smsg,"");
strcpy(pscan->smsg,"");
precPvt->nptsCause = -1; /* resolve all positioner parameters */
changedNpts(pscan);
db_post_events(pscan,&pscan->smsg,DBE_VALUE);
@@ -912,7 +912,6 @@ static long cvt_dbaddr(paddr)
{
struct scanRecord *pscan=(struct scanRecord *)paddr->precord;
recPvtStruct *precPvt = (recPvtStruct *)pscan->rpvt;
posFields *pPosFields = (posFields *)&pscan->p1pp;
detFields *pDetFields = (detFields *)&pscan->d1hr;
short fieldOffset;
@@ -1029,7 +1028,6 @@ static long put_array_info(paddr,nNew)
recPvtStruct *precPvt = (recPvtStruct *)pscan->rpvt;
posFields *pPosFields = (posFields *)&pscan->p1pp;
short fieldOffset;
unsigned short *pPvStat;
unsigned short i;
/* This routine is called because someone wrote a table to the
@@ -1049,7 +1047,7 @@ static long put_array_info(paddr,nNew)
db_post_events(pscan,&pscan->alrt,DBE_VALUE);
}
} else {
sprintf(pscan->smsg,"");
strcpy(pscan->smsg,"");
db_post_events(pscan,&pscan->smsg,DBE_VALUE);
if(pscan->alrt) {
pscan->alrt = 0;
@@ -1109,7 +1107,7 @@ static long put_enum_str(paddr,pstring)
if(paddr->pfield==(void *)&pscan->cmnd)
{
if(sscanf(pstring,"%i",&pscan->cmnd)<=0)
if(sscanf(pstring,"%hu",&pscan->cmnd)<=0)
return(S_db_badChoice);
}
else
@@ -1120,17 +1118,6 @@ static long put_enum_str(paddr,pstring)
return(0);
}
static long get_value(pscan,pvdes)
struct scanRecord *pscan;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_DOUBLE;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &pscan->p1dv;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
@@ -1579,7 +1566,7 @@ LOCAL void pvSearchCallback(recDynLink *precDynLink)
/*
if(puserPvt->nelem) {
printf("Freeing memory for dynLink %d \n", index);
/* free(pDetFields->d_da);
free(pDetFields->d_da);
}
*/
@@ -1625,8 +1612,7 @@ LOCAL void posMonCallback(recDynLink *precDynLink)
unsigned short index = puserPvt->linkIndex;
posFields *pPosFields = (posFields *)&pscan->p1pp + index;
long status;
long nRequest = 1;
long options = 0;
size_t nRequest = 1;
/* update p_cv with current positioner value */
@@ -1682,11 +1668,8 @@ static long initScan(pscan)
struct scanRecord *pscan;
{
recPvtStruct *precPvt = (recPvtStruct *)pscan->rpvt;
recDynLinkPvt *puserPvt;
posFields *pPosFields;
long status;
long nRequest = 1;
long options = 0;
unsigned short *pPvStat;
int i;
@@ -1811,8 +1794,7 @@ struct scanRecord *pscan;
unsigned short *pPvStatPos;
unsigned short i;
long status;
long nRequest = 1;
long options = 0;
size_t nRequest = 1;
switch (precPvt->phase) {
case TRIG_DETCTRS:
@@ -1838,7 +1820,7 @@ struct scanRecord *pscan;
}
else {
status = dbGet(puserPvt->pAddr,DBR_DOUBLE, &pPosFields->r_cv,
&options, &nRequest,NULL);
0,0,NULL);
}
if((pPosFields->r_dl > 0) &&
@@ -1885,7 +1867,7 @@ struct scanRecord *pscan;
}
else {
status = dbGet(puserPvt->pAddr,DBR_DOUBLE, &pPosFields->r_cv,
&options, &nRequest,NULL);
0,0,NULL);
}
precPvt->posBufPtr[i].pFill[pscan->cpt] = pPosFields->r_cv;
@@ -1935,7 +1917,7 @@ struct scanRecord *pscan;
}
else {
status |= dbGet(puserPvt->pAddr, DBR_FLOAT, &pDetFields->d_cv,
&options, &nRequest, NULL);
0,0, NULL);
}
}
else {
@@ -2008,7 +1990,6 @@ struct scanRecord *pscan;
int counter;
unsigned short *pPvStat, i;
detFields *pDetFields;
posFields *pPosFields;
/* Done with scan. Do we want to fill the remainder of the
@@ -2106,7 +2087,6 @@ void doPuts(precPvt)
unsigned short *pPvStat;
int i;
long status;
long nRequest = 1;
switch (precPvt->phase) {
case MOVE_MOTORS:
@@ -2281,7 +2261,7 @@ void doPuts(precPvt)
if(pscan->exsc && !precPvt->badOutputPv && !precPvt->badInputPv) {
pscan->alrt = 0;
db_post_events(pscan,&pscan->alrt,DBE_VALUE);
sprintf(pscan->smsg,"");
strcpy(pscan->smsg,"");
db_post_events(pscan,&pscan->smsg,DBE_VALUE);
scanOnce(pscan);
if(recScanDebug) printf("scanPending - start scan\n");
@@ -2294,8 +2274,8 @@ void doPuts(precPvt)
if(recScanDebug) printf("scanPending - end scan\n");
}
break;
default:
break;
}
}
@@ -2831,8 +2811,7 @@ static long checkScanLimits(pscan)
/* for each valid positioner, fetch control limits */
long status;
long nRequest = 1;
long options = 0;
size_t nRequest = 1;
int i,j;
double value;
@@ -2863,7 +2842,7 @@ static long checkScanLimits(pscan)
}
else {
status |= dbGet(puserPvt->pAddr, DBR_DOUBLE, &pPosFields->p_pp,
&options, &nRequest, NULL);
0,0, NULL);
}
db_post_events(pscan,&pPosFields->p_pp,DBE_VALUE);
}
@@ -2973,8 +2952,7 @@ static void previewScan(pscan)
float value;
int i,j;
long status;
long nRequest = 1;
long options = 0;
size_t nRequest = 1;
/* Update "previous position" of positioners to use in relative mode */
pPvStat = &pscan->p1nv;
@@ -2988,7 +2966,7 @@ static void previewScan(pscan)
}
else {
status |= dbGet(puserPvt->pAddr, DBR_DOUBLE, &pPosFields->p_pp,
&options, &nRequest, NULL);
0,0, NULL);
}
db_post_events(pscan,&pPosFields->p_pp,DBE_VALUE);
}
@@ -3099,7 +3077,6 @@ static void savePosParms(struct scanRecord *pscan, unsigned short i)
static void zeroPosParms(struct scanRecord *pscan, unsigned short i)
{
recPvtStruct *precPvt = (recPvtStruct *)pscan->rpvt;
posFields *pPosFields = (posFields *)&pscan->p1pp + i;
/* set them to 0 */
@@ -3120,7 +3097,6 @@ static void resetFrzFlags(pscan)
struct scanRecord *pscan;
{
recPvtStruct *precPvt = (recPvtStruct *)pscan->rpvt;
posFields *pPosFields = (posFields *)&pscan->p1pp;
int i;
@@ -3330,3 +3306,4 @@ SIECW (Start,Incr,End,Center,Width freeze-switch states; '1' = 'frozen')
*/
+2 -17
View File
@@ -57,6 +57,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
@@ -70,7 +71,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -115,10 +116,6 @@ static int fetch_values();
static void monitor();
#define ARG_MAX 12
/* Fldnames should have as many as ARG_MAX */
static char *Fldnames[ARG_MAX] =
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
static long init_record(psel,pass)
struct selRecord *psel;
@@ -127,8 +124,6 @@ static long init_record(psel,pass)
struct link *plink;
int i;
double *pvalue;
/* Added for Channel Access Links */
long status;
if (pass==0) return(0);
@@ -175,16 +170,6 @@ static long process(psel)
}
static long get_value(psel,pvdes)
struct selRecord *psel;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_DOUBLE;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &psel->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
+8 -4
View File
@@ -31,16 +31,19 @@
* .01 09-21-92 jrw created
*/
#include <vxWorks.h>
#include <types.h>
#include <stdioLib.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <lstLib.h>
#include <string.h>
#include <memLib.h>
#include <wdLib.h>
#include <sysLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -99,6 +102,8 @@ struct callbackSeq {
struct linkDesc *plinks[NUM_LINKS+1]; /* Pointers to links to process */
int index;
};
int processNextLink();
/*****************************************************************************
*
* Initialize a sequence record.
@@ -144,7 +149,6 @@ int pass;
index = 0;
while (index < NUM_LINKS)
{
char DumbCaString[10];
if (plink->dol.type == CONSTANT)
recGblInitConstantLink(&plink->dol,DBF_DOUBLE,&plink->dov);
@@ -293,7 +297,7 @@ struct seqRecord *pseq;
* dbScanLock is already held for pseq before this function is called.
*
******************************************************************************/
processNextLink(pseq)
int processNextLink(pseq)
struct seqRecord *pseq;
{
struct callbackSeq *pcb = (struct callbackSeq *) (pseq->dpvt);
+2 -12
View File
@@ -45,6 +45,7 @@
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -59,7 +60,7 @@
#define init_record NULL
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -107,17 +108,6 @@ static long process(pstate)
pstate->pact=FALSE;
return(0);
}
static long get_value(pstate,pvdes)
struct stateRecord *pstate;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_STRING;
pvdes->no_elements=1;
pvdes->pvalue = (void *)(&pstate->val[0]);
return(0);
}
static void monitor(pstate)
struct stateRecord *pstate;
+2 -12
View File
@@ -109,6 +109,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <dbScan.h>
#include <devSup.h>
@@ -126,7 +127,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -259,16 +260,6 @@ static long process(psm)
return(0);
}
static long get_value(psm,pvdes)
struct steppermotorRecord *psm;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_FLOAT;
pvdes->no_elements=1;
(float *)(pvdes->pvalue) = &psm->val;
return(0);
}
static long special(paddr,after)
struct dbAddr *paddr;
int after;
@@ -447,7 +438,6 @@ struct motor_data *psm_data;
struct steppermotorRecord *psm;
{
struct smdset *pdset = (struct smdset *)(psm->dset);
unsigned short stat,sevr,nsta,nsev;
int intAccept=interruptAccept;
short post_events;
double temp;
+2 -13
View File
@@ -49,6 +49,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -63,7 +64,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -169,18 +170,6 @@ static long process(pstringin)
pstringin->pact=FALSE;
return(status);
}
static long get_value(pstringin,pvdes)
struct stringinRecord *pstringin;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_STRING;
pvdes->no_elements=1;
pvdes->pvalue = (void *)(&pstringin->val[0]);
return(0);
}
static void monitor(pstringin)
struct stringinRecord *pstringin;
+2 -12
View File
@@ -54,6 +54,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -69,7 +70,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -202,17 +203,6 @@ finish:
pstringout->pact=FALSE;
return(status);
}
static long get_value(pstringout,pvdes)
struct stringoutRecord *pstringout;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_STRING;
pvdes->no_elements=1;
pvdes->pvalue = (void *)(&pstringout->val[0]);
return(0);
}
static void monitor(pstringout)
struct stringoutRecord *pstringout;
+1 -1
View File
@@ -46,6 +46,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <dbScan.h>
#include <devSup.h>
@@ -298,7 +299,6 @@ static void monitor(psa)
struct subArrayRecord *psa;
{
unsigned short monitor_mask;
short stat,sevr,nsta,nsev;
/* get previous stat and sevr and new stat and sevr*/
monitor_mask = recGblResetAlarms(psa);
+2 -15
View File
@@ -59,6 +59,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
@@ -72,7 +73,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -111,10 +112,6 @@ static long fetch_values();
static void monitor();
#define ARG_MAX 12
/* Fldnames should have as many as ARG_MAX */
static char *Fldnames[ARG_MAX] =
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
static long init_record(psub,pass)
struct subRecord *psub;
@@ -199,16 +196,6 @@ static long process(psub)
return(0);
}
static long get_value(psub,pvdes)
struct subRecord *psub;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_DOUBLE;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &psub->val;
return(0);
}
static long get_units(paddr,units)
struct dbAddr *paddr;
char *units;
+2 -14
View File
@@ -62,6 +62,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
@@ -77,7 +78,7 @@
static long init_record();
static long process();
#define special NULL
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -135,8 +136,6 @@ static long init_record(ptimer, pass)
struct timerRecord *ptimer;
int pass;
{
long status;
/* Added for Channel Access Links */
if (pass==0) return(0);
@@ -169,16 +168,6 @@ static long process(ptimer)
ptimer->pact=FALSE;
return status;
}
static long get_value(ptimer,pvdes)
struct timerRecord *ptimer;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_SHORT;
pvdes->no_elements=1;
(short *)(pvdes->pvalue) = &ptimer->val;
return(0);
}
static void monitor(ptimer)
struct timerRecord *ptimer;
@@ -255,7 +244,6 @@ struct timerRecord *ptimer;
static long read_timer(struct timerRecord *ptimer)
{
struct tmdset *pdset;
double constant;
/* initiate the write */
if (ptimer->out.type != VME_IO) {
+9 -24
View File
@@ -75,10 +75,12 @@
#include <semLib.h>
#include <taskLib.h>
#include <wdLib.h>
#include <sysLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbScan.h>
#include <dbDefs.h>
#include <dbFldTypes.h>
@@ -103,7 +105,7 @@
static long init_record();
static long process();
static long special();
static long get_value();
#define get_value NULL
#define cvt_dbaddr NULL
#define get_array_info NULL
#define put_array_info NULL
@@ -214,7 +216,6 @@ struct qStruct {
int recWaitDebug=0;
int recWaitCacheMode=0;
static unsigned long tickStart;
static void schedOutput(struct waitRecord *pwait);
static void execOutput(struct cbStruct *pcbst);
static int fetch_values(struct waitRecord *pwait);
@@ -223,7 +224,6 @@ static long initSiml();
static void ioIntProcess(CALLBACK *pioProcCb);
static void pvSearchCallback(recDynLink *precDynLink);
static void pvMonitorCallback(recDynLink *precDynLink);
static void inputChanged(recDynLink *precDynLink);
@@ -237,7 +237,6 @@ static long init_record(pwait,pass)
char *ppvn[PVN_SIZE];
unsigned short *pPvStat;
unsigned short *piointInc; /* include for IO_INT ? */
recDynLinkPvt *puserPvt;
@@ -419,10 +418,8 @@ static long special(paddr,after)
int special_type = paddr->special;
char *ppvn[PVN_SIZE];
unsigned short *pPvStat;
unsigned short *piointInc; /* include for IO_INT ? */
unsigned short oldStat;
int index;
long status;
short error_number;
char rpbuf[184];
@@ -495,16 +492,6 @@ static long special(paddr,after)
return(0);
}
}
static long get_value(pwait,pvdes)
struct waitRecord *pwait;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_DOUBLE;
pvdes->no_elements=1;
(double *)(pvdes->pvalue) = &pwait->val;
return(0);
}
static long get_precision(paddr,precision)
struct dbAddr *paddr;
@@ -592,7 +579,6 @@ static void monitor(pwait)
static long initSiml(pwait)
struct waitRecord *pwait;
{
long status;
/* wait.siml must be a CONSTANT or a PV_LINK or a DB_LINK */
if (pwait->siml.type == CONSTANT) {
@@ -614,7 +600,8 @@ struct waitRecord *pwait;
double *pvalue;
unsigned short *pPvStat;
unsigned short *piointInc; /* include for IO_INT ? */
long status=0,options=0,nRequest=1;
long status=0;
size_t nRequest=1;
int i;
piointInc = &pwait->inap;
@@ -680,8 +667,7 @@ void execOutput(pcbst)
struct cbStruct *pcbst;
{
long status;
long nRequest = 1;
long options = 0;
size_t nRequest = 1;
double oldDold;
/* if output link is valid , decide between VAL and DOL */
@@ -732,8 +718,7 @@ static void inputChanged(recDynLink *precDynLink)
struct waitRecord *pwait = ((recDynLinkPvt *)precDynLink->puserPvt)->pwait;
struct cbStruct *pcbst = (struct cbStruct *)pwait->cbst;
double monData;
unsigned long nRequest;
long status;
size_t nRequest;
char index;
unsigned short *piointInc;
@@ -747,7 +732,7 @@ static void inputChanged(recDynLink *precDynLink)
/* put input index and monitored data on processing queue */
recDynLinkGet(precDynLink, &monData, &nRequest, 0, 0, 0);
if(recWaitDebug>5)
printf("queuing monitor on %d = %lf\n",index,monData);
printf("queuing monitor on %d = %f\n",index,monData);
if(rngBufPut(pcbst->monitorQ, (void *)&index, sizeof(char))
!= sizeof(char)) errMessage(0,"recWait rngBufPut error");
if(rngBufPut(pcbst->monitorQ, (void *)&monData, sizeof(double))
@@ -783,7 +768,7 @@ static void ioIntProcess(CALLBACK *pioProcCb)
!= sizeof(double)) errMessage(0, "recWait: rngBufGet error");
if(recWaitDebug>=5)
printf("processing on %d = %lf (%lf)\n",
printf("processing on %d = %f (%f)\n",
inputIndex, monData,pwait->val);
pInput += inputIndex; /* pointer arithmetic for appropriate input */
+1
View File
@@ -70,6 +70,7 @@
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbEvent.h>
#include <dbFldTypes.h>
#include <dbScan.h>
#include <devSup.h>