From fa14dcc8c9693bc618f4306815428bdd0789f7a3 Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 31 May 2011 15:06:40 +0000 Subject: [PATCH] Total errbit statistics added. Sergey. --- ebctrl/ioc/ebctrlApp/src/totalerrbitstat.c | 58 ++++++++++++++++++++ ebctrl/ioc/ebctrlApp/src/totalerrbitstat.dbd | 3 + 2 files changed, 61 insertions(+) create mode 100644 ebctrl/ioc/ebctrlApp/src/totalerrbitstat.c create mode 100644 ebctrl/ioc/ebctrlApp/src/totalerrbitstat.dbd diff --git a/ebctrl/ioc/ebctrlApp/src/totalerrbitstat.c b/ebctrl/ioc/ebctrlApp/src/totalerrbitstat.c new file mode 100644 index 0000000..7f36acf --- /dev/null +++ b/ebctrl/ioc/ebctrlApp/src/totalerrbitstat.c @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +int totalerrbitstatDebug; + +long totalErrBitStat_init(struct genSubRecord *psub ) +{ + return(0); +} + +long totalErrBitStat_proc(struct genSubRecord *psub ) +{ + int i = 0; + uint32_t totalErrBitStat = 0; + uint32_t input[16]; + + input[0] = *(uint32_t *)psub->a; + input[1] = *(uint32_t *)psub->b; + input[2] = *(uint32_t *)psub->c; + input[3] = *(uint32_t *)psub->d; + input[4] = *(uint32_t *)psub->e; + input[5] = *(uint32_t *)psub->f; + input[6] = *(uint32_t *)psub->g; + input[7] = *(uint32_t *)psub->h; + input[8] = *(uint32_t *)psub->i; + input[9] = *(uint32_t *)psub->j; + input[10] = *(uint32_t *)psub->k; + input[11] = *(uint32_t *)psub->l; + input[12] = *(uint32_t *)psub->m; + input[13] = *(uint32_t *)psub->n; + input[14] = *(uint32_t *)psub->o; + input[15] = *(uint32_t *)psub->p; + + for(i=0; i<16; i++){ + totalErrBitStat = totalErrBitStat + input[i]; + } + + if(totalerrbitstatDebug){ + printf(" totalerrbitstat.c: total ErrorBit statistics: %lu\n", (unsigned long)totalErrBitStat); + } + + *(uint32_t *)psub->vala = (uint32_t)totalErrBitStat; + + return(0); +} + +epicsExportAddress(int, totalerrbitstatDebug); +epicsRegisterFunction(totalErrBitStat_init); +epicsRegisterFunction(totalErrBitStat_proc); diff --git a/ebctrl/ioc/ebctrlApp/src/totalerrbitstat.dbd b/ebctrl/ioc/ebctrlApp/src/totalerrbitstat.dbd new file mode 100644 index 0000000..4aca28b --- /dev/null +++ b/ebctrl/ioc/ebctrlApp/src/totalerrbitstat.dbd @@ -0,0 +1,3 @@ +variable(totalerrbitstatDebug) +function(totalErrBitStat_init) +function(totalErrBitStat_proc) \ No newline at end of file -- 2.43.0