/*============================================================================= Name: loopCAC.c Abs: Utilities to setup CAC context, channels, and monitors Auth: 10 jul 2009, drogind created Rev: -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: (newest to oldest) =============================================================================*/ #include "debugPrint.h" #ifdef DEBUG_PRINT #include int loopCACFlag = DP_INFO; #endif #define TEST 1 /* c includes */ #include /* memcpy */ #include #include "cadef.h" /* channel access */ #include "caerr.h" /* channel access status codes */ #include "dbDefs.h" #include "epicsMutex.h" /* mutex utilities */ #include "ffTypes.h" #include "ffGlob.h" #include "loopCACTypes.h" /* CAC variables and structures */ #include "cacUtil.h" #include "loopCAC.h" /* CAC variables and structures */ #include "loopFcom.h" /* fcom functions */ #include "loopDev.h" /* real meas and act device names */ /* written in loopConfig */ /* local function prototypes */ LOCAL void loopCACShortCallback(struct event_handler_args eha); LOCAL void loopCACDoubleCallback(struct event_handler_args eha); LOCAL void makeAccessNameFromDevice (const char * devName_ca, char * accessName_ca ); LOCAL void makeBSANameFromDevice (const char * devName_ca, char * bsaName_ca); /* debug routines */ LOCAL int setCaDebugMonitor(network_ts * network_ps, ffThread_te ffThread_e); LOCAL void loopCACDebugEventCallback(struct event_handler_args eha); /*============================================================================== Name: loopCACInit() Abs: create the channels and monitors for each loop's monitored signals. Args: none Rem: this routine uses the previously initialized global to search through all units and create a channel to each unit's monitored epics records. It then assigns a monitor to each channel. side: This is called upon bootup and remains for the life of the loop Ret: return code ==============================================================================*/ int loopCACInit (ffThread_te ffThread_e) { ffThread_ts* ffLoop_ps; int loop; int unit; int status = OKOK; ffLoop_ps = &ffThreads_as[ffThread_e]; loop = ffLoop_ps->loopNum; DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACInit has loopName = %s; ffThread_e=%d\n", (char *) ffLoop_ps->loopUnitName_ca, ffThread_e )); DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACInit has context_p = %lu\n", (unsigned long)context_p)); /* attach to the global CA context created by exec thread */ ca_attach_context (context_p); for (unit = 0; unit < MAX_MEAS_DEVICES; unit ++) { /* init fields */ loopCAC_as[loop].measAccess_as[unit].chId = NULL; loopCAC_as[loop].measAccess_as[unit].evId = NULL; } for (unit = 0; unit < MAX_ACT_DEVICES; unit ++) { /* init fields */ loopCAC_as[loop].actAccess_as[unit].chId = NULL; loopCAC_as[loop].actAccess_as[unit].evId = NULL; } for (unit = 0; unit < MAX_MEAS_DEVICES; unit ++) { /* init fields */ loopCAC_as[loop].measBSA_as[unit].chId = NULL; loopCAC_as[loop].measBSA_as[unit].evId = NULL; } for (unit = 0; unit < MAX_ACT_DEVICES; unit ++) { /* init fields */ loopCAC_as[loop].actInit_as[unit].chId = NULL; loopCAC_as[loop].actInit_as[unit].evId = NULL; } return(status); } /*============================================================================== Name: loopCACReConfig Abs: create the channels and monitors for loop monitored callbacks for *ACCESS, machine conditions, and actuator status Called to reconfigure the channels and monitors whenever the loop is booted, or started after a stop (going from off to on), or anytime it reconfigures itself based on machine conditions. Args: Rem: This handles all possible devices whether used or not only assigns monitors to used devices, but over time this becomes all devices, since we never remove a monitor. side: Ret: return code ==============================================================================*/ int loopCACReConfig (ffThread_te ffThread_e) { int status = OKOK; ffThread_ts* ffLoop_ps; int loop; int unit; ffLoop_ps = &ffThreads_as[ffThread_e]; loop = ffLoop_ps->loopNum; DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACReConfig has loopName = %s; measNum=%u\n", (char *) ffLoop_ps->loopUnitName_ca, loop_as[loop].measNum )); /* monitor the meas device ACCESS channels, we need to find the list of unique devices, only one ACCESS for each X & Y of a BPM */ for (unit = 0; unit < loop_as[loop].measNum; unit ++) { /* init fields */ /* transfer to CAC side whether this device is used (after dbNameToAddr read) */ /*loopCAC_as[loop].measUse[unit] = loop_as[loop].measDev_as [unit].used;*/ if (loopCAC_as[loop].measAccess_as[unit].chId != NULL) { break; } /* else- either this is the first time through (reboot) to establish channels */ /* or, this is a newly added channel */ memcpy (&(loopCAC_as[loop].measAccess_as[unit].pvName_ca), &(loop_as[loop].measDev_as[unit].pvName_ca), MAX_CHAR_EPICS_NAME); /* now that we have device name, append ":ACCESS" */ /* call a function .... */ makeAccessNameFromDevice ( (const char *) &(loop_as[loop].measDev_as[unit].pvName_ca), (char *)&(loopCAC_as[loop].measAccess_as[unit].pvName_ca)); /* create a channel to epics device records requiring monitors for this loop */ status = getChannel(&(loopCAC_as[loop].measAccess_as[unit]), ffThread_e); if (status!=OKOK) { DEBUGPRINT (DP_FATAL, loopCACFlag, ("loopCAC: loopCACReConfig failure on connect for %s\n", (char *) loopCAC_as[loop].measAccess_as[unit].pvName_ca)); loopCAC_as[loop].measAccess_as[unit].chId = NULL; } else { setCaMonitor(&(loopCAC_as[loop].measAccess_as[unit]), DBR_SHORT, loopCACShortCallback); DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACReConfig establishing camon for = %s\n", (char *) loopCAC_as[loop].measAccess_as[unit].pvName_ca)); } } /* now monitor actuator device ACCESS channels don't know if there are any ACCESS PVs for RF or Magnets */ for (unit = 0; unit < loop_as[loop].actNum; unit ++) { /* init fields */ /*loopCAC_as[loop].actUsed[unit] = loop_as[loop].actDev_as [unit].used;*/ if (loopCAC_as[loop].actAccess_as[unit].chId != NULL) { break; } /* else- either this is the first time through (reboot) to establish channels */ /* or, this is a newly added channel */ memcpy (&(loopCAC_as[loop].actAccess_as[unit].pvName_ca), &(loop_as[loop].actDev_as[unit].pvName_ca), MAX_CHAR_EPICS_NAME); /* now that we have device name, append ":ACCESS" */ /* call a function .... */ makeAccessNameFromDevice ( (const char *) &(loop_as[loop].actDev_as[unit].pvName_ca), (char *)&(loopCAC_as[loop].actAccess_as[unit].pvName_ca)); /* create a channel to epics device records requiring monitors for this loop */ status = getChannel(&(loopCAC_as[loop].actAccess_as[unit]), ffThread_e); if (status !=OKOK) { DEBUGPRINT (DP_FATAL, loopCACFlag, ("loopCAC: loopCACReConfig failure on connect for %s\n", (char *) loopCAC_as[loop].actAccess_as[unit].pvName_ca)); loopCAC_as[loop].actAccess_as[unit].chId = NULL; } else { setCaMonitor(&(loopCAC_as[loop].actAccess_as[unit]),DBR_SHORT, loopCACShortCallback); DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACReConfig establishing camon for = %s\n", (char *) loopCAC_as[loop].actAccess_as[unit].pvName_ca)); } } #ifndef __rtems__ /* create channels for meas cagets, monitor the first meas device 1H BSA channel ** for debugging on softIOC only */ for (unit = 0; unit < loop_as[loop].measNum; unit ++) { /* init fields */ if (loopCAC_as[loop].measBSA_as[unit].chId != NULL) { break; } memcpy (&(loopCAC_as[loop].measBSA_as[unit].pvName_ca), &(loop_as[loop].measDev_as[unit].pvName_ca), MAX_CHAR_EPICS_NAME); /* now that we have device name, get 1H BSA name */ /* call a function .... */ makeBSANameFromDevice ( (const char *) &(loop_as[loop].measDev_as[unit].pvName_ca), (char *)&(loopCAC_as[loop].measBSA_as[unit].pvName_ca)); /* create a channel to epics device records requiring cagets for this loop */ /* for debug, place a monitor on the first channel to cause an event */ status = getChannel(&(loopCAC_as[loop].measBSA_as[unit]), ffThread_e); if (status!=OKOK) { DEBUGPRINT (DP_FATAL, loopCACFlag, ("loopCAC: loopCACReConfig failure on connect for %s\n", (char *) loopCAC_as[loop].measBSA_as[unit].pvName_ca)); loopCAC_as[loop].measBSA_as[unit].chId = NULL; } else { /* place a monitor on only the first 1H meas for this loop and use it for the debug event */ if (unit==0) { /* Note loopCAC: loopCACReConfig establishing camon for = BPMS:IN20:525:X1H */ /* loopCAC: created ca channel for BPMS:IN20:525:X1H */ /* Above messages occur when that device is not seen by the LCLSDEV gateway */ setCaDebugMonitor(&(loopCAC_as[loop].measBSA_as[unit]), ffThread_e); DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACReConfig establishing camon for = %s\n", (char *) loopCAC_as[loop].measBSA_as[unit].pvName_ca)); } } } #endif /* now set up channels for the actuator device ACTs if they don't already exist */ for (unit = 0; unit < loop_as[loop].actNum; unit ++) { /* init fields */ if (loopCAC_as[loop].actInit_as[unit].chId != NULL) { break; } loopCAC_as[loop].actInit_as[unit].evId = NULL; memcpy (&(loopCAC_as[loop].actInit_as[unit].pvName_ca), &(loop_as[loop].actDev_as[unit].pvName_ca), MAX_CHAR_EPICS_NAME); /* create a channel to epics device records requiring monitors for this loop */ status = getChannel(&(loopCAC_as[loop].actInit_as[unit]), ffThread_e); if (status !=OKOK) { DEBUGPRINT (DP_FATAL, loopCACFlag, ("loopCAC: loopCACReConfig failure on connect for %s\n", (char *) loopCAC_as[loop].actInit_as[unit].pvName_ca)); loopCAC_as[loop].actInit_as[unit].chId = NULL; } else { DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCAC: loopCACReConfig established (ca_get) channel for = %s\n", (char *) loopCAC_as[loop].actInit_as[unit].pvName_ca)); } } if ( (status=caPendIO())!=OKOK) { DEBUGPRINT (DP_ERROR, loopCACFlag, ("loopCACReConfig ca_pend_io failure on monitors \n")); } return (status); } /*============================================================================== Name: makeAccessNameFromDevice Abs: create the channels and monitors for loop monitored callbacks for *ACCESS, machine conditions, and actuator status Args: Rem: This handles all possible devices upon bootup, whether used or not side: Ret: return code ==============================================================================*/ LOCAL void makeAccessNameFromDevice (const char * devName_ca, char * accessName_ca) { int i = 0; int colon = 0; DEBUGPRINT (DP_DEBUG, loopCACFlag, ("loopCAC: making makeAccessNameFromDevice = %s\n", (char *) devName_ca)); /* store pv name up until 3rd colon */ while (colon < 3) { while (devName_ca[i] != ':') { accessName_ca[i] = devName_ca[i]; i++; } accessName_ca[i] = devName_ca[i]; /* pick up ':' */ i++; colon ++; } /* now append "ACCESS" */ accessName_ca[i] = 'A'; i++; accessName_ca[i] = 'C'; i++; accessName_ca[i] = 'C'; i++; accessName_ca[i] = 'E'; i++; accessName_ca[i] = 'S'; i++; accessName_ca[i] = 'S'; i++; accessName_ca[i] = '\0'; /* null terminate */ DEBUGPRINT (DP_DEBUG, loopCACFlag, ("loopCAC: makeAccessNameFromDevice output = %s\n", (char *) accessName_ca)); } /*============================================================================== Name: getBSAMeasData Abs: Get the measurement data via CAC Args: Rem: side: Ret: return code ==============================================================================*/ int loopCACGetBSAMeasData (ffThread_te ffThread_e) { int status = OKOK; ffThread_ts* ffLoop_ps; int loop; int unit; int cnt = 0; ffLoop_ps = &ffThreads_as[ffThread_e]; loop = ffLoop_ps->loopNum; for (unit = 0; unit < loop_as[loop].measNum; unit ++) { /* init fields */ if (loop_as[loop].measDev_as [unit].used==1) { caGetDouble (&(loopCAC_as[loop].measBSA_as[unit])); DEBUGPRINT (DP_DEBUG, loopCACFlag, ("loopCAC: getBSAMeasData for %s got val=%f \n", (char *) loopCAC_as[loop].measBSA_as[unit].pvName_ca, (double) loopCAC_as[loop].measBSA_as[unit].value_d)); /* put data into loopRT_as */ loopRT_as[loop].meas.val_ad[cnt++] =loopCAC_as[loop].measBSA_as[unit].value_d; } } /* Seg fault: */ /* if ( (status=caPendIO()) !=OKOK) { DEBUGPRINT (DP_ERROR, loopCACFlag, ("loopCACGetBSAMeasData ca_pend_io failure on ca_gets\n")); }*/ return status; } /*============================================================================== Name: loopCACGetActReadbacks Abs: create the channels and monitors for loop monitored callbacks for *ACCESS, machine conditions, and actuator status Args: Rem: This handles all possible devices upon bootup, whether used or not side: Ret: return code ==============================================================================*/ int loopCACGetActInitialVals (ffThread_te ffThread_e) { int status = OKOK; ffThread_ts* ffLoop_ps; int loop; int unit; ffLoop_ps = &ffThreads_as[ffThread_e]; loop = ffLoop_ps->loopNum; for (unit = 0; unit < loop_as[loop].actNum; unit ++) { /* init fields */ if (loop_as[loop].actDev_as [unit].used==1) { caGetDouble (&(loopCAC_as[loop].actInit_as[unit])); DEBUGPRINT (DP_DEBUG, loopCACFlag, ("loopCACGetActInitialVals - %s got val=%f \n", (char *) loopCAC_as[loop].actInit_as[unit].pvName_ca, (double) loopCAC_as[loop].actInit_as[unit].value_d)); } } if ( (status=caPendIO()) !=OKOK) { DEBUGPRINT (DP_ERROR, loopCACFlag, ("loopCACGetActInitialVals ca_pend_io failure on ca_gets\n")); } return status; } /*============================================================================== Name: loopCACPutDevFBCKs Abs: create the channels and monitors for loop monitored callbacks for *ACCESS, machine conditions, and actuator status Args: Rem: This handles all possible devices upon bootup, whether used or not side: Ret: return code ==============================================================================*/ int loopCACPutDevFBCKs (ffThread_te ffThread_e, const unsigned short fbckOnOff) { int status = OKOK; ffThread_ts* ffLoop_ps; int loop; int unit; ffLoop_ps = &ffThreads_as[ffThread_e]; loop = ffLoop_ps->loopNum; for (unit = 0; unit < loop_as[loop].actNum; unit ++) { /* init fields */ if (loop_as[loop].actDev_as [unit].used==1) { DEBUGPRINT (DP_ERROR, loopCACFlag, ("loopCACPutDevFBCKS failure to set FBCK = %u for %s - Non Connected \n", fbckOnOff, (char *) loopCAC_as[loop].actFbck_as[unit].pvName_ca)); status = NOT_OK; } } /* not used, so don't output FBCK value */ if ( (status=caPendIO()) != OKOK) { DEBUGPRINT (DP_ERROR, loopCACFlag, ("loopCACPutDevFBCKS ca_pend_io failure on FBCK ca_puts\n")); } return status; } /*============================================================================== Name: makeAccessNameFromDevice Abs: create the channels and monitors for loop monitored callbacks for *ACCESS, machine conditions, and actuator status Args: Rem: This handles all possible devices upon bootup, whether used or not side: Ret: return code ==============================================================================*/ LOCAL void makeBSANameFromDevice (const char * devName_ca, char * bsaName_ca) { int i = 0; DEBUGPRINT (DP_DEBUG, loopCACFlag, ("loopCAC: making makeBSANameFromDevice = %s\n", (char *) devName_ca)); /* store pv name up until 3rd colon */ while (devName_ca[i] != '\0') { bsaName_ca[i] = devName_ca[i]; i++; } /* now append "1H" */ bsaName_ca[i] = '1'; i++; bsaName_ca[i] = 'H'; i++; bsaName_ca[i] = '\0'; /* null terminate */ DEBUGPRINT (DP_DEBUG, loopCACFlag, ("loopCAC: makeBSANameFromDevice output = %s\n", (char *) bsaName_ca)); } /*============================================================================= Name: loopCACShortCallback Abs: callback for the caMonitor channel access subscription request for DBR_SHORT values - such as ACCESS, MODE, STATE, USEAVG, etc Args: Type Name Access Description ------------ if ()------- ----------- ---------- ---------------------------- struct event_handler_args eha read only channel access event callback arguments Rem: Side: Ret: ACCESS pvs are monitored for all possible meas and act devices, whether USED or not 0 = Online 1 = Maint 2 = Checkout 3 = Offline ==============================================================================*/ LOCAL void loopCACShortCallback(struct event_handler_args eha) { unsigned short *shortVal_p = NULL; network_ts * usr_ps = NULL; if(eha.status==ECA_NORMAL) { usr_ps = ( network_ts *) eha.usr; shortVal_p = (unsigned short *)eha.dbr; usr_ps->value_s = *shortVal_p; DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCACShortCallback: got event %s = %d, unit_ps=%ld, pv=%s\n", ca_name(eha.chid), *shortVal_p, (unsigned long)usr_ps, (char *)usr_ps->pvName_ca) ); } } /*============================================================================= Name: loopCACStateCallback Abs: callback for the caMonitor channel access subscription request for STATE. Sets the loopCAC_as[loop].reConfigureFlag Args: Type Name Access Description ------------ if ()------- ----------- ---------- ---------------------------- struct event_handler_args eha read only channel access event callback arguments Rem: Side: Ret: ACCESS pvs are monitored for all possible meas and act devices, whether USED or not 0 = Online 1 = Maint 2 = Checkout 3 = Offline ==============================================================================*/ LOCAL void loopCACStateCallback(struct event_handler_args eha) { unsigned short *shortVal_p = NULL; network_ts * usr_ps = NULL; int loop; ffThread_ts* ffLoop_ps; if(eha.status==ECA_NORMAL) { usr_ps = ( network_ts *) eha.usr; shortVal_p = (unsigned short *)eha.dbr; if (usr_ps != NULL) { ffLoop_ps = &ffThreads_as[usr_ps->ffThread_e]; loop = ffLoop_ps->loopNum; usr_ps->value_s = *shortVal_p; DEBUGPRINT(DP_INFO, loopCACFlag, ("loopCACStateCallback: loop %d got event %s = %d, unit_ps=%ld, pv=%s\n", loop = ffLoop_ps->loopNum, ca_name(eha.chid), *shortVal_p, (unsigned long)usr_ps, (char *)usr_ps->pvName_ca) ); if (usr_ps->value_s == 1) { /* state is going to ON from Off */ loop_as[loop].on = epicsTrue; /* reconfigure this loop */ loop_as[loop].reConfigure = epicsTrue; /* signal the loop handler to wakeup and act upon its flags, etc */ /*if (ffLoop_ps->wakeupFromTimerEvent_ps != NULL) { epicsEventSignal( ffLoop_ps->wakeupFromTimerEvent_ps ); } install the wakeup event id into table shared w timer api wakeupTable[loop] = ffLoop_ps->wakeupFromTimerEvent_ps; */ } else { /* state is going to Off from On */ /* silence wakeup event when we are Off */ /*wakeupTable[loop] = NULL;*/ loop_as[loop].on = epicsFalse; } } } } /*============================================================================= Name: loopCACDoubleCallback Abs: callback for the caMonitor channel access subscription request for double values - such as actuator initial values Args: Type Name Access Description ------------------- ----------- ---------- ---------------------------- struct event_handler_args eha read only channel access event callback arguments Rem: Side: Ret: ==============================================================================*/ LOCAL void loopCACDoubleCallback(struct event_handler_args eha) { dbr_double_t *doubleVal_p = NULL; network_ts * usr_ps = NULL; if(eha.status==ECA_NORMAL) { usr_ps = ( network_ts *) eha.usr; doubleVal_p = ( dbr_double_t *)eha.dbr; usr_ps->value_d = *doubleVal_p; DEBUGPRINT(DP_INFO, loopCACFlag, ("loopCACDoubleCallback: got event %s = %f, unit_ps=%ld, pv=%s\n", ca_name(eha.chid), *doubleVal_p, (unsigned long)usr_ps, (char *)usr_ps->pvName_ca) ); } } /******************************** DEBUG ROUTINES ******************************/ /*============================================================================= Name: setCaDebugMonitor Abs: create a CA subscription to the EPICS PV named. Pass in a pointer to the global unit structure needed by the subscription callback. Args: Type Name Access Description ------------------- ----------- ---------- ---------------------------- Rem: this routine will assign the subscription callback and pass in the pointer to the corresponding primCollect_as[p].unit_as[u] structure. Side: Ret: vmsstat_t vms style return code ==============================================================================*/ LOCAL int setCaDebugMonitor(network_ts * network_ps, ffThread_te ffThread_e) { int status = ECA_NORMAL; ffThread_ts * ffLoop_ps; ffLoop_ps = &ffThreads_as[ffThread_e]; DEBUGPRINT (DP_DEBUG, loopCACFlag, ("LoopCAC: begin of setCaDebugMonitor on %s\n", (char *) network_ps->pvName_ca)); if ((status = (ca_create_subscription(DBR_DOUBLE, 1, network_ps->chId , DBE_VALUE, loopCACDebugEventCallback, (void *)ffLoop_ps, &(network_ps->evId))) )!=ECA_NORMAL ) { DEBUGPRINT (DP_FATAL, loopCACFlag, ("LoopCAC:ca_create_subscription failure for %s, status = %d\n", (char *) network_ps->pvName_ca, status)); status = NOT_OK; errlogPrintf("CA Create Subscription failure for %s \n", (char *) network_ps->pvName_ca); } else { DEBUGPRINT (DP_DEBUG, loopCACFlag, ("LoopCAC: Success! ca_create_subscription for debug event on ffThread_e = %u\n", (unsigned short) ffThread_e)); } if ((status = (ca_pend_io(1.0)))!=ECA_NORMAL ) { DEBUGPRINT (DP_FATAL, loopCACFlag, ("LoopCAC:ca_pend_io failure on create_subscr for %s, status=%d\n", (char *) network_ps->pvName_ca, status)); status = NOT_OK; } else { DEBUGPRINT (DP_DEBUG, loopCACFlag, ("LoopCAC: Success! ca_pend_io on network_ps= %ld\n", (unsigned long)network_ps)); } return (status); } /*============================================================================= Name: loopCACDebugEventCallback Abs: callback for the caMonitor channel access subscription request for double values - such as actuator initial values This callback is used as a debug event for waking up the loop Args: Type Name Access Description ------------------- ----------- ---------- ---------------------------- struct event_handler_args eha read only channel access event callback arguments Rem: Side: Ret: ==============================================================================*/ LOCAL void loopCACDebugEventCallback(struct event_handler_args eha) { ffThread_ts* ffLoop_ps = NULL; dbr_double_t *doubleVal_p = NULL; network_ts * usr_ps = NULL; if(eha.status==ECA_NORMAL) { ffLoop_ps = (ffThread_ts*) eha.usr; DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCACDebugEventCallback: got event for loopNum=%d\n", (int)ffLoop_ps->loopNum)); /* this is a bpm 1h value */ usr_ps = ( network_ts *) eha.usr; doubleVal_p = ( dbr_double_t *)eha.dbr; usr_ps->value_d = *doubleVal_p; DEBUGPRINT(DP_DEBUG, loopCACFlag, ("loopCACDebugCallback: got event for %s; value = %f, unit_ps=%ld, pv=%s\n", ca_name(eha.chid), *doubleVal_p, (unsigned long)usr_ps, (char *)usr_ps->pvName_ca) ); /* now wake up this thread's wakeupEvnetId */ if (ffLoop_ps != NULL) { DEBUGPRINT(DP_INFO,loopCACFlag, ("**********loopCACDebugEventCallback: loop %d has ffLoop_ps = %lu\n", ffLoop_ps->loopNum, (unsigned long int) ffLoop_ps)); if (ffLoop_ps->wakeupFromTimerEvent_ps != NULL) { epicsEventSignal( ffLoop_ps->wakeupFromTimerEvent_ps ); } else { DEBUGPRINT(DP_ERROR, loopCACFlag, ("loopCACDebugEventCallback: got event for loopNum=%d, BUT wakeupFromTimerEvent_ps is NULL\n",(int)ffLoop_ps->loopNum)); } } } }