#include /* for struct subRecord */ #include /* for epics register function */ #include /* for epicsExport */ #include /* epics timestamp and proto */ #include /* for EVR APIs */ static long subPulseIdInit(subRecord *prec) { /* nothing to do */ prec->udf = 0; return 0; } static long subPulseId(subRecord *prec) { /* * Get timestamp from EVR for the active timeslot * and, store it to TIME field. * The TSE field should be -2. */ //evrTimeGet(&(prec->time), 0); evrTimeGet(&(prec->time), prec->evnt); /* * Extract pulse ID from the timestamp * and, store it to VAL field. */ prec->val = PULSEID(prec->time); return 0; } epicsRegisterFunction(subPulseIdInit); epicsRegisterFunction(subPulseId);