--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <stdint.h>
+
+#include <dbDefs.h>
+#include <registryFunction.h>
+#include <subRecord.h>
+#include <genSubRecord.h>
+#include <epicsExport.h>
+
+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("<I> 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);