diff --git a/Makefile.RHEL7 b/Makefile.RHEL7 index f8f70e2..bd7c4ab 100644 --- a/Makefile.RHEL7 +++ b/Makefile.RHEL7 @@ -4,7 +4,7 @@ include /ioc/tools/driver.makefile MODULE=sinq LIBVERSION=koennecke BUILDCLASSES=Linux -EPICS_VERSIONS=3.14.12 +EPICS_VERSIONS=3.14.12 7.0.4.1 # additional module dependencies REQUIRED+=SynApps diff --git a/sinqEPICSApp/src/devScalerEL737.c b/sinqEPICSApp/src/devScalerEL737.c index bb7a204..7e6aa50 100644 --- a/sinqEPICSApp/src/devScalerEL737.c +++ b/sinqEPICSApp/src/devScalerEL737.c @@ -163,7 +163,7 @@ static void connectSlaveRecords(EL737priv *priv) errlogPrintf("dbNameToAddr failed for %s with %s\n", slaveName, errName); priv->dbInit = 0; } else { - errlogPrintf("dbNameToAddr succeded for %s, record access %s\n",slaveName, priv->status.precord->name); + errlogPrintf("dbNameToAddr succeded for %s, record access %s\n",slaveName, priv->threshCounter.precord->name); } snprintf(slaveName,sizeof(slaveName),"%s:Threshold", priv->psr->name); @@ -174,9 +174,9 @@ static void connectSlaveRecords(EL737priv *priv) errlogPrintf("dbNameToAddr failed for %s with %s\n", slaveName, errName); priv->dbInit = 0; } else { - errlogPrintf("dbNameToAddr succeded for %s, record access %s\n",slaveName, priv->status.precord->name); + errlogPrintf("dbNameToAddr succeded for %s, record access %s\n",slaveName, priv->threshold.precord->name); } - + priv->thresholdValue = -999; } static long el737_init_record(scalerRecord *psr, CALLBACK *pcallback) @@ -429,20 +429,18 @@ static void runEvents(EL737priv *priv) errSymLookup(dbStatus,errName,sizeof(errName)); errlogPrintf("Reading thresholdCounter failed with %s\n", errName); } else { - if(threshCounter > 0) { - /* The threshCounter is valid */ - sprintf(command,"DL %d %d", (int)threshCounter, - (int)myThreshold); - errlogPrintf("Sending threshold command %s\n", command); - status = el737_transactCommand(priv,command,reply); - sprintf(command,"DR %d", (int)threshCounter); - status = el737_transactCommand(priv, command,reply); - if(status == asynSuccess){ - priv->sendThreshold = 0; - priv->thresholdValue = myThreshold; - } - } else { - errlogPrintf("Invalid threshold monitor %ld, no threshold sent", threshCounter); + if(threshCounter == 0){ + threshCounter = 1; + } + sprintf(command,"DL %d %d", (int)threshCounter, + (int)myThreshold); + errlogPrintf("Sending threshold command %s\n", command); + status = el737_transactCommand(priv,command,reply); + sprintf(command,"DR %d", (int)threshCounter); + status = el737_transactCommand(priv, command,reply); + if(status == asynSuccess){ + priv->sendThreshold = 0; + priv->thresholdValue = myThreshold; } } } @@ -452,7 +450,7 @@ static void runEvents(EL737priv *priv) if(priv->sendThreshold == 1) { // fallback when we do not have the DB fields or threshCounter is invalid if(priv->presets[THRESHMON] <= 0) { - errlogPrintf("Invalid threshold monitor %ld, no threshold sent", priv->presets[THRESHMON]); + errlogPrintf("Invalid threshold preset monitor %ld, no threshold sent", priv->presets[THRESHMON]); } else { sprintf(command,"DL %d %d", (int)priv->presets[THRESHMON], (int)priv->presets[THRESHVAL]);