From: hadaq Date: Wed, 18 Aug 2010 09:38:15 +0000 (+0000) Subject: Extended. Sergey. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=700de42e31c15271fcf8dfac2042fd13951cfae6;p=daqdata.git Extended. Sergey. --- diff --git a/ebctrl/ioc/ebctrlApp/src/errbit1.c b/ebctrl/ioc/ebctrlApp/src/errbit1.c new file mode 100644 index 0000000..d951d49 --- /dev/null +++ b/ebctrl/ioc/ebctrlApp/src/errbit1.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "worker.h" + +int errbit1Debug; + +long errbit1_init( struct genSubRecord *pgsub ) +{ + return(0); +} + +long errbit1_proc( struct genSubRecord *pgsub ) +{ + uint32_t *out[21]; + unsigned long tmp; + unsigned long nrOfMsgs = 0; + int i; + + out[0] = (uint32_t *)pgsub->vala; /* errbit1 */ + out[1] = (uint32_t *)pgsub->valb; /* errbit2 */ + out[2] = (uint32_t *)pgsub->valc; /* errbit3 */ + out[3] = (uint32_t *)pgsub->vald; /* ... */ + out[4] = (uint32_t *)pgsub->vale; + out[5] = (uint32_t *)pgsub->valf; + out[6] = (uint32_t *)pgsub->valg; + out[7] = (uint32_t *)pgsub->valh; + out[8] = (uint32_t *)pgsub->vali; + out[9] = (uint32_t *)pgsub->valj; + out[10] = (uint32_t *)pgsub->valk; + out[11] = (uint32_t *)pgsub->vall; + out[12] = (uint32_t *)pgsub->valm; + out[13] = (uint32_t *)pgsub->valn; + out[14] = (uint32_t *)pgsub->valo; + out[15] = (uint32_t *)pgsub->valp; + out[16] = (uint32_t *)pgsub->valq; + out[17] = (uint32_t *)pgsub->valr; + out[18] = (uint32_t *)pgsub->vals; + out[19] = (uint32_t *)pgsub->valt; + out[20] = (uint32_t *)pgsub->valu; + + for( i=0; i<21; i++ ) + *out[i] = 0; + + char buf[_POSIX_PATH_MAX]; + sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") ); + + if( Worker_getStatistic( buf, "nrOfMsgs", &nrOfMsgs ) == -1) { + if(errbit1Debug) + printf(" errbit.c: Worker_getStatistic failed for nrOfMsgs!\n"); + } + else{ + if(nrOfMsgs > 21) + nrOfMsgs = 21; + } + + char errbitbuf[100]; + + for( i=0; i errbit.c: Worker_getStatistic failed for %s!\n", errbitbuf); + } + else{ + *out[i] = (uint32_t)tmp; + + if(errbit1Debug) + printf(" errbit.c: Worker_getStatistic::%s = %lu\n", errbitbuf, tmp); + } + } + + return(0); +} + +/* Register these symbols for use by IOC code: */ + +epicsExportAddress(int, errbit1Debug); +epicsRegisterFunction(errbit1_init); +epicsRegisterFunction(errbit1_proc);