--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <dbDefs.h>
+#include <registryFunction.h>
+#include <subRecord.h>
+#include <epicsExport.h>
+#include <genSubRecord.h>
+#include <stringinRecord.h>
+
+#include "worker.h"
+
+int trigtypeDebug;
+
+long trigtype_init( struct genSubRecord *pgsub )
+{
+ return(0);
+}
+
+long trigtype_proc( struct genSubRecord *pgsub )
+{
+ uint32_t *out[16];
+ unsigned long tmp;
+ int i;
+
+ out[0] = (uint32_t *)pgsub->vala; /* trigType0 */
+ out[1] = (uint32_t *)pgsub->valb; /* trigType1 */
+ out[2] = (uint32_t *)pgsub->valc; /* trigType2 */
+ 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;
+
+ char buf[_POSIX_PATH_MAX];
+ sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") );
+
+ char trigTypeBuff[100];
+
+ for( i=0; i<16; i++ ) {
+ sprintf( trigTypeBuff, "evtId%d", i );
+
+ if( Worker_getStatistic( buf, trigTypeBuff, &tmp ) == -1) {
+ if(trigtypeDebug)
+ printf("<E> trigtype.c: Worker_getStatistic failed for %s!\n", trigTypeBuff);
+ }
+ else{
+ *out[i] = (uint32_t)tmp;
+ }
+ }
+
+ return(0);
+}
+
+/* Register these symbols for use by IOC code: */
+
+epicsExportAddress(int, trigtypeDebug);
+epicsRegisterFunction(trigtype_init);
+epicsRegisterFunction(trigtype_proc);