From 64c8b08ce40ac9a76546a24515e82afa621dbd17 Mon Sep 17 00:00:00 2001 From: koennecke Date: Fri, 7 Jun 2024 13:36:34 +0200 Subject: [PATCH 1/3] Fixed an initialisation bug in EL734Driver which prevented motors from being polled. The value in question was next_poll which is now set to -1 in the constructor. --- sinqEPICSApp/src/EL734Driver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sinqEPICSApp/src/EL734Driver.cpp b/sinqEPICSApp/src/EL734Driver.cpp index 73cb3bd..5ae856e 100644 --- a/sinqEPICSApp/src/EL734Driver.cpp +++ b/sinqEPICSApp/src/EL734Driver.cpp @@ -240,6 +240,7 @@ EL734Axis::EL734Axis(EL734Controller *pC, int axisNo) asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, "Failed to read limits at axis %d", axisNo_); } + next_poll = -1; } From adf8b30692d58ab16eb2ba83a17666b57db651f4 Mon Sep 17 00:00:00 2001 From: koennecke Date: Tue, 20 Aug 2024 11:12:18 +0200 Subject: [PATCH 2/3] Minor changes to SINQ drivers: - Fixed enable/disable at MasterMACS --- sinqEPICSApp/src/EuroMoveDriver.cpp | 1 + sinqEPICSApp/src/MasterMACSDriver.cpp | 8 ++++++-- sinqEPICSApp/src/NanotecDriver.cpp | 2 +- sinqEPICSApp/src/PhytronDriver.cpp | 3 ++- sinqEPICSApp/src/pmacAxis.cpp | 2 +- sinqEPICSApp/src/pmacController.cpp | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sinqEPICSApp/src/EuroMoveDriver.cpp b/sinqEPICSApp/src/EuroMoveDriver.cpp index 7db7a86..10e4854 100644 --- a/sinqEPICSApp/src/EuroMoveDriver.cpp +++ b/sinqEPICSApp/src/EuroMoveDriver.cpp @@ -279,6 +279,7 @@ EuroMoveAxis::EuroMoveAxis(EuroMoveController *pC, int axisNo) pC_(pC) { motNo = axisNo; + next_poll = -1; } diff --git a/sinqEPICSApp/src/MasterMACSDriver.cpp b/sinqEPICSApp/src/MasterMACSDriver.cpp index 79b5602..a6bfc9c 100644 --- a/sinqEPICSApp/src/MasterMACSDriver.cpp +++ b/sinqEPICSApp/src/MasterMACSDriver.cpp @@ -191,13 +191,13 @@ asynStatus startTime = DoubleTime(); status = pasynOctetSyncIO->writeRead(pasynUserController_, mmacsData, - len - 1, mmacsResponse, 35, 10., &out, + len - 1, mmacsResponse, 35, 20., &out, &in, &reason); if(timeDebug) { now = DoubleTime(); if((now - startTime) > 1.) { - errlogSevPrintf(errlogMajor, "Unusual response time %lf to command %s\n", (now - startTime), command); + errlogSevPrintf(errlogMajor, "Unusual long response time %lf to command %s\n", (now - startTime), command); } } @@ -399,6 +399,7 @@ pC_(pC) int devStatus = readStatus(); setIntegerParam(pC_->enableAxis_, isOn(devStatus)); setIntegerParam(pC_->axisEnabled_, isOn(devStatus)); + lastPoll = -1; } /** Reports on status of the axis @@ -657,6 +658,9 @@ asynStatus MasterMACSAxis::poll(bool * moving) } } else { errlogPrintf("MMACS: communication problem reading axis %d position\n", axisNo_); + *moving = false; + comStatus = asynError; + goto skip; } // Read the overall status of this motor */ diff --git a/sinqEPICSApp/src/NanotecDriver.cpp b/sinqEPICSApp/src/NanotecDriver.cpp index f630d17..fdb02ed 100644 --- a/sinqEPICSApp/src/NanotecDriver.cpp +++ b/sinqEPICSApp/src/NanotecDriver.cpp @@ -138,7 +138,7 @@ NanotecAxis::NanotecAxis(NanotecController *pC, int axisNo, int busAddress) pC_(pC) { this->busAddress = busAddress; - + next_poll = -1; } diff --git a/sinqEPICSApp/src/PhytronDriver.cpp b/sinqEPICSApp/src/PhytronDriver.cpp index ae6a617..7529064 100644 --- a/sinqEPICSApp/src/PhytronDriver.cpp +++ b/sinqEPICSApp/src/PhytronDriver.cpp @@ -185,7 +185,7 @@ asynStatus PhytronController::transactController(int axisNo,char command[COMLEN] SINQAxis *axis = getAxis(axisNo); - pasynOctetSyncIO->flush(pasynUserController_); + /* pasynOctetSyncIO->flush(pasynUserController_); */ memset(myCommand,0,sizeof(myCommand)); @@ -249,6 +249,7 @@ PhytronAxis::PhytronAxis(PhytronController *pC, int axisNo, int enc) } haveBrake = 0; brakeIO = -1; + next_poll = -1; } int PhytronAxis::setBrake(int brakeNO) diff --git a/sinqEPICSApp/src/pmacAxis.cpp b/sinqEPICSApp/src/pmacAxis.cpp index 79cd046..6e80dfb 100644 --- a/sinqEPICSApp/src/pmacAxis.cpp +++ b/sinqEPICSApp/src/pmacAxis.cpp @@ -631,7 +631,7 @@ asynStatus pmacAxis::enable(int on) { * ======================================================*/ SeleneAxis::SeleneAxis(SeleneController *pC, int axisNo, double limitTarget) : pmacAxis(pC, axisNo, false) { - static const char *functionName = "pmacAxis::pmacAxis"; + static const char *functionName = "SeleneAxis::SeleneAxis"; pC_->debugFlow(functionName); diff --git a/sinqEPICSApp/src/pmacController.cpp b/sinqEPICSApp/src/pmacController.cpp index 8548e32..e03d81b 100644 --- a/sinqEPICSApp/src/pmacController.cpp +++ b/sinqEPICSApp/src/pmacController.cpp @@ -788,7 +788,7 @@ asynStatus SeleneController::writeFloat64(asynUser *pasynUser, epicsFloat64 valu int function = pasynUser->reason; asynStatus status = asynError; SeleneAxis *pAxis = NULL; -char command[64] = {0}; +cchar command[64] = {0}; char response[64] = {0}; char message[132]; From 33f118ce1e58dc7d047504b9ef0201d134b6f9e8 Mon Sep 17 00:00:00 2001 From: koennecke Date: Tue, 20 Aug 2024 11:14:18 +0200 Subject: [PATCH 3/3] Fixed type in pmacController.cpp --- sinqEPICSApp/src/pmacController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sinqEPICSApp/src/pmacController.cpp b/sinqEPICSApp/src/pmacController.cpp index e03d81b..8548e32 100644 --- a/sinqEPICSApp/src/pmacController.cpp +++ b/sinqEPICSApp/src/pmacController.cpp @@ -788,7 +788,7 @@ asynStatus SeleneController::writeFloat64(asynUser *pasynUser, epicsFloat64 valu int function = pasynUser->reason; asynStatus status = asynError; SeleneAxis *pAxis = NULL; -cchar command[64] = {0}; +char command[64] = {0}; char response[64] = {0}; char message[132];