changes for 3.14
This commit is contained in:
@@ -1,7 +1,97 @@
|
||||
|
||||
TOP=../..
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
include $(TOP)/config/RULES_ARCHS
|
||||
|
||||
INC += egDefs.h
|
||||
INC += erDefs.h
|
||||
INC += ereventDefs.h
|
||||
|
||||
USER_DBDFLAGS += -I .. -I $(EPICS_BASE)/dbd
|
||||
RECTYPES += aaiRecord.h
|
||||
RECTYPES += aaoRecord.h
|
||||
RECTYPES += aiRecord.h
|
||||
RECTYPES += aoRecord.h
|
||||
RECTYPES += biRecord.h
|
||||
RECTYPES += boRecord.h
|
||||
RECTYPES += calcRecord.h
|
||||
RECTYPES += calcoutRecord.h
|
||||
RECTYPES += compressRecord.h
|
||||
RECTYPES += dfanoutRecord.h
|
||||
RECTYPES += egRecord.h
|
||||
RECTYPES += egeventRecord.h
|
||||
RECTYPES += erRecord.h
|
||||
RECTYPES += ereventRecord.h
|
||||
RECTYPES += eventRecord.h
|
||||
RECTYPES += fanoutRecord.h
|
||||
RECTYPES += gsubRecord.h
|
||||
RECTYPES += histogramRecord.h
|
||||
RECTYPES += longinRecord.h
|
||||
RECTYPES += longoutRecord.h
|
||||
RECTYPES += mbbiRecord.h
|
||||
RECTYPES += mbbiDirectRecord.h
|
||||
RECTYPES += mbboRecord.h
|
||||
RECTYPES += mbboDirectRecord.h
|
||||
RECTYPES += palRecord.h
|
||||
RECTYPES += permissiveRecord.h
|
||||
RECTYPES += pidRecord.h
|
||||
RECTYPES += pulseCounterRecord.h
|
||||
RECTYPES += pulseDelayRecord.h
|
||||
RECTYPES += pulseTrainRecord.h
|
||||
RECTYPES += selRecord.h
|
||||
RECTYPES += seqRecord.h
|
||||
RECTYPES += stateRecord.h
|
||||
RECTYPES += steppermotorRecord.h
|
||||
RECTYPES += stringinRecord.h
|
||||
RECTYPES += stringoutRecord.h
|
||||
RECTYPES += subRecord.h
|
||||
RECTYPES += subArrayRecord.h
|
||||
RECTYPES += timerRecord.h
|
||||
RECTYPES += waveformRecord.h
|
||||
|
||||
USR_INCLUDES = -I../drv/ansi -I../../drv/old
|
||||
|
||||
IOC_PROD_vxWorks += aaiRecord.o
|
||||
IOC_PROD_vxWorks += aaoRecord.o
|
||||
IOC_PROD_vxWorks += aiRecord.o
|
||||
IOC_PROD_vxWorks += aoRecord.o
|
||||
IOC_PROD_vxWorks += biRecord.o
|
||||
IOC_PROD_vxWorks += boRecord.o
|
||||
IOC_PROD_vxWorks += calcRecord.o
|
||||
IOC_PROD_vxWorks += calcoutRecord.o
|
||||
IOC_PROD_vxWorks += compressRecord.o
|
||||
IOC_PROD_vxWorks += dfanoutRecord.o
|
||||
IOC_PROD_vxWorks += egRecord.o
|
||||
IOC_PROD_vxWorks += egeventRecord.o
|
||||
IOC_PROD_vxWorks += erRecord.o
|
||||
IOC_PROD_vxWorks += ereventRecord.o
|
||||
IOC_PROD_vxWorks += eventRecord.o
|
||||
IOC_PROD_vxWorks += fanoutRecord.o
|
||||
IOC_PROD_vxWorks += gsubRecord.o
|
||||
IOC_PROD_vxWorks += histogramRecord.o
|
||||
IOC_PROD_vxWorks += longinRecord.o
|
||||
IOC_PROD_vxWorks += longoutRecord.o
|
||||
IOC_PROD_vxWorks += mbbiRecord.o
|
||||
IOC_PROD_vxWorks += mbbiDirectRecord.o
|
||||
IOC_PROD_vxWorks += mbboRecord.o
|
||||
IOC_PROD_vxWorks += mbboDirectRecord.o
|
||||
IOC_PROD_vxWorks += palRecord.o
|
||||
IOC_PROD_vxWorks += permissiveRecord.o
|
||||
IOC_PROD_vxWorks += pidRecord.o
|
||||
IOC_PROD_vxWorks += pulseCounterRecord.o
|
||||
IOC_PROD_vxWorks += pulseDelayRecord.o
|
||||
IOC_PROD_vxWorks += pulseTrainRecord.o
|
||||
IOC_PROD_vxWorks += selRecord.o
|
||||
IOC_PROD_vxWorks += seqRecord.o
|
||||
IOC_PROD_vxWorks += stateRecord.o
|
||||
IOC_PROD_vxWorks += steppermotorRecord.o
|
||||
IOC_PROD_vxWorks += stringinRecord.o
|
||||
IOC_PROD_vxWorks += stringoutRecord.o
|
||||
IOC_PROD_vxWorks += subRecord.o
|
||||
IOC_PROD_vxWorks += subArrayRecord.o
|
||||
IOC_PROD_vxWorks += timerRecord.o
|
||||
IOC_PROD_vxWorks += waveformRecord.o
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
TOP = ../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
INC += egDefs.h
|
||||
INC += erDefs.h
|
||||
INC += ereventDefs.h
|
||||
INC += recDynLink.h
|
||||
|
||||
USER_DBDFLAGS += -I .. -I $(EPICS_BASE)/dbd
|
||||
RECTYPES += aaiRecord.h
|
||||
RECTYPES += aaoRecord.h
|
||||
RECTYPES += aiRecord.h
|
||||
RECTYPES += aoRecord.h
|
||||
RECTYPES += biRecord.h
|
||||
RECTYPES += boRecord.h
|
||||
RECTYPES += calcRecord.h
|
||||
RECTYPES += calcoutRecord.h
|
||||
RECTYPES += compressRecord.h
|
||||
RECTYPES += dfanoutRecord.h
|
||||
RECTYPES += egRecord.h
|
||||
RECTYPES += egeventRecord.h
|
||||
RECTYPES += erRecord.h
|
||||
RECTYPES += ereventRecord.h
|
||||
RECTYPES += eventRecord.h
|
||||
RECTYPES += fanoutRecord.h
|
||||
RECTYPES += gsubRecord.h
|
||||
RECTYPES += histogramRecord.h
|
||||
RECTYPES += longinRecord.h
|
||||
RECTYPES += longoutRecord.h
|
||||
RECTYPES += mbbiRecord.h
|
||||
RECTYPES += mbbiDirectRecord.h
|
||||
RECTYPES += mbboRecord.h
|
||||
RECTYPES += mbboDirectRecord.h
|
||||
RECTYPES += palRecord.h
|
||||
RECTYPES += permissiveRecord.h
|
||||
RECTYPES += pidRecord.h
|
||||
RECTYPES += pulseCounterRecord.h
|
||||
RECTYPES += pulseDelayRecord.h
|
||||
RECTYPES += pulseTrainRecord.h
|
||||
RECTYPES += scanRecord.h
|
||||
RECTYPES += selRecord.h
|
||||
RECTYPES += seqRecord.h
|
||||
RECTYPES += stateRecord.h
|
||||
RECTYPES += steppermotorRecord.h
|
||||
RECTYPES += stringinRecord.h
|
||||
RECTYPES += stringoutRecord.h
|
||||
RECTYPES += subRecord.h
|
||||
RECTYPES += subArrayRecord.h
|
||||
RECTYPES += timerRecord.h
|
||||
RECTYPES += waitRecord.h
|
||||
RECTYPES += waveformRecord.h
|
||||
|
||||
include $(TOP)/config/RULES.Host
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
TOP = ../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
USR_INCLUDES = -I../drv/ansi -I../../drv/old
|
||||
|
||||
INC += egDefs.h
|
||||
INC += erDefs.h
|
||||
INC += ereventDefs.h
|
||||
INC += recDynLink.h
|
||||
|
||||
USER_DBDFLAGS += -I .. -I $(EPICS_BASE)/dbd
|
||||
|
||||
SRCS.c += ../aaiRecord.c
|
||||
SRCS.c += ../aaoRecord.c
|
||||
SRCS.c += ../aiRecord.c
|
||||
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
|
||||
SRCS.c += ../egeventRecord.c
|
||||
SRCS.c += ../erRecord.c
|
||||
SRCS.c += ../ereventRecord.c
|
||||
SRCS.c += ../eventRecord.c
|
||||
SRCS.c += ../fanoutRecord.c
|
||||
SRCS.c += ../gsubRecord.c
|
||||
SRCS.c += ../histogramRecord.c
|
||||
SRCS.c += ../longinRecord.c
|
||||
SRCS.c += ../longoutRecord.c
|
||||
SRCS.c += ../mbbiRecord.c
|
||||
SRCS.c += ../mbbiDirectRecord.c
|
||||
SRCS.c += ../mbboRecord.c
|
||||
SRCS.c += ../mbboDirectRecord.c
|
||||
SRCS.c += ../palRecord.c
|
||||
SRCS.c += ../permissiveRecord.c
|
||||
SRCS.c += ../pidRecord.c
|
||||
SRCS.c += ../pulseCounterRecord.c
|
||||
SRCS.c += ../pulseDelayRecord.c
|
||||
SRCS.c += ../pulseTrainRecord.c
|
||||
SRCS.c += ../scanRecord.c
|
||||
SRCS.c += ../selRecord.c
|
||||
SRCS.c += ../seqRecord.c
|
||||
SRCS.c += ../stateRecord.c
|
||||
SRCS.c += ../steppermotorRecord.c
|
||||
SRCS.c += ../stringinRecord.c
|
||||
SRCS.c += ../stringoutRecord.c
|
||||
SRCS.c += ../subRecord.c
|
||||
SRCS.c += ../subArrayRecord.c
|
||||
SRCS.c += ../timerRecord.c
|
||||
SRCS.c += ../waitRecord.c
|
||||
SRCS.c += ../recWaitCa.c
|
||||
SRCS.c += ../recDynLink.c
|
||||
SRCS.c += ../recDynLinkTest.c
|
||||
SRCS.c += ../waveformRecord.c
|
||||
|
||||
PROD = $(SRCS.c:../%.c=%.o)
|
||||
|
||||
include $(TOP)/config/RULES.Vx
|
||||
|
||||
@@ -38,11 +38,10 @@
|
||||
* -----------------
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
|
||||
@@ -38,24 +38,24 @@
|
||||
* -----------------
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <dbScan.h>
|
||||
#include <dbEvent.h>
|
||||
#include <devSup.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbScan.h"
|
||||
#include "dbEvent.h"
|
||||
#include "devSup.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <aaoRecord.h>
|
||||
#include "aaoRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -72,10 +72,10 @@
|
||||
* .33 03-29-94 mcn converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
|
||||
@@ -70,12 +70,11 @@
|
||||
* out of fetch_value.
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <lstLib.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
|
||||
@@ -56,24 +56,24 @@
|
||||
* .22 03-29-94 mcn Converted to Fast Links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <dbEvent.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbEvent.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <biRecord.h>
|
||||
#include "biRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -67,29 +67,29 @@
|
||||
* .31 04-05-94 mrk ANSI changes to callback routines
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wdLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "osiWatchdog.h"
|
||||
#include "osiClock.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <callback.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "callback.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <boRecord.h>
|
||||
#include "boRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <menuIvoa.h>
|
||||
#include "menuIvoa.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
@@ -144,7 +144,7 @@ struct bodset { /* binary output dset */
|
||||
struct callback {
|
||||
CALLBACK callback;
|
||||
struct dbCommon *precord;
|
||||
WDOG_ID wd_id;
|
||||
watchdogId wd_id;
|
||||
};
|
||||
|
||||
static void alarm();
|
||||
@@ -162,13 +162,14 @@ static void myCallback(pcallback)
|
||||
|
||||
dbScanLock((struct dbCommon *)pbo);
|
||||
if(pbo->pact) {
|
||||
wait_time = (int)((pbo->high) * vxTicksPerSecond);/* seconds to ticks */
|
||||
wait_time = (int)(pbo->high * clockGetRate());
|
||||
if (pbo->val==1 && wait_time>0) {
|
||||
struct callback *pcallback;
|
||||
pcallback = (struct callback *)(pbo->rpvt);
|
||||
if(pcallback->wd_id==NULL) pcallback->wd_id = wdCreate();
|
||||
if(pcallback->wd_id==NULL) pcallback->wd_id = watchdogCreate();
|
||||
callbackSetPriority(pbo->prio, &pcallback->callback);
|
||||
wdStart(pcallback->wd_id, wait_time, (FUNCPTR)callbackRequest, (int)pcallback);
|
||||
watchdogStart(pcallback->wd_id, wait_time,
|
||||
(WATCHDOGFUNC)callbackRequest, (void *)pcallback);
|
||||
}
|
||||
} else {
|
||||
pbo->val = 0;
|
||||
@@ -303,13 +304,14 @@ static long process(pbo)
|
||||
pbo->pact = TRUE;
|
||||
|
||||
recGblGetTimeStamp(pbo);
|
||||
wait_time = (int)((pbo->high) * vxTicksPerSecond); /* seconds to ticks */
|
||||
wait_time = (int)(pbo->high * clockGetRate());
|
||||
if (pbo->val==1 && wait_time>0) {
|
||||
struct callback *pcallback;
|
||||
pcallback = (struct callback *)(pbo->rpvt);
|
||||
if(pcallback->wd_id==NULL) pcallback->wd_id = wdCreate();
|
||||
if(pcallback->wd_id==0) pcallback->wd_id = watchdogCreate();
|
||||
callbackSetPriority(pbo->prio, &pcallback->callback);
|
||||
wdStart(pcallback->wd_id, wait_time, (FUNCPTR)callbackRequest, (int)pcallback);
|
||||
watchdogStart(pcallback->wd_id, wait_time,
|
||||
(WATCHDOGFUNC)callbackRequest, (void *)pcallback);
|
||||
}
|
||||
/* check event list */
|
||||
monitor(pbo);
|
||||
|
||||
@@ -72,10 +72,10 @@
|
||||
* .30 05-24-94 jba Added recGblRecordError messages for postfix status
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
|
||||
@@ -41,33 +41,31 @@
|
||||
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.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"
|
||||
#include "postfix.h"
|
||||
#include "alarm.h"
|
||||
#include "osiWatchdog.h"
|
||||
#include "osiClock.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"
|
||||
#include "postfix.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "calcoutRecord.h"
|
||||
#include "calcoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuIvoa.h"
|
||||
#include "menuIvoa.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
@@ -128,9 +126,9 @@ struct rset calcoutRSET={
|
||||
|
||||
struct rpvtStruct {
|
||||
CALLBACK doOutCb;
|
||||
WDOG_ID wd_id_0;
|
||||
watchdogId wd_id_0;
|
||||
CALLBACK checkLinkCb;
|
||||
WDOG_ID wd_id_1;
|
||||
watchdogId wd_id_1;
|
||||
short wd_id_1_LOCK;
|
||||
short caLinkStat; /* NO_CA_LINKS,CA_LINKS_ALL_OK,CA_LINKS_NOT_OK */
|
||||
};
|
||||
@@ -210,16 +208,16 @@ static long init_record(pcalc,pass)
|
||||
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_0 = watchdogCreate();
|
||||
prpvt->wd_id_1 = watchdogCreate();
|
||||
prpvt->wd_id_1_LOCK = 0;
|
||||
|
||||
/* Can't do this. Sometimes initialization is not done after 1 second
|
||||
and then dbScanLock will complain !!!
|
||||
|
||||
if(prpvt->caLinkStat == CA_LINKS_NOT_OK) {
|
||||
wdStart(prpvt->wd_id_1, 60, (FUNCPTR)callbackRequest,
|
||||
(int)(&prpvt->checkLinkCb));
|
||||
watchdogStart(prpvt->wd_id_1, clockGetRate(), (WATCHDOGFUNC)callbackRequest,
|
||||
(void *)(&prpvt->checkLinkCb));
|
||||
prpvt->wd_id_1_LOCK = 1;
|
||||
}
|
||||
*/
|
||||
@@ -291,10 +289,11 @@ static long process(pcalc)
|
||||
if(pcalc->odly > 0.0) {
|
||||
pcalc->dlya = 1;
|
||||
db_post_events(pcalc,&pcalc->dlya,DBE_VALUE);
|
||||
wdDelay = pcalc->odly * sysClkRateGet();
|
||||
wdDelay = (int)(pcalc->odly * clockGetRate());
|
||||
callbackSetPriority(pcalc->prio, &prpvt->doOutCb);
|
||||
wdStart(prpvt->wd_id_0, wdDelay, (FUNCPTR)callbackRequest,
|
||||
(int)(&prpvt->doOutCb));
|
||||
watchdogStart(prpvt->wd_id_0, wdDelay,
|
||||
(WATCHDOGFUNC)callbackRequest,
|
||||
(void *)(&prpvt->doOutCb));
|
||||
}
|
||||
else {
|
||||
execOutput(pcalc);
|
||||
@@ -397,8 +396,8 @@ static long special(paddr,after)
|
||||
*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));
|
||||
watchdogStart(prpvt->wd_id_1, clockGetRate()/2, (WATCHDOGFUNC)callbackRequest,
|
||||
(void *)(&prpvt->checkLinkCb));
|
||||
prpvt->wd_id_1_LOCK = 1;
|
||||
prpvt->caLinkStat = CA_LINKS_NOT_OK;
|
||||
}
|
||||
@@ -770,8 +769,8 @@ static void checkLinks(pcalc)
|
||||
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));
|
||||
watchdogStart(prpvt->wd_id_1, clockGetRate()/2, (WATCHDOGFUNC)callbackRequest,
|
||||
(void *)(&prpvt->checkLinkCb));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Author: Ned Arnold
|
||||
* Date: 4-28-94
|
||||
*
|
||||
* 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 mm-dd-yy iii Comment
|
||||
*/
|
||||
|
||||
#ifndef INC_WAITchoice_h
|
||||
#define INC_WAITchoice 1
|
||||
|
||||
#define REC_WAIT_OUT_OPT 0
|
||||
#define REC_WAIT_OUT_OPT_EVERY 0
|
||||
#define REC_WAIT_OUT_OPT_CHANGE 1
|
||||
#define REC_WAIT_OUT_OPT_WHEN_ZERO 2
|
||||
#define REC_WAIT_OUT_OPT_WHEN_NZERO 3
|
||||
#define REC_WAIT_OUT_OPT_CHG_TO_ZERO 4
|
||||
#define REC_WAIT_OUT_OPT_CHG_TO_NZERO 5
|
||||
|
||||
#define REC_WAIT_DATA_OPT 1
|
||||
#define REC_WAIT_DATA_OPT_VAL 0
|
||||
#define REC_WAIT_DATA_OPT_DOL 1
|
||||
|
||||
#define REC_WAIT_INPP 2
|
||||
#define REC_WAIT_INPP_NPROC 0
|
||||
#define REC_WAIT_INPP_PROC 1
|
||||
|
||||
#define REC_WAIT_DYNL 3
|
||||
#define REC_WAIT_DYNL_OK 0
|
||||
#define REC_WAIT_DYNL_NC 1
|
||||
#define REC_WAIT_DYNL_NO_PV 2
|
||||
|
||||
/* DON'T CHANGE THESE DEFINITIONS !!!! */
|
||||
/* Indexes used to process dynamic links */
|
||||
/* Must start above 103, because SPC_CALC = 103 */
|
||||
#define REC_WAIT_A 110
|
||||
#define REC_WAIT_B 111
|
||||
#define REC_WAIT_C 112
|
||||
#define REC_WAIT_D 113
|
||||
#define REC_WAIT_E 114
|
||||
#define REC_WAIT_F 115
|
||||
#define REC_WAIT_G 116
|
||||
#define REC_WAIT_H 117
|
||||
#define REC_WAIT_I 118
|
||||
#define REC_WAIT_J 119
|
||||
#define REC_WAIT_K 120
|
||||
#define REC_WAIT_L 121
|
||||
#define REC_WAIT_O 122
|
||||
#define REC_WAIT_P 123
|
||||
|
||||
#endif
|
||||
@@ -59,26 +59,25 @@
|
||||
* implemented)
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <special.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "special.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <compressRecord.h>
|
||||
#include "compressRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -12,25 +12,24 @@
|
||||
* .02 May 10, 96 jt Bug Fix
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include"dbAccess.h"
|
||||
#include"dbEvent.h"
|
||||
#include"dbFldTypes.h"
|
||||
#include"devSup.h"
|
||||
#include"errMdef.h"
|
||||
#include"recSup.h"
|
||||
#include"special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <dfanoutRecord.h>
|
||||
#include"dfanoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -54,26 +54,27 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <module_types.h>
|
||||
#include"alarm.h"
|
||||
#include"dbAccess.h"
|
||||
#include"dbEvent.h"
|
||||
#include"dbFldTypes.h"
|
||||
#include"devSup.h"
|
||||
#include"errMdef.h"
|
||||
#include"recSup.h"
|
||||
#include"module_types.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <egRecord.h>
|
||||
#include"egRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <egDefs.h>
|
||||
#include"egDefs.h"
|
||||
|
||||
#define STATIC static
|
||||
|
||||
|
||||
@@ -53,26 +53,27 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
|
||||
#include <egRecord.h>
|
||||
#include "egRecord.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <egeventRecord.h>
|
||||
#include "egeventRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <egDefs.h>
|
||||
#include "egDefs.h"
|
||||
|
||||
#define STATIC static
|
||||
|
||||
|
||||
@@ -53,25 +53,26 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
|
||||
* Date: 9/27/93
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <module_types.h>
|
||||
#include <erDefs.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "module_types.h"
|
||||
#include "erDefs.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <erRecord.h>
|
||||
#include "erRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
#define STATIC static
|
||||
|
||||
@@ -53,24 +53,25 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
|
||||
* Date: 8/27/93
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
|
||||
#include <ereventDefs.h>
|
||||
#include "ereventDefs.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <ereventRecord.h>
|
||||
#include "ereventRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
#define STATIC static
|
||||
|
||||
@@ -38,23 +38,24 @@
|
||||
* .06 03-29-94 mcn converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbScan.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include"alarm.h"
|
||||
#include"dbAccess.h"
|
||||
#include"dbEvent.h"
|
||||
#include"dbScan.h"
|
||||
#include"dbFldTypes.h"
|
||||
#include"devSup.h"
|
||||
#include"errMdef.h"
|
||||
#include"recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <eventRecord.h>
|
||||
#include"eventRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -47,23 +47,24 @@
|
||||
* .17 03-29-94 mcn converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <fanoutRecord.h>
|
||||
#include "fanoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <dbCommon.h>
|
||||
#include "dbCommon.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -34,25 +34,23 @@
|
||||
* currently does not support callback.
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <symLib.h>
|
||||
#include <sysSymTbl.h> /* for sysSymTbl*/
|
||||
#include <a_out.h> /* for N_TEXT */
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "registry.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <gsubRecord.h>
|
||||
#include "gsubRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
@@ -106,10 +104,7 @@ static long init_record(psub,pass)
|
||||
int pass;
|
||||
{
|
||||
FUNCPTR psubroutine;
|
||||
char sub_type;
|
||||
char temp[40];
|
||||
int status;
|
||||
STATUS ret;
|
||||
struct link *plink;
|
||||
int i;
|
||||
float *pvalue;
|
||||
@@ -125,13 +120,8 @@ static long init_record(psub,pass)
|
||||
}
|
||||
|
||||
/* convert the initialization subroutine name */
|
||||
temp[0] = 0; /* all global variables start with _ */
|
||||
if (psub->inam[0] != '_'){
|
||||
strcpy(temp,"_");
|
||||
}
|
||||
strcat(temp,psub->inam);
|
||||
ret = symFindByNameEPICS(sysSymTbl,temp,(void *)&psub->sadr,(void *)&sub_type);
|
||||
if ((ret !=OK) || ((sub_type & N_TEXT) == 0)){
|
||||
psub->sadr = registryFind(0,psub->inam);
|
||||
if(psub->sadr==0) {
|
||||
recGblRecordError(S_db_BadSub,(void *)psub,"recGsub(init_record)");
|
||||
return(S_db_BadSub);
|
||||
}
|
||||
@@ -139,21 +129,16 @@ static long init_record(psub,pass)
|
||||
/* invoke the initialization subroutine */
|
||||
psubroutine = (FUNCPTR)(psub->sadr);
|
||||
status = psubroutine(pcallbackdummy, pcallbackdummy,
|
||||
&(psub->a),&(psub->b),&(psub->c),&(psub->d),&(psub->e), &(psub->f),&(psub->val));
|
||||
&(psub->a),&(psub->b),&(psub->c),&(psub->d),&(psub->e),
|
||||
&(psub->f),&(psub->val));
|
||||
|
||||
/* convert the subroutine name to an address and type */
|
||||
/* convert the processing subroutine name */
|
||||
temp[0] = 0; /* all global variables start with _ */
|
||||
if (psub->snam[0] != '_'){
|
||||
strcpy(temp,"_");
|
||||
}
|
||||
strcat(temp,psub->snam);
|
||||
ret = symFindByNameEPICS(sysSymTbl,temp,(void *)&psub->sadr,(void *)&sub_type);
|
||||
if ((ret < 0) || ((sub_type & N_TEXT) == 0)){
|
||||
psub->sadr = registryFind(0,psub->snam);
|
||||
if(psub->sadr==0) {
|
||||
recGblRecordError(S_db_BadSub,(void *)psub,"recGsub(init_record)");
|
||||
return(S_db_BadSub);
|
||||
}
|
||||
psub->styp = sub_type;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,6 @@ recordtype(gsub) {
|
||||
interest(4)
|
||||
extra("void * sadr")
|
||||
}
|
||||
field(STYP,DBF_SHORT) {
|
||||
prompt("Subr symbol type")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(INPA,DBF_INLINK) {
|
||||
prompt("Input A")
|
||||
promptgroup(GUI_INPUTS)
|
||||
|
||||
@@ -40,30 +40,30 @@
|
||||
* .09 01-24-94 mcn Converted to Fast Links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#include <wdLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <callback.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <special.h>
|
||||
#include <recSup.h>
|
||||
#include "osiWatchdog.h"
|
||||
#include "osiClock.h"
|
||||
#include "alarm.h"
|
||||
#include "callback.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "special.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <histogramRecord.h>
|
||||
#include "histogramRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
@@ -121,7 +121,7 @@ struct callback {
|
||||
void (*callback)();
|
||||
int priority;
|
||||
struct dbAddr dbAddr;
|
||||
WDOG_ID wd_id;
|
||||
watchdogId wd_id;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -137,8 +137,6 @@ static void wdogCallback(pcallback)
|
||||
struct callback *pcallback;
|
||||
{
|
||||
struct histogramRecord *phistogram=(struct histogramRecord *)(pcallback->dbAddr.precord);
|
||||
float wait_time;
|
||||
|
||||
/* force post events for any count change */
|
||||
if(phistogram->mcnt>0){
|
||||
dbScanLock((struct dbCommon *)phistogram);
|
||||
@@ -150,8 +148,9 @@ static void wdogCallback(pcallback)
|
||||
|
||||
if(phistogram->sdel>0) {
|
||||
/* start new watchdog timer on monitor */
|
||||
wait_time = (float)(phistogram->sdel * vxTicksPerSecond);
|
||||
wdStart(pcallback->wd_id,wait_time,(FUNCPTR)callbackRequest,(int)pcallback);
|
||||
watchdogStart(pcallback->wd_id,
|
||||
(int)(phistogram->sdel *clockGetRate()),
|
||||
(WATCHDOGFUNC)callbackRequest,(void *)pcallback);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -160,7 +159,6 @@ static long wdogInit(phistogram)
|
||||
struct histogramRecord *phistogram;
|
||||
{
|
||||
struct callback *pcallback;
|
||||
float wait_time;
|
||||
|
||||
if(phistogram->wdog==NULL && phistogram->sdel>0) {
|
||||
/* initialize a watchdog timer */
|
||||
@@ -169,7 +167,7 @@ static long wdogInit(phistogram)
|
||||
if(!pcallback) return -1;
|
||||
pcallback->callback = wdogCallback;
|
||||
pcallback->priority = priorityLow;
|
||||
pcallback->wd_id = wdCreate();
|
||||
pcallback->wd_id = watchdogCreate();
|
||||
dbNameToAddr(phistogram->name,&(pcallback->dbAddr));
|
||||
}
|
||||
|
||||
@@ -177,12 +175,13 @@ static long wdogInit(phistogram)
|
||||
pcallback = (struct callback *)phistogram->wdog;
|
||||
if(!pcallback) return -1;
|
||||
|
||||
wdCancel(pcallback->wd_id);
|
||||
watchdogCancel(pcallback->wd_id);
|
||||
|
||||
if( phistogram->sdel>0) {
|
||||
/* start new watchdog timer on monitor */
|
||||
wait_time = (float)(phistogram->sdel * vxTicksPerSecond);
|
||||
wdStart(pcallback->wd_id,wait_time,(FUNCPTR)callbackRequest,(int)pcallback);
|
||||
watchdogStart(pcallback->wd_id,
|
||||
(int)(phistogram->sdel * clockGetRate()),
|
||||
(WATCHDOGFUNC)callbackRequest,(void *)pcallback);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -44,24 +44,23 @@
|
||||
* .13 03-29-94 mcn Converted to Fast Links
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <longinRecord.h>
|
||||
#include "longinRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -43,25 +43,25 @@
|
||||
* .14 09-18-92 jba pact now set in recGblGetLinkValue
|
||||
* .15 03-29-94 mcn converted to fast links
|
||||
*/
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <longoutRecord.h>
|
||||
#include "longoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <menuIvoa.h>
|
||||
#include "menuIvoa.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -34,24 +34,24 @@
|
||||
* 2. jt May 20,96 Bug Fix
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <mbbiDirectRecord.h>
|
||||
#include "mbbiDirectRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -55,24 +55,24 @@
|
||||
* .22 03-29-94 mcn converted to fast links.
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <mbbiRecord.h>
|
||||
#include "mbbiRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -34,24 +34,24 @@
|
||||
* 1. mcn "Created" by borrowing mbbo record code, and modifying it.
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <mbboDirectRecord.h>
|
||||
#include "mbboDirectRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -61,26 +61,26 @@
|
||||
* .26 03-29-94 mcn Converted to Fast Links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <mbboRecord.h>
|
||||
#include "mbboRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <menuIvoa.h>
|
||||
#include "menuIvoa.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -32,24 +32,24 @@
|
||||
* .01 04-19-94 mcn R3.12ified
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <pal.h>
|
||||
#include <special.h>
|
||||
#include "alarm.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>
|
||||
#include "palRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -37,20 +37,21 @@
|
||||
* .05 07-16-92 jba added invalid alarm fwd link test and chngd fwd lnk to macro
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <permissiveRecord.h>
|
||||
#include "permissiveRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -44,24 +44,23 @@
|
||||
* .12 03-29-94 mcn Converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
/*since tickLib is not defined just define tickGet*/
|
||||
unsigned long tickGet();
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "osiClock.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <pidRecord.h>
|
||||
#include "pidRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
@@ -374,7 +373,7 @@ struct pidRecord *ppid;
|
||||
|
||||
/* compute time difference and make sure it is large enough*/
|
||||
ctp = ppid->ct;
|
||||
ct = tickGet();
|
||||
ct = clockGetCurrentTick();
|
||||
if(ctp==0) {/*this happens the first time*/
|
||||
dt=0.0;
|
||||
} else {
|
||||
@@ -384,7 +383,7 @@ struct pidRecord *ppid;
|
||||
dt = (unsigned long)(0xffffffff) - ctp;
|
||||
dt = dt + ct + 1;
|
||||
}
|
||||
dt = dt/vxTicksPerSecond;
|
||||
dt = dt/clockGetRate();
|
||||
if(dt<ppid->mdt) return(1);
|
||||
}
|
||||
/* get the rest of values needed */
|
||||
|
||||
@@ -38,24 +38,24 @@
|
||||
* .07 07-16-92 jba added invalid alarm fwd link test and chngd fwd lnk to macro
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <callback.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "callback.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <pulseCounterRecord.h>
|
||||
#include "pulseCounterRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
* .10 10-20-92 jbk added get_enum funcs, allowed defaults in fields
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -44,22 +44,23 @@
|
||||
* .13 10-18-92 jba pact now set in recGblGetLinkValue
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <pulseTrainRecord.h>
|
||||
#include "pulseTrainRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -1,538 +0,0 @@
|
||||
/*recDynLink.c*/
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
#include <vxWorks.h>
|
||||
#include <taskLib.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <rngLib.h>
|
||||
#include <vxLib.h>
|
||||
#include <semLib.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
#include <dbDefs.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <taskwd.h>
|
||||
#include <fast_lock.h>
|
||||
#include <db_access.h>
|
||||
#include <cadef.h>
|
||||
#include <caerr.h>
|
||||
#include <caeventmask.h>
|
||||
#include <tsDefs.h>
|
||||
#include <task_params.h>
|
||||
#include <recDynLink.h>
|
||||
|
||||
|
||||
/*Definitions to map between old and new database access*/
|
||||
/*because we are using CA must include db_access.h*/
|
||||
/* new field types */
|
||||
#define newDBF_STRING 0
|
||||
#define newDBF_CHAR 1
|
||||
#define newDBF_UCHAR 2
|
||||
#define newDBF_SHORT 3
|
||||
#define newDBF_USHORT 4
|
||||
#define newDBF_LONG 5
|
||||
#define newDBF_ULONG 6
|
||||
#define newDBF_FLOAT 7
|
||||
#define newDBF_DOUBLE 8
|
||||
#define newDBF_ENUM 9
|
||||
|
||||
/* new data request buffer types */
|
||||
#define newDBR_STRING newDBF_STRING
|
||||
#define newDBR_CHAR newDBF_CHAR
|
||||
#define newDBR_UCHAR newDBF_UCHAR
|
||||
#define newDBR_SHORT newDBF_SHORT
|
||||
#define newDBR_USHORT newDBF_USHORT
|
||||
#define newDBR_LONG newDBF_LONG
|
||||
#define newDBR_ULONG newDBF_ULONG
|
||||
#define newDBR_FLOAT newDBF_FLOAT
|
||||
#define newDBR_DOUBLE newDBF_DOUBLE
|
||||
#define newDBR_ENUM newDBF_ENUM
|
||||
#define VALID_newDB_REQ(x) ((x >= 0) && (x <= newDBR_ENUM))
|
||||
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};
|
||||
|
||||
extern int interruptAccept;
|
||||
|
||||
int recDynLinkQsize = 256;
|
||||
|
||||
LOCAL int inpTaskId=0;
|
||||
LOCAL int outTaskId=0;
|
||||
LOCAL RING_ID inpRingQ;
|
||||
LOCAL RING_ID outRingQ;
|
||||
LOCAL SEM_ID wakeUpSem;
|
||||
|
||||
typedef enum{cmdSearch,cmdClear,cmdPut} cmdType;
|
||||
typedef enum{ioInput,ioOutput}ioType;
|
||||
typedef enum{stateStarting,stateSearching,stateGetting,stateConnected}stateType;
|
||||
|
||||
typedef struct dynLinkPvt{
|
||||
FAST_LOCK lock;
|
||||
char *pvname;
|
||||
chid chid;
|
||||
evid evid;
|
||||
recDynCallback searchCallback;
|
||||
recDynCallback monitorCallback;
|
||||
TS_STAMP timestamp;
|
||||
short status;
|
||||
short severity;
|
||||
void *pbuffer;
|
||||
size_t nRequest;
|
||||
short dbrType;
|
||||
double graphicLow,graphHigh;
|
||||
double controlLow,controlHigh;
|
||||
char units[MAX_UNITS_SIZE];
|
||||
short precision;
|
||||
ioType io;
|
||||
stateType state;
|
||||
short scalar;
|
||||
} dynLinkPvt;
|
||||
|
||||
/*For cmdClear data is chid. For all other commands precDynLink*/
|
||||
typedef struct {
|
||||
union {
|
||||
recDynLink *precDynLink;
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
}data;
|
||||
cmdType cmd;
|
||||
}ringBufCmd;
|
||||
|
||||
LOCAL void recDynLinkStartInput(void);
|
||||
LOCAL void recDynLinkStartOutput(void);
|
||||
LOCAL void connectCallback(struct connection_handler_args cha);
|
||||
LOCAL void getCallback(struct event_handler_args eha);
|
||||
LOCAL void monitorCallback(struct event_handler_args eha);
|
||||
LOCAL void recDynLinkInp(void);
|
||||
LOCAL void recDynLinkOut(void);
|
||||
|
||||
long recDynLinkAddInput(recDynLink *precDynLink,char *pvname,
|
||||
short dbrType,int options,
|
||||
recDynCallback searchCallback,recDynCallback monitorCallback)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
struct dbAddr dbaddr;
|
||||
ringBufCmd cmd;
|
||||
|
||||
|
||||
if(options&rdlDBONLY && db_name_to_addr(pvname,&dbaddr))return(-1);
|
||||
if(!inpTaskId) recDynLinkStartInput();
|
||||
if(precDynLink->pdynLinkPvt) recDynLinkClear(precDynLink);
|
||||
pdynLinkPvt = (dynLinkPvt *)calloc(1,sizeof(dynLinkPvt));
|
||||
if(!pdynLinkPvt) {
|
||||
printf("recDynLinkAddInput can't allocate storage");
|
||||
taskSuspend(0);
|
||||
}
|
||||
FASTLOCKINIT(&pdynLinkPvt->lock);
|
||||
precDynLink->pdynLinkPvt = pdynLinkPvt;
|
||||
pdynLinkPvt->pvname = pvname;
|
||||
pdynLinkPvt->dbrType = dbrType;
|
||||
pdynLinkPvt->searchCallback = searchCallback;
|
||||
pdynLinkPvt->monitorCallback = monitorCallback;
|
||||
pdynLinkPvt->io = ioInput;
|
||||
pdynLinkPvt->scalar = (options&rdlSCALAR) ? TRUE : FALSE;
|
||||
pdynLinkPvt->state = stateStarting;
|
||||
cmd.data.precDynLink = precDynLink;
|
||||
cmd.cmd = cmdSearch;
|
||||
if(rngBufPut(inpRingQ,(void *)&cmd,sizeof(cmd)) != sizeof(cmd))
|
||||
errMessage(0,"recDynLinkAddInput: rngBufPut error");
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkAddOutput(recDynLink *precDynLink,char *pvname,
|
||||
short dbrType,int options,
|
||||
recDynCallback searchCallback)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
struct dbAddr dbaddr;
|
||||
ringBufCmd cmd;
|
||||
|
||||
|
||||
if(options&rdlDBONLY && db_name_to_addr(pvname,&dbaddr))return(-1);
|
||||
if(!outTaskId) recDynLinkStartOutput();
|
||||
if(precDynLink->pdynLinkPvt) recDynLinkClear(precDynLink);
|
||||
pdynLinkPvt = (dynLinkPvt *)calloc(1,sizeof(dynLinkPvt));
|
||||
if(!pdynLinkPvt) {
|
||||
printf("recDynLinkAddOutput can't allocate storage");
|
||||
taskSuspend(0);
|
||||
}
|
||||
FASTLOCKINIT(&pdynLinkPvt->lock);
|
||||
precDynLink->pdynLinkPvt = pdynLinkPvt;
|
||||
pdynLinkPvt->pvname = pvname;
|
||||
pdynLinkPvt->dbrType = dbrType;
|
||||
pdynLinkPvt->searchCallback = searchCallback;
|
||||
pdynLinkPvt->io = ioOutput;
|
||||
pdynLinkPvt->scalar = (options&rdlSCALAR) ? TRUE : FALSE;
|
||||
pdynLinkPvt->state = stateStarting;
|
||||
cmd.data.precDynLink = precDynLink;
|
||||
cmd.cmd = cmdSearch;
|
||||
if(rngBufPut(outRingQ,(void *)&cmd,sizeof(cmd)) != sizeof(cmd))
|
||||
errMessage(0,"recDynLinkAddInput: rngBufPut error");
|
||||
semGive(wakeUpSem);
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkClear(recDynLink *precDynLink)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
ringBufCmd cmd;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(!pdynLinkPvt) {
|
||||
printf("recDynLinkClear. recDynLinkSearch was never called\n");
|
||||
taskSuspend(0);
|
||||
}
|
||||
if(pdynLinkPvt->chid) ca_puser(pdynLinkPvt->chid) = NULL;
|
||||
cmd.data.pdynLinkPvt = pdynLinkPvt;
|
||||
cmd.cmd = cmdClear;
|
||||
if(pdynLinkPvt->io==ioInput) {
|
||||
if(rngBufPut(inpRingQ,(void *)&cmd,sizeof(cmd)) != sizeof(cmd))
|
||||
errMessage(0,"recDynLinkClear: rngBufPut error");
|
||||
} else {
|
||||
if(rngBufPut(outRingQ,(void *)&cmd,sizeof(cmd)) != sizeof(cmd))
|
||||
errMessage(0,"recDynLinkClear: rngBufPut error");
|
||||
}
|
||||
precDynLink->pdynLinkPvt = NULL;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkConnectionStatus(recDynLink *precDynLink)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
long status;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
status = (ca_state(pdynLinkPvt->chid)==cs_conn) ? 0 : -1;
|
||||
return(status);
|
||||
}
|
||||
|
||||
long recDynLinkGetNelem(recDynLink *precDynLink,size_t *nelem)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(ca_state(pdynLinkPvt->chid)!=cs_conn) return(-1);
|
||||
*nelem = ca_element_count(pdynLinkPvt->chid);
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkGetControlLimits(recDynLink *precDynLink,
|
||||
double *low,double *high)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(pdynLinkPvt->state!=stateConnected) return(-1);
|
||||
if(low) *low = pdynLinkPvt->controlLow;
|
||||
if(high) *high = pdynLinkPvt->controlHigh;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkGetGraphicLimits(recDynLink *precDynLink,
|
||||
double *low,double *high)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(pdynLinkPvt->state!=stateConnected) return(-1);
|
||||
if(low) *low = pdynLinkPvt->graphicLow;
|
||||
if(high) *high = pdynLinkPvt->graphHigh;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkGetPrecision(recDynLink *precDynLink,int *prec)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(pdynLinkPvt->state!=stateConnected) return(-1);
|
||||
if(prec) *prec = pdynLinkPvt->precision;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkGetUnits(recDynLink *precDynLink,char *units,int maxlen)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
int maxToCopy;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(pdynLinkPvt->state!=stateConnected) return(-1);
|
||||
maxToCopy = MAX_UNITS_SIZE;
|
||||
if(maxlen<maxToCopy) maxToCopy = maxlen;
|
||||
strncpy(units,pdynLinkPvt->units,maxToCopy);
|
||||
if(maxToCopy<maxlen) units[maxToCopy] = '\0';
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recDynLinkGet(recDynLink *precDynLink,void *pbuffer,size_t *nRequest,
|
||||
TS_STAMP *timestamp,short *status,short *severity)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
long caStatus;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
caStatus = (ca_state(pdynLinkPvt->chid)==cs_conn) ? 0 : -1;
|
||||
if(caStatus) goto all_done;
|
||||
if(*nRequest > pdynLinkPvt->nRequest) {
|
||||
*nRequest = pdynLinkPvt->nRequest;
|
||||
}
|
||||
FASTLOCK(&pdynLinkPvt->lock);
|
||||
memcpy(pbuffer,pdynLinkPvt->pbuffer,
|
||||
(*nRequest * dbr_size[mapNewToOld[pdynLinkPvt->dbrType]]));
|
||||
if(timestamp) *timestamp = pdynLinkPvt->timestamp; /*array copy*/
|
||||
if(status) *status = pdynLinkPvt->status;
|
||||
if(severity) *severity = pdynLinkPvt->severity;
|
||||
FASTUNLOCK(&pdynLinkPvt->lock);
|
||||
all_done:
|
||||
return(caStatus);
|
||||
}
|
||||
|
||||
long recDynLinkPut(recDynLink *precDynLink,void *pbuffer,size_t nRequest)
|
||||
{
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
long status;
|
||||
ringBufCmd cmd;
|
||||
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(pdynLinkPvt->io!=ioOutput || pdynLinkPvt->state!=stateConnected) {
|
||||
status = -1;
|
||||
} else {
|
||||
status = (ca_state(pdynLinkPvt->chid)==cs_conn) ? 0 : -1;
|
||||
}
|
||||
if(status) goto all_done;
|
||||
if(pdynLinkPvt->scalar) nRequest = 1;
|
||||
if(nRequest>ca_element_count(pdynLinkPvt->chid))
|
||||
nRequest = ca_element_count(pdynLinkPvt->chid);
|
||||
pdynLinkPvt->nRequest = nRequest;
|
||||
memcpy(pdynLinkPvt->pbuffer,pbuffer,
|
||||
(nRequest * dbr_size[mapNewToOld[pdynLinkPvt->dbrType]]));
|
||||
cmd.data.precDynLink = precDynLink;
|
||||
cmd.cmd = cmdPut;
|
||||
if(rngBufPut(outRingQ,(void *)&cmd,sizeof(cmd)) != sizeof(cmd))
|
||||
errMessage(0,"recDynLinkPut: rngBufPut error");
|
||||
semGive(wakeUpSem);
|
||||
all_done:
|
||||
return(status);
|
||||
}
|
||||
|
||||
LOCAL void recDynLinkStartInput(void)
|
||||
{
|
||||
if((inpRingQ = rngCreate(sizeof(ringBufCmd) * recDynLinkQsize)) == NULL) {
|
||||
errMessage(0,"recDynLinkStart failed");
|
||||
exit(1);
|
||||
}
|
||||
inpTaskId = taskSpawn("recDynINP",CA_CLIENT_PRI-1,VX_FP_TASK,
|
||||
CA_CLIENT_STACK,(FUNCPTR)recDynLinkInp,0,0,0,0,0,0,0,0,0,0);
|
||||
if(inpTaskId==ERROR) {
|
||||
errMessage(0,"recDynLinkStartInput: taskSpawn Failure\n");
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL void recDynLinkStartOutput(void)
|
||||
{
|
||||
if((wakeUpSem=semBCreate(SEM_Q_FIFO,SEM_EMPTY))==NULL)
|
||||
errMessage(0,"semBcreate failed in recDynLinkStart");
|
||||
if((outRingQ = rngCreate(sizeof(ringBufCmd) * recDynLinkQsize)) == NULL) {
|
||||
errMessage(0,"recDynLinkStartOutput failed");
|
||||
exit(1);
|
||||
}
|
||||
outTaskId = taskSpawn("recDynOUT",CA_CLIENT_PRI-1,VX_FP_TASK,
|
||||
CA_CLIENT_STACK,(FUNCPTR)recDynLinkOut,0,0,0,0,0,0,0,0,0,0);
|
||||
if(outTaskId==ERROR) {
|
||||
errMessage(0,"recDynLinkStart: taskSpawn Failure\n");
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL void connectCallback(struct connection_handler_args cha)
|
||||
{
|
||||
chid chid = cha.chid;
|
||||
recDynLink *precDynLink;
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
|
||||
precDynLink = (recDynLink *)ca_puser(cha.chid);
|
||||
if(!precDynLink) return;
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(ca_state(chid)==cs_conn) {
|
||||
pdynLinkPvt->state = stateGetting;
|
||||
SEVCHK(ca_get_callback(DBR_CTRL_DOUBLE,chid,getCallback,precDynLink),
|
||||
"ca_get_callback");
|
||||
} else {
|
||||
if(pdynLinkPvt->searchCallback)
|
||||
(pdynLinkPvt->searchCallback)(precDynLink);
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL void getCallback(struct event_handler_args eha)
|
||||
{
|
||||
struct dbr_ctrl_double *pdata = (struct dbr_ctrl_double *)eha.dbr;
|
||||
recDynLink *precDynLink;
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
size_t nRequest;
|
||||
|
||||
precDynLink = (recDynLink *)ca_puser(eha.chid);
|
||||
if(!precDynLink) return;
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
pdynLinkPvt -> graphicLow = pdata->lower_disp_limit;
|
||||
pdynLinkPvt -> graphHigh = pdata->upper_disp_limit;
|
||||
pdynLinkPvt -> controlLow = pdata->lower_ctrl_limit;
|
||||
pdynLinkPvt -> controlHigh = pdata->upper_ctrl_limit;
|
||||
pdynLinkPvt -> precision = pdata->precision;
|
||||
strncpy(pdynLinkPvt->units,pdata->units,MAX_UNITS_SIZE);
|
||||
if(pdynLinkPvt->scalar) {
|
||||
pdynLinkPvt->nRequest = 1;
|
||||
} else {
|
||||
pdynLinkPvt->nRequest = ca_element_count(pdynLinkPvt->chid);
|
||||
}
|
||||
nRequest = pdynLinkPvt->nRequest;
|
||||
pdynLinkPvt->pbuffer = calloc(nRequest,
|
||||
dbr_size[mapNewToOld[pdynLinkPvt->dbrType]]);
|
||||
if(pdynLinkPvt->io==ioInput) {
|
||||
SEVCHK(ca_add_array_event(
|
||||
dbf_type_to_DBR_TIME(mapNewToOld[pdynLinkPvt->dbrType]),
|
||||
pdynLinkPvt->nRequest,
|
||||
pdynLinkPvt->chid,monitorCallback,precDynLink,
|
||||
0.0,0.0,0.0,
|
||||
&pdynLinkPvt->evid),"ca_add_array_event");
|
||||
}
|
||||
pdynLinkPvt->state = stateConnected;
|
||||
if(pdynLinkPvt->searchCallback) (pdynLinkPvt->searchCallback)(precDynLink);
|
||||
}
|
||||
|
||||
LOCAL void monitorCallback(struct event_handler_args eha)
|
||||
{
|
||||
recDynLink *precDynLink;
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
long count = eha.count;
|
||||
const void *pbuffer = eha.dbr;
|
||||
struct dbr_time_string *pdbr_time_string;
|
||||
void *pdata;
|
||||
short timeType;
|
||||
|
||||
precDynLink = (recDynLink *)ca_puser(eha.chid);
|
||||
if(!precDynLink) return;
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
if(pdynLinkPvt->pbuffer) {
|
||||
FASTLOCK(&pdynLinkPvt->lock);
|
||||
if(count>=pdynLinkPvt->nRequest)
|
||||
count = pdynLinkPvt->nRequest;
|
||||
pdbr_time_string = (struct dbr_time_string *)pbuffer;
|
||||
timeType = dbf_type_to_DBR_TIME(mapNewToOld[pdynLinkPvt->dbrType]);
|
||||
pdata = (void *)((char *)pbuffer + dbr_value_offset[timeType]);
|
||||
pdynLinkPvt->timestamp = pdbr_time_string->stamp; /*array copy*/
|
||||
pdynLinkPvt->status = pdbr_time_string->status;
|
||||
pdynLinkPvt->severity = pdbr_time_string->severity;
|
||||
memcpy(pdynLinkPvt->pbuffer,pdata,
|
||||
(count * dbr_size[mapNewToOld[pdynLinkPvt->dbrType]]));
|
||||
FASTUNLOCK(&pdynLinkPvt->lock);
|
||||
}
|
||||
if(pdynLinkPvt->monitorCallback)
|
||||
(*pdynLinkPvt->monitorCallback)(precDynLink);
|
||||
}
|
||||
|
||||
LOCAL void recDynLinkInp(void)
|
||||
{
|
||||
int status;
|
||||
recDynLink *precDynLink;
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
ringBufCmd cmd;
|
||||
|
||||
taskwdInsert(taskIdSelf(),NULL,NULL);
|
||||
SEVCHK(ca_task_initialize(),"ca_task_initialize");
|
||||
while(TRUE) {
|
||||
while (rngNBytes(inpRingQ)>=sizeof(cmd) && interruptAccept){
|
||||
if(rngBufGet(inpRingQ,(void *)&cmd,sizeof(cmd))
|
||||
!=sizeof(cmd)) {
|
||||
errMessage(0,"recDynLinkTask: rngBufGet error");
|
||||
continue;
|
||||
}
|
||||
if(cmd.cmd==cmdClear) {
|
||||
pdynLinkPvt = cmd.data.pdynLinkPvt;
|
||||
if(pdynLinkPvt->chid)
|
||||
SEVCHK(ca_clear_channel(pdynLinkPvt->chid),
|
||||
"ca_clear_channel");
|
||||
free(pdynLinkPvt->pbuffer);
|
||||
free((void *)pdynLinkPvt);
|
||||
continue;
|
||||
}
|
||||
precDynLink = cmd.data.precDynLink;
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
switch(cmd.cmd) {
|
||||
case(cmdSearch) :
|
||||
SEVCHK(ca_search_and_connect(pdynLinkPvt->pvname,
|
||||
&pdynLinkPvt->chid, connectCallback,precDynLink),
|
||||
"ca_search_and_connect");
|
||||
break;
|
||||
default:
|
||||
epicsPrintf("Logic error statement in recDynLinkTask\n");
|
||||
}
|
||||
}
|
||||
status = ca_pend_event(.1);
|
||||
if(status!=ECA_NORMAL && status!=ECA_TIMEOUT)
|
||||
SEVCHK(status,"ca_pend_event");
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL void recDynLinkOut(void)
|
||||
{
|
||||
int status;
|
||||
recDynLink *precDynLink;
|
||||
dynLinkPvt *pdynLinkPvt;
|
||||
ringBufCmd cmd;
|
||||
int caStatus;
|
||||
|
||||
taskwdInsert(taskIdSelf(),NULL,NULL);
|
||||
SEVCHK(ca_task_initialize(),"ca_task_initialize");
|
||||
while(TRUE) {
|
||||
semTake(wakeUpSem,sysClkRateGet());
|
||||
while (rngNBytes(outRingQ)>=sizeof(cmd) && interruptAccept){
|
||||
if(rngBufGet(outRingQ,(void *)&cmd,sizeof(cmd))
|
||||
!=sizeof(cmd)) {
|
||||
errMessage(0,"recDynLinkTask: rngBufGet error");
|
||||
continue;
|
||||
}
|
||||
if(cmd.cmd==cmdClear) {
|
||||
pdynLinkPvt = cmd.data.pdynLinkPvt;
|
||||
if(pdynLinkPvt->chid)
|
||||
SEVCHK(ca_clear_channel(pdynLinkPvt->chid),
|
||||
"ca_clear_channel");
|
||||
free(pdynLinkPvt->pbuffer);
|
||||
free((void *)pdynLinkPvt);
|
||||
continue;
|
||||
}
|
||||
precDynLink = cmd.data.precDynLink;
|
||||
pdynLinkPvt = precDynLink->pdynLinkPvt;
|
||||
switch(cmd.cmd) {
|
||||
case(cmdSearch) :
|
||||
SEVCHK(ca_search_and_connect(pdynLinkPvt->pvname,
|
||||
&pdynLinkPvt->chid, connectCallback,precDynLink),
|
||||
"ca_search_and_connect");
|
||||
break;
|
||||
case(cmdPut) :
|
||||
caStatus = ca_array_put(
|
||||
mapNewToOld[pdynLinkPvt->dbrType],
|
||||
pdynLinkPvt->nRequest,pdynLinkPvt->chid,
|
||||
pdynLinkPvt->pbuffer);
|
||||
if(caStatus!=ECA_NORMAL) {
|
||||
epicsPrintf("recDynLinkTask pv=%s CA Error %s\n",
|
||||
pdynLinkPvt->pvname,ca_message(caStatus));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
epicsPrintf("Logic error statement in recDynLinkTask\n");
|
||||
}
|
||||
}
|
||||
status = ca_pend_event(.00001);
|
||||
if(status!=ECA_NORMAL && status!=ECA_TIMEOUT)
|
||||
SEVCHK(status,"ca_pend_event");
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*recDynLink.c*/
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
*******************************************************************/
|
||||
#ifndef INCrecDynLinkh
|
||||
#define INCrecDynLinkh
|
||||
|
||||
#include <tsDefs.h>
|
||||
typedef struct recDynLink{
|
||||
void *puserPvt;
|
||||
void *pdynLinkPvt;
|
||||
} recDynLink;
|
||||
typedef void (*recDynCallback)(recDynLink *);
|
||||
|
||||
#define rdlDBONLY 0x1
|
||||
#define rdlSCALAR 0x2
|
||||
|
||||
long recDynLinkAddInput(recDynLink *precDynLink,char *pvname,
|
||||
short dbrType,int options,
|
||||
recDynCallback searchCallback,recDynCallback monitorCallback);
|
||||
long recDynLinkAddOutput(recDynLink *precDynLink,char *pvname,
|
||||
short dbrType,int options,
|
||||
recDynCallback searchCallback);
|
||||
long recDynLinkClear(recDynLink *precDynLink);
|
||||
/*The following routine returns (0,-1) for (connected,not connected)*/
|
||||
long recDynLinkConnectionStatus(recDynLink *precDynLink);
|
||||
/*thye following routine returns (0,-1) if (connected,not connected)*/
|
||||
long recDynLinkGetNelem(recDynLink *precDynLink,size_t *nelem);
|
||||
/*The following 4 routines return (0,-1) if data (is, is not) yet available*/
|
||||
/*searchCallback is not called until this info is available*/
|
||||
long recDynLinkGetControlLimits(recDynLink *precDynLink,
|
||||
double *low,double *high);
|
||||
long recDynLinkGetGraphicLimits(recDynLink *precDynLink,
|
||||
double *low,double *high);
|
||||
long recDynLinkGetPrecision(recDynLink *precDynLink,int *prec);
|
||||
long recDynLinkGetUnits(recDynLink *precDynLink,char *units,int maxlen);
|
||||
|
||||
/*get only valid mfor rdlINPUT. put only valid for rdlOUTPUT*/
|
||||
long recDynLinkGet(recDynLink *precDynLink,
|
||||
void *pbuffer, size_t *nRequest,
|
||||
TS_STAMP *timestamp,short *status,short *severity);
|
||||
long recDynLinkPut(recDynLink *precDynLink,void *pbuffer,size_t nRequest);
|
||||
|
||||
#endif /*INCrecDynLinkh*/
|
||||
@@ -1,192 +0,0 @@
|
||||
/*recDynLinkTest.c */
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
***********************************************************************/
|
||||
#include <vxWorks.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <tsDefs.h>
|
||||
#include <recDynLink.h>
|
||||
#include <dbAccess.h>
|
||||
|
||||
/*The remainder of this source module is test code */
|
||||
typedef struct userPvt {
|
||||
char *pvname;
|
||||
double *pbuffer;
|
||||
size_t nRequest;
|
||||
}userPvt;
|
||||
|
||||
LOCAL void mymonitorCallback(recDynLink *precDynLink)
|
||||
{
|
||||
userPvt *puserPvt;
|
||||
long status;
|
||||
size_t nRequest;
|
||||
TS_STAMP timestamp;
|
||||
short AlarmStatus,AlarmSeverity;
|
||||
int i;
|
||||
char timeStr[40];
|
||||
|
||||
puserPvt = (userPvt *)precDynLink->puserPvt;
|
||||
printf("mymonitorCallback: %s\n",puserPvt->pvname);
|
||||
if(recDynLinkConnectionStatus(precDynLink)!=0) {
|
||||
printf(" not connected\n");
|
||||
return;
|
||||
}
|
||||
nRequest = puserPvt->nRequest;
|
||||
status = recDynLinkGet(precDynLink,puserPvt->pbuffer,&nRequest,
|
||||
×tamp,&AlarmStatus,&AlarmSeverity);
|
||||
if(status) {
|
||||
printf("recDynLinkGet returned illegal status\n");
|
||||
return;
|
||||
}
|
||||
tsStampToText(×tamp,TS_TEXT_MMDDYY,timeStr);
|
||||
printf("date %s status %hd severity %hd ",
|
||||
timeStr,AlarmStatus,AlarmSeverity);
|
||||
for(i=0; i<puserPvt->nRequest; i++) {
|
||||
printf(" %f",puserPvt->pbuffer[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
LOCAL void mysearchCallback(recDynLink *precDynLink)
|
||||
{
|
||||
userPvt *puserPvt;
|
||||
size_t nelem;
|
||||
double controlLow,controlHigh;
|
||||
double graphicLow,graphicHigh;
|
||||
int prec;
|
||||
char units[20];
|
||||
long status;
|
||||
|
||||
puserPvt = (userPvt *)precDynLink->puserPvt;
|
||||
printf("mysearchCallback: %s ",puserPvt->pvname);
|
||||
if(recDynLinkConnectionStatus(precDynLink)==0) {
|
||||
printf("connected\n");
|
||||
status = recDynLinkGetNelem(precDynLink,&nelem);
|
||||
if(status) {
|
||||
printf("recDynLinkGetNelem failed\n");
|
||||
}else{
|
||||
printf("nelem = %u\n",nelem);
|
||||
}
|
||||
status=recDynLinkGetControlLimits(precDynLink,&controlLow,&controlHigh);
|
||||
if(status) {
|
||||
printf("recDynLinkGetControlLimits failed\n");
|
||||
}else{
|
||||
printf("controlLow %f controlHigh %f\n",controlLow,controlHigh);
|
||||
}
|
||||
status=recDynLinkGetGraphicLimits(precDynLink,&graphicLow,&graphicHigh);
|
||||
if(status) {
|
||||
printf("recDynLinkGetGraphicLimits failed\n");
|
||||
}else{
|
||||
printf("graphicLow %f graphicHigh %f\n",graphicLow,graphicHigh);
|
||||
}
|
||||
status = recDynLinkGetPrecision(precDynLink,&prec);
|
||||
if(status) {
|
||||
printf("recDynLinkGetPrecision failed\n");
|
||||
}else{
|
||||
printf("prec = %d\n",prec);
|
||||
}
|
||||
status = recDynLinkGetUnits(precDynLink,units,20);
|
||||
if(status) {
|
||||
printf("recDynLinkGetUnits failed\n");
|
||||
}else{
|
||||
printf("units = %s\n",units);
|
||||
}
|
||||
} else {
|
||||
printf(" not connected\n");
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL recDynLink getDynlink = {NULL,NULL};
|
||||
LOCAL recDynLink putDynlink = {NULL,NULL};
|
||||
|
||||
int recDynTestInput(char *pvname,int nRequest)
|
||||
{
|
||||
userPvt *puserPvt= getDynlink.puserPvt;
|
||||
long status;
|
||||
int options=0;
|
||||
|
||||
if(puserPvt) {
|
||||
recDynLinkClear(&getDynlink);
|
||||
free(puserPvt->pbuffer);
|
||||
free(getDynlink.puserPvt);
|
||||
getDynlink.puserPvt = NULL;
|
||||
}
|
||||
getDynlink.puserPvt = puserPvt = (userPvt *)calloc(1,sizeof(userPvt));
|
||||
puserPvt->pbuffer = calloc(nRequest,sizeof(double));
|
||||
puserPvt->nRequest = nRequest;
|
||||
puserPvt->pvname = pvname;
|
||||
if(nRequest==1) options=rdlSCALAR;;
|
||||
status = recDynLinkAddInput(&getDynlink,pvname,
|
||||
DBR_DOUBLE,options,
|
||||
mysearchCallback,mymonitorCallback);
|
||||
if(status) return(status);
|
||||
return(status);
|
||||
}
|
||||
|
||||
int recDynTestNewOutput(char *pvname,int nRequest)
|
||||
{
|
||||
userPvt *puserPvt= putDynlink.puserPvt;
|
||||
long status;
|
||||
int options=0;
|
||||
|
||||
if(puserPvt) {
|
||||
recDynLinkClear(&putDynlink);
|
||||
free(puserPvt->pbuffer);
|
||||
free(putDynlink.puserPvt);
|
||||
putDynlink.puserPvt = NULL;
|
||||
}
|
||||
putDynlink.puserPvt = puserPvt = (userPvt *)calloc(1,sizeof(userPvt));
|
||||
puserPvt->pbuffer = calloc(nRequest,sizeof(double));
|
||||
puserPvt->nRequest = nRequest;
|
||||
puserPvt->pvname = pvname;
|
||||
if(nRequest==1) options=rdlSCALAR;;
|
||||
status = recDynLinkAddOutput(&putDynlink,pvname,
|
||||
DBR_DOUBLE,options,mysearchCallback);
|
||||
return(status);
|
||||
}
|
||||
|
||||
int recDynTestOutput(int startValue)
|
||||
{
|
||||
userPvt *puserPvt= putDynlink.puserPvt;
|
||||
long status;
|
||||
int i;
|
||||
|
||||
for(i=0; i<puserPvt->nRequest; i++) puserPvt->pbuffer[i] = startValue + i;
|
||||
status = recDynLinkPut(&putDynlink,puserPvt->pbuffer,puserPvt->nRequest);
|
||||
return(status);
|
||||
}
|
||||
|
||||
int recDynTestClearInput(void)
|
||||
{
|
||||
userPvt *puserPvt= getDynlink.puserPvt;
|
||||
|
||||
recDynLinkClear(&getDynlink);
|
||||
free(puserPvt->pbuffer);
|
||||
free(getDynlink.puserPvt);
|
||||
getDynlink.puserPvt = NULL;
|
||||
return(0);
|
||||
}
|
||||
|
||||
int recDynTestClearOutput(void)
|
||||
{
|
||||
userPvt *puserPvt= putDynlink.puserPvt;
|
||||
|
||||
recDynLinkClear(&putDynlink);
|
||||
free(puserPvt->pbuffer);
|
||||
free(putDynlink.puserPvt);
|
||||
putDynlink.puserPvt = NULL;
|
||||
return(0);
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
/*
|
||||
* 07-27-95 nda made QUEUE_SIZE a global variable so it could
|
||||
* be changed at boot time for LOTS OF WAIT records
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <taskLib.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <rngLib.h>
|
||||
#include <vxLib.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <taskwd.h>
|
||||
#include <fast_lock.h>
|
||||
#include <cadef.h>
|
||||
#include <caerr.h>
|
||||
#include <caeventmask.h>
|
||||
#include <task_params.h>
|
||||
#include <recWaitCa.h>
|
||||
|
||||
extern int interruptAccept;
|
||||
|
||||
int recWaitCaQsize = 256;
|
||||
|
||||
LOCAL int taskid=0;
|
||||
LOCAL RING_ID ringQ;
|
||||
LOCAL FAST_LOCK lock;
|
||||
|
||||
typedef enum {cmdNone,cmdAdd,cmdRemove} COMMAND;
|
||||
|
||||
typedef struct {
|
||||
RECWAITCA *pcamonitor;
|
||||
chid chid;
|
||||
evid evid;
|
||||
COMMAND cmd;
|
||||
int hasMonitor;
|
||||
struct dbr_sts_double rtndata; /*Not currently used */
|
||||
} CAPVT;
|
||||
|
||||
void recWaitCaTask(void);
|
||||
|
||||
LOCAL void eventCallback(struct event_handler_args eha)
|
||||
{
|
||||
const struct dbr_sts_double *pdata = eha.dbr;
|
||||
CAPVT *pcapvt;
|
||||
RECWAITCA *pcamonitor;
|
||||
|
||||
pcapvt = (CAPVT *)eha.usr;
|
||||
pcamonitor = pcapvt->pcamonitor;
|
||||
(pcamonitor->callback)(pcamonitor, pcamonitor->inputIndex, pdata->value);
|
||||
}
|
||||
|
||||
LOCAL void recWaitCaStart(void)
|
||||
{
|
||||
FASTLOCKINIT(&lock);
|
||||
if((ringQ = rngCreate(sizeof(void *) * recWaitCaQsize)) == NULL) {
|
||||
errMessage(0,"recWaitCaStart failed");
|
||||
exit(1);
|
||||
}
|
||||
taskid = taskSpawn("recWaitCaTask",CA_CLIENT_PRI-1,VX_FP_TASK,
|
||||
CA_CLIENT_STACK,(FUNCPTR)recWaitCaTask,0,0,0,0,0,0,0,0,0,0);
|
||||
if(taskid==ERROR) {
|
||||
errMessage(0,"recWaitCaStart: taskSpawn Failure\n");
|
||||
}
|
||||
}
|
||||
|
||||
long recWaitCaAdd(RECWAITCA *pcamonitor)
|
||||
{
|
||||
CAPVT *pcapvt;
|
||||
|
||||
if(!taskid) recWaitCaStart();
|
||||
FASTLOCK(&lock);
|
||||
pcapvt = pcamonitor->recWaitCaPvt;
|
||||
if(pcapvt == NULL) {
|
||||
pcapvt = calloc(1,sizeof(CAPVT));
|
||||
pcamonitor->recWaitCaPvt = pcapvt;
|
||||
pcapvt->pcamonitor = pcamonitor;
|
||||
}
|
||||
pcapvt->cmd = cmdAdd;
|
||||
if(rngBufPut(ringQ,(void *)&pcapvt,sizeof(pcapvt))
|
||||
!=sizeof(pcamonitor)) errMessage(0,"recWaitCaAdd: rngBufPut error");
|
||||
FASTUNLOCK(&lock);
|
||||
return(0);
|
||||
}
|
||||
|
||||
long recWaitCaDelete(RECWAITCA *pcamonitor)
|
||||
{
|
||||
CAPVT *pcapvt = pcamonitor->recWaitCaPvt;
|
||||
|
||||
FASTLOCK(&lock);
|
||||
pcapvt->cmd = cmdRemove;
|
||||
if(rngBufPut(ringQ,(void *)&pcapvt,sizeof(pcapvt))
|
||||
!=sizeof(pcamonitor)) errMessage(0,"recWaitCaDelete: rngBufPut error");
|
||||
FASTUNLOCK(&lock);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*LOCAL */
|
||||
void recWaitCaTask(void)
|
||||
{
|
||||
CAPVT *pcapvt;
|
||||
RECWAITCA *pcamonitor;
|
||||
int status;
|
||||
|
||||
taskwdInsert(taskIdSelf(),NULL,NULL);
|
||||
SEVCHK(ca_task_initialize(),"ca_task_initialize");
|
||||
while(TRUE) {
|
||||
while (rngNBytes(ringQ)>=sizeof(pcapvt) && interruptAccept){
|
||||
if(rngBufGet(ringQ,(void *)&pcapvt,sizeof(pcapvt))
|
||||
!=sizeof(pcapvt)) {
|
||||
errMessage(0,"recWaitCaTask: rngBufGet error");
|
||||
continue;
|
||||
}
|
||||
FASTLOCK(&lock);
|
||||
pcamonitor = pcapvt->pcamonitor;
|
||||
if(pcapvt->cmd==cmdAdd) {
|
||||
if(pcapvt->hasMonitor
|
||||
&& (strcmp(pcamonitor->channame,ca_name(pcapvt->chid))!=0)) {
|
||||
SEVCHK(ca_clear_channel(pcapvt->chid),"ca_clear_channel");
|
||||
pcapvt->hasMonitor = FALSE;
|
||||
}
|
||||
if(!pcapvt->hasMonitor) {
|
||||
SEVCHK(ca_build_and_connect(pcamonitor->channame,
|
||||
TYPENOTCONN,0,&pcapvt->chid,0,NULL,pcapvt),
|
||||
"ca_build_and_connect");
|
||||
SEVCHK(ca_add_event(DBR_STS_DOUBLE,pcapvt->chid,
|
||||
eventCallback,pcapvt,&pcapvt->evid),
|
||||
"ca_add_event");
|
||||
pcapvt->hasMonitor = TRUE;
|
||||
}
|
||||
} else if (pcapvt->cmd==cmdRemove && pcapvt->hasMonitor) {
|
||||
SEVCHK(ca_clear_channel(pcapvt->chid),"ca_clear_channel");
|
||||
pcapvt->hasMonitor = FALSE;
|
||||
}
|
||||
FASTUNLOCK(&lock);
|
||||
}
|
||||
status = ca_pend_event(.1);
|
||||
if(status!=ECA_NORMAL && status!=ECA_TIMEOUT)
|
||||
SEVCHK(status,"ca_pend_event");
|
||||
}
|
||||
}
|
||||
|
||||
static void myCallback(struct recWaitCa *pcamonitor, char inputIndex, double monData)
|
||||
{
|
||||
printf("myCallback: %s index=%d\n",pcamonitor->channame,
|
||||
pcamonitor->inputIndex);
|
||||
}
|
||||
|
||||
int testCaMonitor(char *name,char *name2,int delay)
|
||||
{
|
||||
RECWAITCA *pcamonitor;
|
||||
long status;
|
||||
|
||||
pcamonitor = calloc(1,sizeof(RECWAITCA));
|
||||
pcamonitor->channame = calloc(1,100);
|
||||
pcamonitor->callback = myCallback;
|
||||
strcpy(pcamonitor->channame,name);
|
||||
status = recWaitCaAdd(pcamonitor);
|
||||
if(status) errMessage(status,"testCaMonitor error");
|
||||
taskDelay(10);
|
||||
status = recWaitCaDelete(pcamonitor);
|
||||
if(status) errMessage(status,"testCaMonitor error");
|
||||
if(delay>0) taskDelay(delay);
|
||||
status = recWaitCaAdd(pcamonitor);
|
||||
if(status) errMessage(status,"testCaMonitor error");
|
||||
taskDelay(10);
|
||||
status = recWaitCaDelete(pcamonitor);
|
||||
if(status) errMessage(status,"testCaMonitor error");
|
||||
if(delay>0) taskDelay(delay);
|
||||
if(name2) strcpy(pcamonitor->channame,name2);
|
||||
status = recWaitCaAdd(pcamonitor);
|
||||
if(status) errMessage(status,"testCaMonitor error");
|
||||
taskDelay(10);
|
||||
status = recWaitCaDelete(pcamonitor);
|
||||
if(status) errMessage(status,"testCaMonitor error");
|
||||
if(delay>0) taskDelay(delay);
|
||||
return(0);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
typedef struct recWaitCa{
|
||||
char *channame;
|
||||
char inputIndex;
|
||||
void (*callback)(struct recWaitCa *pcamonitor, char inputIndex, double monData);
|
||||
void *userPvt;
|
||||
void *recWaitCaPvt;
|
||||
} RECWAITCA;
|
||||
|
||||
long recWaitCaAdd(RECWAITCA *pcamonitor);
|
||||
long recWaitCaDelete(RECWAITCA *pcamonitor);
|
||||
3310
src/rec/scanRecord.c
3310
src/rec/scanRecord.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -48,22 +48,22 @@
|
||||
* .15 03-29-94 mcn converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <selRecord.h>
|
||||
#include "selRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -30,30 +30,28 @@
|
||||
* .02 04-19-94 jrw Added value fields and monitors on them
|
||||
* .01 09-21-92 jrw created
|
||||
*/
|
||||
#include <vxWorks.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 <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include <callback.h>
|
||||
#include "osiWatchdog.h"
|
||||
#include "osiClock.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#include "callback.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <seqRecord.h>
|
||||
#include "seqRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
int seqRecDebug = 0;
|
||||
@@ -99,7 +97,7 @@ struct linkDesc {
|
||||
/* Callback structure used by the watchdog function to queue link processing */
|
||||
struct callbackSeq {
|
||||
CALLBACK callBack; /* used for the callback task */
|
||||
WDOG_ID wd_id; /* Watchdog udes for delays */
|
||||
watchdogId wd_id; /* Watchdog udes for delays */
|
||||
struct linkDesc *plinks[NUM_LINKS+1]; /* Pointers to links to process */
|
||||
int index;
|
||||
};
|
||||
@@ -123,6 +121,7 @@ int pass;
|
||||
{
|
||||
int index;
|
||||
struct linkDesc *plink;
|
||||
struct callbackSeq *pcallbackSeq;
|
||||
|
||||
if (pass==0) return(0);
|
||||
|
||||
@@ -131,10 +130,10 @@ int pass;
|
||||
|
||||
/* Allocate a callback structure for use in processing */
|
||||
pseq->dpvt = (void *)malloc(sizeof(struct callbackSeq));
|
||||
|
||||
((struct callbackSeq *) (pseq->dpvt))->callBack.callback = processCallback;
|
||||
((struct callbackSeq *) (pseq->dpvt))->callBack.user = (void *) pseq;
|
||||
((struct callbackSeq *) (pseq->dpvt))->wd_id = wdCreate();
|
||||
pcallbackSeq = (struct callbackSeq *)pseq->dpvt;
|
||||
pcallbackSeq->callBack.callback = processCallback;
|
||||
pcallbackSeq->callBack.user = (void *) pseq;
|
||||
pcallbackSeq->wd_id = watchdogCreate();
|
||||
|
||||
/* Get link selection if sell is a constant and nonzero */
|
||||
if (pseq->sell.type==CONSTANT)
|
||||
@@ -317,8 +316,9 @@ struct seqRecord *pseq;
|
||||
if (pcb->plinks[pcb->index]->dly > 0.0)
|
||||
{
|
||||
/* Use the watch-dog as a delay mechanism */
|
||||
wdDelay = pcb->plinks[pcb->index]->dly * sysClkRateGet();
|
||||
wdStart(pcb->wd_id, wdDelay, (FUNCPTR)watchDog, (int)(&(pcb->callBack)));
|
||||
wdDelay = (int)(pcb->plinks[pcb->index]->dly * clockGetRate());
|
||||
watchdogStart(pcb->wd_id, wdDelay,
|
||||
(WATCHDOGFUNC)watchDog, (void *)(&(pcb->callBack)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -37,22 +37,22 @@
|
||||
* .05 07-16-92 jba added invalid alarm fwd link test and chngd fwd lnk to macro
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <stateRecord.h>
|
||||
#include "stateRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -100,27 +100,27 @@
|
||||
* steps. Dev/Drv sup will interpret meaning
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <dbScan.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbScan.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <steppermotorRecord.h>
|
||||
#include "steppermotorRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <steppermotor.h>
|
||||
#include "steppermotor.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -40,23 +40,23 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <strLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <stringinRecord.h>
|
||||
#include "stringinRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -45,25 +45,25 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <strLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <stringoutRecord.h>
|
||||
#include "stringoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include <menuIvoa.h>
|
||||
#include "menuIvoa.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
@@ -36,25 +36,24 @@
|
||||
* -----------------
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <dbScan.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbScan.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <subArrayRecord.h>
|
||||
#include "subArrayRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
||||
@@ -47,26 +47,24 @@
|
||||
* .15 03-30-94 mcn converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <symLib.h>
|
||||
#include <sysSymTbl.h> /* for sysSymTbl*/
|
||||
#include <a_out.h> /* for N_TEXT */
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "registry.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <subRecord.h>
|
||||
#include "subRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
@@ -120,10 +118,7 @@ static long init_record(psub,pass)
|
||||
int pass;
|
||||
{
|
||||
FUNCPTR psubroutine;
|
||||
char sub_type;
|
||||
char temp[40];
|
||||
long status = 0;
|
||||
STATUS ret;
|
||||
struct link *plink;
|
||||
int i;
|
||||
double *pvalue;
|
||||
@@ -140,13 +135,8 @@ static long init_record(psub,pass)
|
||||
|
||||
if(strlen(psub->inam)!=0) {
|
||||
/* convert the initialization subroutine name */
|
||||
temp[0] = 0; /* all global variables start with _ */
|
||||
if (psub->inam[0] != '_'){
|
||||
strcpy(temp,"_");
|
||||
}
|
||||
strcat(temp,psub->inam);
|
||||
ret = symFindByNameEPICS(sysSymTbl,temp,(void *)&psub->sadr,(void *)&sub_type);
|
||||
if ((ret !=OK) || ((sub_type & N_TEXT) == 0)){
|
||||
psub->sadr = registryFind(0,psub->inam);
|
||||
if(psub->sadr==0) {
|
||||
recGblRecordError(S_db_BadSub,(void *)psub,"recSub(init_record)");
|
||||
return(S_db_BadSub);
|
||||
}
|
||||
@@ -161,19 +151,11 @@ static long init_record(psub,pass)
|
||||
psub->pact = TRUE;
|
||||
return(0);
|
||||
}
|
||||
/* convert the subroutine name to an address and type */
|
||||
/* convert the processing subroutine name */
|
||||
temp[0] = 0; /* all global variables start with _ */
|
||||
if (psub->snam[0] != '_'){
|
||||
strcpy(temp,"_");
|
||||
}
|
||||
strcat(temp,psub->snam);
|
||||
ret = symFindByNameEPICS(sysSymTbl,temp,(void *)&psub->sadr,(void *)&sub_type);
|
||||
if ((ret < 0) || ((sub_type & N_TEXT) == 0)){
|
||||
psub->sadr = registryFind(0,psub->snam);
|
||||
if(psub->sadr==0) {
|
||||
recGblRecordError(S_db_BadSub,(void *)psub,"recSub(init_record)");
|
||||
return(S_db_BadSub);
|
||||
}
|
||||
psub->styp = sub_type;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,6 @@ recordtype(sub) {
|
||||
interest(4)
|
||||
extra("void * sadr")
|
||||
}
|
||||
field(STYP,DBF_SHORT) {
|
||||
prompt("Subr symbol type")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(INPA,DBF_INLINK) {
|
||||
prompt("Input A")
|
||||
promptgroup(GUI_INPUTS)
|
||||
|
||||
@@ -54,10 +54,11 @@
|
||||
* .20 03-30-94 mcn converted to fast links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
|
||||
@@ -1,817 +0,0 @@
|
||||
/* recWait.c */
|
||||
/*
|
||||
* Original Author: Ned Arnold
|
||||
* Date: 05-31-94
|
||||
*
|
||||
* 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:
|
||||
* -----------------
|
||||
* 1.01 05-31-94 nda initial try
|
||||
* 1.02 07-11-94 mrk/nda added "process on input change" feature
|
||||
* 1.03 08-16-94 mrk/nda continuing "process on input change" feature
|
||||
* 1.04 08-16-94 nda record does not get notified when a SCAN
|
||||
* related field changes,so for now we have to
|
||||
* always add Monitors
|
||||
* 1.05 08-18-94 nda Starting with R3.11.6, dbGetField locks the
|
||||
* record before fetching the data. This can
|
||||
* cause deadlocks within a database. Change all
|
||||
* dbGetField() to dbGet()
|
||||
* 1.06 08-19-94 nda added Output data option of VAL or DOL
|
||||
* 1.07 09-14-94 nda corrected bug that caused SCAN_DISABLE to
|
||||
* lock up the record forever
|
||||
* 1.08 02-01-95 nda added VERS and ODLY (output execution delay)
|
||||
* 1.09 02-15-95 nda added INxP to specify which inputs should
|
||||
* cause the record to process when in I/O INTR
|
||||
* 2.00 02-20-95 nda added queuing to SCAN_IO_EVENT mode so no
|
||||
* transitions of data would be missed.
|
||||
* 2.01 08-07-95 nda Multiple records with DOLN's didn't work,
|
||||
* added calloc for dola structure.
|
||||
* 3.00 08-28-95 nda Significant rewrite to add Channel Access
|
||||
* for dynamic links using recDynLink.c . All
|
||||
* inputs are now "monitored" via Channel Access.
|
||||
* Removed some "callbacks" because recDynLink
|
||||
* lib uses it's own task context.
|
||||
* INxV field is used to keep track of PV
|
||||
* connection status: 0-PV_OK,
|
||||
* 1-NotConnected, 2-NO_PV
|
||||
* 3.01 10-03-95 nda Also post monitors on .la, .lb, .lc etc
|
||||
* when new values are written
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#define VERSION 3.01
|
||||
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <tickLib.h>
|
||||
#include <semLib.h>
|
||||
#include <taskLib.h>
|
||||
#include <wdLib.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbScan.h"
|
||||
#include "dbDefs.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "rngLib.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#include "callback.h"
|
||||
#include "taskwd.h"
|
||||
#include "postfix.h"
|
||||
|
||||
#include "choiceWait.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "waitRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "recDynLink.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
|
||||
#define get_units NULL
|
||||
static long get_precision();
|
||||
#define get_enum_str NULL
|
||||
#define get_enum_strs NULL
|
||||
#define put_enum_str NULL
|
||||
static long get_graphic_double();
|
||||
#define get_control_double NULL
|
||||
static long get_alarm_double();
|
||||
|
||||
struct rset waitRSET={
|
||||
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
|
||||
};
|
||||
|
||||
/* Create DSET for "soft channel" to allow for IO Event (this is to implement
|
||||
the feature of processing the record when an input changes) */
|
||||
|
||||
static long get_ioint_info();
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init_dev;
|
||||
DEVSUPFUN dev_init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_event;
|
||||
}devWaitIoEvent={
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
get_ioint_info,
|
||||
NULL};
|
||||
|
||||
|
||||
/* DEFINES */
|
||||
#define ARG_MAX 12 /* Number of input arguments of the record */
|
||||
#define IN_PVS 1 /* Number of other input dynamic links(DOLN) */
|
||||
#define OUT_PVS 1 /* Number of "non-input" dynamic links(OUTN) */
|
||||
#define DOL_INDEX ARG_MAX
|
||||
#define OUT_INDEX (ARG_MAX + IN_PVS)
|
||||
#define NUM_LINKS (ARG_MAX + IN_PVS + OUT_PVS)
|
||||
#define PVN_SIZE 40 /*must match the length defined in waitRecord.db*/
|
||||
#define Q_SIZE 50
|
||||
#define PV_OK REC_WAIT_DYNL_OK /* from choiceWait.h */
|
||||
#define PV_NC REC_WAIT_DYNL_NC /* from choiceWait.h */
|
||||
#define NO_PV REC_WAIT_DYNL_NO_PV /* from choiceWait.h */
|
||||
|
||||
/**********************************************
|
||||
Declare constants and structures
|
||||
***********************************************/
|
||||
|
||||
/* callback structures and record private data */
|
||||
struct cbStruct {
|
||||
CALLBACK doOutCb; /* cback struct for doing the OUT link*/
|
||||
CALLBACK ioProcCb; /* cback struct for io_event scanning */
|
||||
struct waitRecord *pwait; /* pointer to wait record */
|
||||
WDOG_ID wd_id; /* Watchdog used for delays */
|
||||
recDynLink caLinkStruct[NUM_LINKS]; /* req'd for recDynLink*/
|
||||
RING_ID monitorQ; /* queue to store ca callback data */
|
||||
IOSCANPVT ioscanpvt; /* used for IO_EVENT scanning */
|
||||
int outputWait;/* waiting to do output */
|
||||
int procPending;/*record processing is pending */
|
||||
unsigned long tickStart; /* used for timing */
|
||||
};
|
||||
|
||||
|
||||
typedef struct recDynLinkPvt {
|
||||
struct waitRecord *pwait; /* pointer to wait record */
|
||||
unsigned short linkIndex; /* specifies which dynamic link */
|
||||
}recDynLinkPvt;
|
||||
|
||||
|
||||
static long get_ioint_info(cmd,pwait,ppvt)
|
||||
int cmd;
|
||||
struct waitRecord *pwait;
|
||||
IOSCANPVT *ppvt;
|
||||
{
|
||||
*ppvt = (((struct cbStruct *)pwait->cbst)->ioscanpvt);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/* This is the data that will be put on the work queue ring buffer */
|
||||
struct qStruct {
|
||||
char inputIndex;
|
||||
double monData;
|
||||
};
|
||||
|
||||
|
||||
int recWaitDebug=0;
|
||||
int recWaitCacheMode=0;
|
||||
static void schedOutput(struct waitRecord *pwait);
|
||||
static void execOutput(struct cbStruct *pcbst);
|
||||
static int fetch_values(struct waitRecord *pwait);
|
||||
static void monitor(struct waitRecord *pwait);
|
||||
static long initSiml();
|
||||
static void ioIntProcess(CALLBACK *pioProcCb);
|
||||
|
||||
static void pvSearchCallback(recDynLink *precDynLink);
|
||||
static void inputChanged(recDynLink *precDynLink);
|
||||
|
||||
|
||||
static long init_record(pwait,pass)
|
||||
struct waitRecord *pwait;
|
||||
int pass;
|
||||
{
|
||||
struct cbStruct *pcbst;
|
||||
long status = 0;
|
||||
int i;
|
||||
|
||||
char *ppvn[PVN_SIZE];
|
||||
unsigned short *pPvStat;
|
||||
|
||||
recDynLinkPvt *puserPvt;
|
||||
|
||||
short error_number;
|
||||
|
||||
if (pass==0) {
|
||||
pwait->vers = VERSION;
|
||||
|
||||
pwait->cbst = calloc(1,sizeof(struct cbStruct));
|
||||
|
||||
/* init the private area of the caLinkStruct's */
|
||||
for(i=0;i<NUM_LINKS; i++) {
|
||||
((struct cbStruct *)pwait->cbst)->caLinkStruct[i].puserPvt
|
||||
= calloc(1,sizeof(struct recDynLinkPvt));
|
||||
puserPvt = ((struct cbStruct *)pwait->cbst)->caLinkStruct[i].puserPvt;
|
||||
puserPvt->pwait = pwait;
|
||||
puserPvt->linkIndex = i;
|
||||
}
|
||||
|
||||
/* do scanIoInit here because init_dev doesn't know which record */
|
||||
scanIoInit(&(((struct cbStruct *)pwait->cbst)->ioscanpvt));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* This is pass == 1, so pwait->cbst is valid */
|
||||
|
||||
pcbst = (struct cbStruct *)pwait->cbst;
|
||||
|
||||
pwait->clcv=postfix(pwait->calc,pwait->rpcl,&error_number);
|
||||
if(pwait->clcv){
|
||||
recGblRecordError(S_db_badField,(void *)pwait,
|
||||
"wait: init_record: Illegal CALC field");
|
||||
}
|
||||
db_post_events(pwait,&pwait->clcv,DBE_VALUE);
|
||||
|
||||
callbackSetCallback(execOutput, &pcbst->doOutCb);
|
||||
callbackSetPriority(pwait->prio, &pcbst->doOutCb);
|
||||
callbackSetCallback(ioIntProcess, &pcbst->ioProcCb);
|
||||
callbackSetPriority(pwait->prio, &pcbst->ioProcCb);
|
||||
callbackSetUser(pwait, &pcbst->ioProcCb);
|
||||
pcbst->pwait = pwait;
|
||||
pcbst->wd_id = wdCreate();
|
||||
if((pcbst->monitorQ=rngCreate(sizeof(struct qStruct)*Q_SIZE)) == NULL) {
|
||||
errMessage(0,"recWait can't create ring buffer");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (status=initSiml(pwait)) return(status);
|
||||
|
||||
/* reset miscellaneous flags */
|
||||
pcbst->outputWait = 0;
|
||||
pcbst->procPending = 0;
|
||||
|
||||
pwait->init = TRUE;
|
||||
|
||||
/* Do initial lookup of PV Names using recDynLink lib */
|
||||
|
||||
*ppvn = &pwait->inan[0];
|
||||
pPvStat = &pwait->inav;
|
||||
|
||||
/* check all dynLinks for non-NULL */
|
||||
for(i=0;i<NUM_LINKS; i++, pPvStat++, *ppvn += PVN_SIZE) {
|
||||
if(*ppvn[0] != NULL) {
|
||||
*pPvStat = PV_NC;
|
||||
if(i<OUT_INDEX) {
|
||||
recDynLinkAddInput(&pcbst->caLinkStruct[i], *ppvn,
|
||||
DBR_DOUBLE, rdlSCALAR, pvSearchCallback, inputChanged);
|
||||
}
|
||||
else {
|
||||
recDynLinkAddOutput(&pcbst->caLinkStruct[i], *ppvn,
|
||||
DBR_DOUBLE, rdlSCALAR, pvSearchCallback);
|
||||
}
|
||||
if(recWaitDebug > 5) printf("Search during init\n");
|
||||
}
|
||||
else {
|
||||
*pPvStat = NO_PV;
|
||||
}
|
||||
}
|
||||
pwait->init = TRUE;
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long process(pwait)
|
||||
struct waitRecord *pwait;
|
||||
{
|
||||
short async = FALSE;
|
||||
long status;
|
||||
|
||||
pwait->pact = TRUE;
|
||||
|
||||
/* Check for simulation mode */
|
||||
status=dbGetLink(&(pwait->siml),DBR_ENUM,&(pwait->simm),0,0);
|
||||
|
||||
/* reset procPending before getting values */
|
||||
((struct cbStruct *)pwait->cbst)->procPending = 0;
|
||||
|
||||
if(pwait->simm == NO) {
|
||||
if(fetch_values(pwait)==0) {
|
||||
if(calcPerform(&pwait->a,&pwait->val,pwait->rpcl)) {
|
||||
recGblSetSevr(pwait,CALC_ALARM,INVALID_ALARM);
|
||||
} else pwait->udf = FALSE;
|
||||
}
|
||||
else {
|
||||
recGblSetSevr(pwait,READ_ALARM,INVALID_ALARM);
|
||||
}
|
||||
}
|
||||
else { /* SIMULATION MODE */
|
||||
status = dbGetLink(&(pwait->siol),DBR_DOUBLE,&(pwait->sval),0,0);
|
||||
if (status==0){
|
||||
pwait->val=pwait->sval;
|
||||
pwait->udf=FALSE;
|
||||
}
|
||||
recGblSetSevr(pwait,SIMM_ALARM,pwait->sims);
|
||||
}
|
||||
|
||||
/* decide whether to write Output PV */
|
||||
switch(pwait->oopt) {
|
||||
case REC_WAIT_OUT_OPT_EVERY:
|
||||
schedOutput(pwait);
|
||||
async = TRUE;
|
||||
break;
|
||||
case REC_WAIT_OUT_OPT_CHANGE:
|
||||
if(fabs(pwait->oval - pwait->val) > pwait->mdel) {
|
||||
schedOutput(pwait);
|
||||
async = TRUE;
|
||||
}
|
||||
break;
|
||||
case REC_WAIT_OUT_OPT_CHG_TO_ZERO:
|
||||
if((pwait->oval != 0) && (pwait->val == 0)) {
|
||||
schedOutput(pwait);
|
||||
async = TRUE;
|
||||
}
|
||||
break;
|
||||
case REC_WAIT_OUT_OPT_CHG_TO_NZERO:
|
||||
if((pwait->oval == 0) && (pwait->val != 0)) {
|
||||
schedOutput(pwait);
|
||||
async = TRUE;
|
||||
}
|
||||
break;
|
||||
case REC_WAIT_OUT_OPT_WHEN_ZERO:
|
||||
if(!pwait->val) {
|
||||
schedOutput(pwait);
|
||||
async = TRUE;
|
||||
}
|
||||
break;
|
||||
case REC_WAIT_OUT_OPT_WHEN_NZERO:
|
||||
if(pwait->val) {
|
||||
schedOutput(pwait);
|
||||
async = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
pwait->oval = pwait->val;
|
||||
|
||||
recGblGetTimeStamp(pwait);
|
||||
/* check event list */
|
||||
monitor(pwait);
|
||||
|
||||
if (!async) {
|
||||
pwait->pact = FALSE;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long special(paddr,after)
|
||||
struct dbAddr *paddr;
|
||||
int after;
|
||||
{
|
||||
struct waitRecord *pwait = (struct waitRecord *)(paddr->precord);
|
||||
struct cbStruct *pcbst = (struct cbStruct *)pwait->cbst;
|
||||
int special_type = paddr->special;
|
||||
char *ppvn[PVN_SIZE];
|
||||
unsigned short *pPvStat;
|
||||
unsigned short oldStat;
|
||||
int index;
|
||||
short error_number;
|
||||
|
||||
if(recWaitDebug) printf("entering special %d \n",after);
|
||||
|
||||
if(!after) { /* this is called before ca changes the field */
|
||||
|
||||
/* check if changing any dynamic link names */
|
||||
/* This is where one would do a recDynLinkClear, but it is
|
||||
not required prior to a new search */
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* this is executed after ca changed the field */
|
||||
if((special_type >= REC_WAIT_A) &&
|
||||
(special_type < (REC_WAIT_A + NUM_LINKS))) {
|
||||
index = special_type - REC_WAIT_A; /* index of input */
|
||||
pPvStat = &pwait->inav + index; /* pointer arithmetic */
|
||||
oldStat = *pPvStat;
|
||||
*ppvn = &pwait->inan[0] + (index*PVN_SIZE);
|
||||
if(*ppvn[0] != NULL) {
|
||||
if(recWaitDebug > 5) printf("Search during special \n");
|
||||
*pPvStat = PV_NC;
|
||||
/* need to post_event before recDynLinkAddXxx because
|
||||
SearchCallback could happen immediatley */
|
||||
if(*pPvStat != oldStat) {
|
||||
db_post_events(pwait,pPvStat,DBE_VALUE);
|
||||
}
|
||||
if(index<OUT_INDEX) {
|
||||
recDynLinkAddInput(&pcbst->caLinkStruct[index], *ppvn,
|
||||
DBR_DOUBLE, rdlSCALAR, pvSearchCallback, inputChanged);
|
||||
}
|
||||
else {
|
||||
recDynLinkAddOutput(&pcbst->caLinkStruct[index], *ppvn,
|
||||
DBR_DOUBLE, rdlSCALAR, pvSearchCallback);
|
||||
}
|
||||
}
|
||||
else if(*pPvStat != NO_PV) {
|
||||
/* PV is now NULL but didn't used to be */
|
||||
*pPvStat = NO_PV; /* PV just cleared */
|
||||
if(*pPvStat != oldStat) {
|
||||
db_post_events(pwait,pPvStat,DBE_VALUE);
|
||||
}
|
||||
recDynLinkClear(&pcbst->caLinkStruct[index]);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
else if(special_type == SPC_CALC) {
|
||||
pwait->clcv=postfix(pwait->calc,pwait->rpcl,&error_number);
|
||||
if(pwait->clcv){
|
||||
recGblRecordError(S_db_badField,(void *)pwait,
|
||||
"wait: init_record: Illegal CALC field");
|
||||
}
|
||||
db_post_events(pwait,&pwait->clcv,DBE_VALUE);
|
||||
return(0);
|
||||
}
|
||||
else if(paddr->pfield==(void *)&pwait->prio) {
|
||||
callbackSetPriority(pwait->prio, &pcbst->doOutCb);
|
||||
callbackSetPriority(pwait->prio, &pcbst->ioProcCb);
|
||||
return(0);
|
||||
}
|
||||
else {
|
||||
recGblDbaddrError(S_db_badChoice,paddr,"wait: special");
|
||||
return(S_db_badChoice);
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
static long get_precision(paddr,precision)
|
||||
struct dbAddr *paddr;
|
||||
long *precision;
|
||||
{
|
||||
struct waitRecord *pwait=(struct waitRecord *)paddr->precord;
|
||||
|
||||
*precision = pwait->prec;
|
||||
if(paddr->pfield == (void *)&pwait->val) {
|
||||
*precision = pwait->prec;
|
||||
}
|
||||
else if(paddr->pfield == (void *)&pwait->odly) {
|
||||
*precision = 3;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_graphic_double(paddr,pgd)
|
||||
struct dbAddr *paddr;
|
||||
struct dbr_grDouble *pgd;
|
||||
{
|
||||
struct waitRecord *pwait=(struct waitRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield==(void *)&pwait->val) {
|
||||
pgd->upper_disp_limit = pwait->hopr;
|
||||
pgd->lower_disp_limit = pwait->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_alarm_double(paddr,pad)
|
||||
struct dbAddr *paddr;
|
||||
struct dbr_alDouble *pad;
|
||||
{
|
||||
recGblGetAlarmDouble(paddr,pad);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void monitor(pwait)
|
||||
struct waitRecord *pwait;
|
||||
{
|
||||
unsigned short monitor_mask;
|
||||
double delta;
|
||||
double *pnew;
|
||||
double *pprev;
|
||||
int i;
|
||||
|
||||
monitor_mask = recGblResetAlarms(pwait);
|
||||
/* check for value change */
|
||||
delta = pwait->mlst - pwait->val;
|
||||
if(delta<0.0) delta = -delta;
|
||||
if (delta > pwait->mdel) {
|
||||
/* post events for value change */
|
||||
monitor_mask |= DBE_VALUE;
|
||||
/* update last value monitored */
|
||||
pwait->mlst = pwait->val;
|
||||
}
|
||||
/* check for archive change */
|
||||
delta = pwait->alst - pwait->val;
|
||||
if(delta<0.0) delta = -delta;
|
||||
if (delta > pwait->adel) {
|
||||
/* post events on value field for archive change */
|
||||
monitor_mask |= DBE_LOG;
|
||||
/* update last archive value monitored */
|
||||
pwait->alst = pwait->val;
|
||||
}
|
||||
|
||||
/* send out monitors connected to the value field */
|
||||
if (monitor_mask){
|
||||
db_post_events(pwait,&pwait->val,monitor_mask);
|
||||
}
|
||||
/* check all input fields for changes */
|
||||
for(i=0, pnew=&pwait->a, pprev=&pwait->la; i<ARG_MAX;
|
||||
i++, pnew++, pprev++) {
|
||||
if(*pnew != *pprev) {
|
||||
db_post_events(pwait,pnew,monitor_mask|DBE_VALUE);
|
||||
*pprev = *pnew;
|
||||
db_post_events(pwait,pprev,monitor_mask|DBE_VALUE);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static long initSiml(pwait)
|
||||
struct waitRecord *pwait;
|
||||
{
|
||||
|
||||
/* wait.siml must be a CONSTANT or a PV_LINK or a DB_LINK */
|
||||
if (pwait->siml.type == CONSTANT) {
|
||||
recGblInitConstantLink(&pwait->siml,DBF_USHORT,&pwait->simm);
|
||||
}
|
||||
|
||||
/* wait.siol must be a CONSTANT or a PV_LINK or a DB_LINK */
|
||||
if (pwait->siol.type == CONSTANT) {
|
||||
recGblInitConstantLink(&pwait->siol,DBF_DOUBLE,&pwait->sval);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int fetch_values(pwait)
|
||||
struct waitRecord *pwait;
|
||||
{
|
||||
struct cbStruct *pcbst = (struct cbStruct *)pwait->cbst;
|
||||
double *pvalue;
|
||||
unsigned short *pPvStat;
|
||||
unsigned short *piointInc; /* include for IO_INT ? */
|
||||
long status=0;
|
||||
size_t nRequest=1;
|
||||
int i;
|
||||
|
||||
piointInc = &pwait->inap;
|
||||
for(i=0, pvalue=&pwait->a, pPvStat = &pwait->inav;
|
||||
i<ARG_MAX; i++, pvalue++, pPvStat++, piointInc++) {
|
||||
|
||||
/* if any input should be connected, but is not, return */
|
||||
if(*pPvStat == PV_NC) {
|
||||
status = ERROR;
|
||||
}
|
||||
|
||||
/* only fetch a value if the connection is valid */
|
||||
/* if not in SCAN_IO_EVENT, fetch all valid inputs */
|
||||
/* if in SCAN_IO_EVENT, only fetch inputs if INxP == 0 */
|
||||
/* The data from those with INxP=1 comes from the ring buffer */
|
||||
else if((*pPvStat == PV_OK)&&
|
||||
((pwait->scan != SCAN_IO_EVENT) ||
|
||||
((pwait->scan == SCAN_IO_EVENT) && !*piointInc))) {
|
||||
if(recWaitDebug > 5) printf("Fetching input %d \n",i);
|
||||
status = recDynLinkGet(&pcbst->caLinkStruct[i], pvalue,
|
||||
&nRequest, 0, 0, 0);
|
||||
}
|
||||
if (!RTN_SUCCESS(status)) return(status);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* The following functions schedule and/or request the execution of the
|
||||
* output PV and output event based on the Output Execution Delay (ODLY).
|
||||
* If .odly > 0, a watchdog is scheduled; if 0, execOutput() is called
|
||||
* immediately.
|
||||
* NOTE: THE RECORD REMAINS "ACTIVE" WHILE WAITING ON THE WATCHDOG
|
||||
*
|
||||
**************************************************************************/
|
||||
static void schedOutput(pwait)
|
||||
struct waitRecord *pwait;
|
||||
{
|
||||
|
||||
struct cbStruct *pcbst = (struct cbStruct *)pwait->cbst;
|
||||
|
||||
int wdDelay;
|
||||
|
||||
if(pwait->odly > 0.0) {
|
||||
/* Use the watch-dog as a delay mechanism */
|
||||
pcbst->outputWait = 1;
|
||||
wdDelay = pwait->odly * sysClkRateGet();
|
||||
wdStart(pcbst->wd_id, wdDelay, (FUNCPTR)execOutput, (int)(pwait->cbst));
|
||||
} else {
|
||||
execOutput(pwait->cbst);
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This code calls recDynLinkPut to execute the output link. Since requests
|
||||
* recDynLinkPut are done via another task, one need not worry about
|
||||
* lock sets.
|
||||
*
|
||||
***************************************************************************/
|
||||
void execOutput(pcbst)
|
||||
struct cbStruct *pcbst;
|
||||
{
|
||||
long status;
|
||||
size_t nRequest = 1;
|
||||
double oldDold;
|
||||
|
||||
/* if output link is valid , decide between VAL and DOL */
|
||||
if(!pcbst->pwait->outv) {
|
||||
if(pcbst->pwait->dopt) {
|
||||
if(!pcbst->pwait->dolv) {
|
||||
oldDold = pcbst->pwait->dold;
|
||||
status = recDynLinkGet(&pcbst->caLinkStruct[DOL_INDEX],
|
||||
&(pcbst->pwait->dold), &nRequest, 0, 0, 0);
|
||||
if(pcbst->pwait->dold != oldDold)
|
||||
db_post_events(pcbst->pwait,&pcbst->pwait->dold,DBE_VALUE);
|
||||
}
|
||||
status = recDynLinkPut(&pcbst->caLinkStruct[OUT_INDEX],
|
||||
&(pcbst->pwait->dold), 1);
|
||||
} else {
|
||||
status = recDynLinkPut(&pcbst->caLinkStruct[OUT_INDEX],
|
||||
&(pcbst->pwait->val), 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* post event if output event != 0 */
|
||||
if(pcbst->pwait->oevt > 0) {
|
||||
post_event((int)pcbst->pwait->oevt);
|
||||
}
|
||||
|
||||
recGblFwdLink(pcbst->pwait);
|
||||
pcbst->pwait->pact = FALSE;
|
||||
pcbst->outputWait = 0;
|
||||
|
||||
/* If I/O Interrupt scanned, see if any inputs changed during delay */
|
||||
if((pcbst->pwait->scan == SCAN_IO_EVENT) && (pcbst->procPending == 1)) {
|
||||
scanOnce(pcbst->pwait);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* This routine is called by the recDynLink task whenver a monitored input
|
||||
* changes. If the particular input is flagged to cause record processing,
|
||||
* The input index and new data are put on a work queue, and a callback
|
||||
* request is issued to the routine ioIntProcess
|
||||
*/
|
||||
|
||||
static void inputChanged(recDynLink *precDynLink)
|
||||
{
|
||||
struct waitRecord *pwait = ((recDynLinkPvt *)precDynLink->puserPvt)->pwait;
|
||||
struct cbStruct *pcbst = (struct cbStruct *)pwait->cbst;
|
||||
double monData;
|
||||
size_t nRequest;
|
||||
char index;
|
||||
unsigned short *piointInc;
|
||||
|
||||
if(pwait->scan != SCAN_IO_EVENT) return;
|
||||
|
||||
index = (char)((recDynLinkPvt *)precDynLink->puserPvt)->linkIndex;
|
||||
|
||||
piointInc = &pwait->inap + index; /* pointer arithmetic */
|
||||
if(*piointInc == 0) return; /* input cause processing ???*/
|
||||
|
||||
/* put input index and monitored data on processing queue */
|
||||
recDynLinkGet(precDynLink, &monData, &nRequest, 0, 0, 0);
|
||||
if(recWaitDebug>5)
|
||||
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))
|
||||
!= sizeof(double)) errMessage(0,"recWait rngBufPut error");
|
||||
callbackRequest(&pcbst->ioProcCb);
|
||||
}
|
||||
|
||||
|
||||
/* This routine performs the record processing when in SCAN_IO_EVENT. An
|
||||
event queue is built by inputChanged() and emptied here so each change
|
||||
of an input causes the record to process.
|
||||
*/
|
||||
static void ioIntProcess(CALLBACK *pioProcCb)
|
||||
{
|
||||
|
||||
struct waitRecord *pwait;
|
||||
struct cbStruct *pcbst;
|
||||
|
||||
char inputIndex;
|
||||
double monData;
|
||||
double *pInput;
|
||||
|
||||
callbackGetUser(pwait, pioProcCb);
|
||||
pcbst = (struct cbStruct *)pwait->cbst;
|
||||
pInput = &pwait->a; /* a pointer to the first input field */
|
||||
|
||||
if(pwait->scan != SCAN_IO_EVENT) return;
|
||||
|
||||
if(!recWaitCacheMode) {
|
||||
if(rngBufGet(pcbst->monitorQ, (void *)&inputIndex, sizeof(char))
|
||||
!= sizeof(char)) errMessage(0, "recWait: rngBufGet error");
|
||||
if(rngBufGet(pcbst->monitorQ, (void *)&monData, sizeof(double))
|
||||
!= sizeof(double)) errMessage(0, "recWait: rngBufGet error");
|
||||
|
||||
if(recWaitDebug>=5)
|
||||
printf("processing on %d = %f (%f)\n",
|
||||
inputIndex, monData,pwait->val);
|
||||
|
||||
pInput += inputIndex; /* pointer arithmetic for appropriate input */
|
||||
dbScanLock((struct dbCommon *)pwait);
|
||||
*pInput = monData; /* put data in input data field */
|
||||
|
||||
/* Process the record, unless busy waiting to do the output link */
|
||||
if(pcbst->outputWait) {
|
||||
pcbst->procPending = 1;
|
||||
if(recWaitDebug) printf("record busy, setting procPending\n");
|
||||
}
|
||||
else {
|
||||
dbProcess((struct dbCommon *)pwait); /* process the record */
|
||||
}
|
||||
dbScanUnlock((struct dbCommon *)pwait);
|
||||
}
|
||||
else {
|
||||
if(recWaitDebug>=5) printf("processing (cached)\n");
|
||||
dbScanLock((struct dbCommon *)pwait);
|
||||
dbProcess((struct dbCommon *)pwait); /* process the record */
|
||||
dbScanUnlock((struct dbCommon *)pwait);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
LOCAL void pvSearchCallback(recDynLink *precDynLink)
|
||||
{
|
||||
|
||||
recDynLinkPvt *puserPvt = (recDynLinkPvt *)precDynLink->puserPvt;
|
||||
struct waitRecord *pwait = puserPvt->pwait;
|
||||
unsigned short index = puserPvt->linkIndex;
|
||||
unsigned short *pPvStat;
|
||||
unsigned short oldValid;
|
||||
|
||||
pPvStat = &pwait->inav + index; /* pointer arithmetic */
|
||||
puserPvt = (recDynLinkPvt *)precDynLink->puserPvt;
|
||||
|
||||
oldValid = *pPvStat;
|
||||
if(recDynLinkConnectionStatus(precDynLink)) {
|
||||
*pPvStat = PV_NC;
|
||||
if(recWaitDebug) printf("Search Callback: No Connection\n");
|
||||
}
|
||||
else {
|
||||
*pPvStat = PV_OK;
|
||||
if(recWaitDebug) printf("Search Callback: Success\n");
|
||||
}
|
||||
if(*pPvStat != oldValid) {
|
||||
db_post_events(pwait, pPvStat, DBE_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,517 +0,0 @@
|
||||
menu(waitOOPT) {
|
||||
choice(waitOOPT_Every_Time,"Every Time")
|
||||
choice(waitOOPT_On_Change,"On Change")
|
||||
choice(waitOOPT_When_Zero,"When Zero")
|
||||
choice(waitOOPT_When_Non_zero,"When Non-zero")
|
||||
choice(waitOOPT_Transition_To_Zero,"Transition To Zero")
|
||||
choice(waitOOPT_Transition_To_Non_zero,"Transition To Non-zero")
|
||||
}
|
||||
menu(waitDOPT) {
|
||||
choice(waitDOPT_Use_VAL,"Use VAL")
|
||||
choice(waitDOPT_Use_DOL,"Use DOL")
|
||||
}
|
||||
menu(waitINAP) {
|
||||
choice(waitINAP_No,"No")
|
||||
choice(waitINAP_Yes,"Yes")
|
||||
}
|
||||
menu(waitINAV) {
|
||||
choice(waitINAV_PV_OK,"PV OK")
|
||||
choice(waitINAV_PV_BAD,"PV BAD")
|
||||
choice(waitINAV_No_PV,"No PV")
|
||||
}
|
||||
recordtype(wait) {
|
||||
include "dbCommon.dbd"
|
||||
field(VERS,DBF_FLOAT) {
|
||||
prompt("Code Version")
|
||||
special(SPC_NOMOD)
|
||||
initial("1")
|
||||
}
|
||||
field(HOPR,DBF_FLOAT) {
|
||||
prompt("High Operating Range")
|
||||
promptgroup(GUI_ALARMS)
|
||||
asl(ASL0)
|
||||
interest(1)
|
||||
}
|
||||
field(LOPR,DBF_FLOAT) {
|
||||
prompt("Low Operating Range")
|
||||
promptgroup(GUI_BITS1)
|
||||
asl(ASL0)
|
||||
interest(1)
|
||||
}
|
||||
field(INIT,DBF_SHORT) {
|
||||
prompt("Initialized?")
|
||||
special(SPC_NOMOD)
|
||||
interest(3)
|
||||
}
|
||||
field(CBST,DBF_NOACCESS) {
|
||||
prompt("Pointer to cbStruct")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void * cbst")
|
||||
}
|
||||
field(INAN,DBF_STRING) {
|
||||
prompt("INPA PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(110)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INBN,DBF_STRING) {
|
||||
prompt("INPB PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(111)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INCN,DBF_STRING) {
|
||||
prompt("INPC PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(112)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INDN,DBF_STRING) {
|
||||
prompt("INPD PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(113)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INEN,DBF_STRING) {
|
||||
prompt("INPE PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(114)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INFN,DBF_STRING) {
|
||||
prompt("INPF PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(115)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INGN,DBF_STRING) {
|
||||
prompt("INPG PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(116)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INHN,DBF_STRING) {
|
||||
prompt("INPH PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(117)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(ININ,DBF_STRING) {
|
||||
prompt("INPI PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(118)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INJN,DBF_STRING) {
|
||||
prompt("INPJ PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(119)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INKN,DBF_STRING) {
|
||||
prompt("INPK PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(120)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INLN,DBF_STRING) {
|
||||
prompt("INPL PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(121)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(DOLN,DBF_STRING) {
|
||||
prompt("DOL PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(122)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(OUTN,DBF_STRING) {
|
||||
prompt("OUT PV Name")
|
||||
promptgroup(GUI_CALC)
|
||||
asl(ASL0)
|
||||
special(123)
|
||||
interest(1)
|
||||
size(40)
|
||||
}
|
||||
field(INAV,DBF_MENU) {
|
||||
prompt("INPA PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INBV,DBF_MENU) {
|
||||
prompt("INPB PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INCV,DBF_MENU) {
|
||||
prompt("INPC PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INDV,DBF_MENU) {
|
||||
prompt("INPD PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INEV,DBF_MENU) {
|
||||
prompt("INPE PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INFV,DBF_MENU) {
|
||||
prompt("INPF PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INGV,DBF_MENU) {
|
||||
prompt("INPG PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INHV,DBF_MENU) {
|
||||
prompt("INPH PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INIV,DBF_MENU) {
|
||||
prompt("INPI PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INJV,DBF_MENU) {
|
||||
prompt("INPJ PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INKV,DBF_MENU) {
|
||||
prompt("INPK PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(INLV,DBF_MENU) {
|
||||
prompt("INPL PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(DOLV,DBF_MENU) {
|
||||
prompt("DOL PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
field(OUTV,DBF_MENU) {
|
||||
prompt("OUT PV Status")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
menu(waitINAV)
|
||||
}
|
||||
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(LA,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input A")
|
||||
}
|
||||
field(LB,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input B")
|
||||
}
|
||||
field(LC,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input C")
|
||||
}
|
||||
field(LD,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input D")
|
||||
}
|
||||
field(LE,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input E")
|
||||
}
|
||||
field(LF,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input F")
|
||||
}
|
||||
field(LG,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input G")
|
||||
}
|
||||
field(LH,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input H")
|
||||
}
|
||||
field(LI,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input I")
|
||||
}
|
||||
field(LJ,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input J")
|
||||
}
|
||||
field(LK,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input K")
|
||||
}
|
||||
field(LL,DBF_DOUBLE) {
|
||||
prompt("Last Val of Input L")
|
||||
}
|
||||
field(INAP,DBF_MENU) {
|
||||
prompt("INPA causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INBP,DBF_MENU) {
|
||||
prompt("INPB causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INCP,DBF_MENU) {
|
||||
prompt("INPC causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INDP,DBF_MENU) {
|
||||
prompt("INPD causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INEP,DBF_MENU) {
|
||||
prompt("INPE causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INFP,DBF_MENU) {
|
||||
prompt("INPF causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INGP,DBF_MENU) {
|
||||
prompt("INPG causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INHP,DBF_MENU) {
|
||||
prompt("INPH causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INIP,DBF_MENU) {
|
||||
prompt("INPI causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INJP,DBF_MENU) {
|
||||
prompt("INPJ causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INKP,DBF_MENU) {
|
||||
prompt("INPK causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(INLP,DBF_MENU) {
|
||||
prompt("INPL causes I/O INTR")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitINAP)
|
||||
initial("Yes")
|
||||
}
|
||||
field(CALC,DBF_STRING) {
|
||||
prompt("Calculation")
|
||||
promptgroup(GUI_CLOCK)
|
||||
asl(ASL0)
|
||||
special(SPC_CALC)
|
||||
size(36)
|
||||
}
|
||||
field(RPCL,DBF_NOACCESS) {
|
||||
prompt("Reverse Polish Calc")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("char rpcl[184]")
|
||||
}
|
||||
field(CLCV,DBF_LONG) {
|
||||
prompt("CALC Valid")
|
||||
interest(1)
|
||||
}
|
||||
field(VAL,DBF_DOUBLE) {
|
||||
prompt("Value Field")
|
||||
}
|
||||
field(OVAL,DBF_DOUBLE) {
|
||||
prompt("Old Value")
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
promptgroup(GUI_COMMON)
|
||||
interest(1)
|
||||
}
|
||||
field(OOPT,DBF_MENU) {
|
||||
prompt("Output Execute Opt")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitOOPT)
|
||||
}
|
||||
field(ODLY,DBF_FLOAT) {
|
||||
prompt("Output Execute Delay")
|
||||
promptgroup(GUI_ALARMS)
|
||||
asl(ASL0)
|
||||
interest(1)
|
||||
}
|
||||
field(DOPT,DBF_MENU) {
|
||||
prompt("Output Data Option")
|
||||
promptgroup(GUI_CALC)
|
||||
interest(1)
|
||||
menu(waitDOPT)
|
||||
}
|
||||
field(DOLD,DBF_DOUBLE) {
|
||||
prompt("Desired Output Data")
|
||||
promptgroup(GUI_CLOCK)
|
||||
asl(ASL0)
|
||||
interest(1)
|
||||
}
|
||||
field(OEVT,DBF_USHORT) {
|
||||
prompt("Event To Issue")
|
||||
promptgroup(GUI_CLOCK)
|
||||
asl(ASL0)
|
||||
}
|
||||
field(ADEL,DBF_DOUBLE) {
|
||||
prompt("Archive Deadband")
|
||||
promptgroup(GUI_CLOCK)
|
||||
interest(1)
|
||||
}
|
||||
field(MDEL,DBF_DOUBLE) {
|
||||
prompt("Monitor Deadband")
|
||||
promptgroup(GUI_CLOCK)
|
||||
interest(1)
|
||||
}
|
||||
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(SIOL,DBF_INLINK) {
|
||||
prompt("Sim Input Specifctn")
|
||||
promptgroup(GUI_PULSE)
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_DOUBLE) {
|
||||
prompt("Simulation Value")
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
promptgroup(GUI_PULSE)
|
||||
interest(1)
|
||||
}
|
||||
field(SIMM,DBF_MENU) {
|
||||
prompt("Simulation Mode")
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Sim mode Alarm Svrty")
|
||||
promptgroup(GUI_SELECT)
|
||||
interest(2)
|
||||
menu(menuAlarmSevr)
|
||||
}
|
||||
}
|
||||
@@ -60,25 +60,24 @@
|
||||
* .20 09-14-92 jba nord set only for db links
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdioLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include <alarm.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbEvent.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <dbScan.h>
|
||||
#include <devSup.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbScan.h"
|
||||
#include "devSup.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include <waveformRecord.h>
|
||||
#include "waveformRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
||||
Reference in New Issue
Block a user