From b4b093efdf423471a2f23ac8ec9f6915c6073348 Mon Sep 17 00:00:00 2001 From: koennecke Date: Mon, 20 May 2019 09:17:33 +0200 Subject: [PATCH] Some cleanup in EL734Driver.cpp --- sinqEPICSApp/src/EL734Driver.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sinqEPICSApp/src/EL734Driver.cpp b/sinqEPICSApp/src/EL734Driver.cpp index a3048b5..2a417a6 100644 --- a/sinqEPICSApp/src/EL734Driver.cpp +++ b/sinqEPICSApp/src/EL734Driver.cpp @@ -41,7 +41,6 @@ EL734Controller::EL734Controller(const char *portName, const char *EL734PortName { int axis; asynStatus status; - EL734Axis *pAxis; static const char *functionName = "EL734Controller::EL734Controller"; @@ -58,7 +57,7 @@ EL734Controller::EL734Controller(const char *portName, const char *EL734PortName switchRemote(); for (axis=0; axiswriteRead(pasynUserController_, command, strlen(command), + pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), reply,COMLEN, 1.,&out,&in,&reason); strcpy(command,"ECHO 0"); - status = pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), + pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), reply,COMLEN, 1.,&out,&in,&reason); strcpy(command,"RMT 1"); - status = pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), + pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), reply,COMLEN, 1.,&out,&in,&reason); strcpy(command,"ECHO 0"); - status = pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), + pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), reply,COMLEN, 1.,&out,&in,&reason); } /** @@ -274,6 +272,7 @@ asynStatus EL734Axis::move(double position, int relative, double minVelocity, do } oredMSR = 0; homing = 0; + //errlogPrintf("Starting axis %d with destination %f", axisNo_,position/1000); sprintf(command, "p %d %.3f", axisNo_, position/1000.); status = pC_->transactController(axisNo_,command,reply); setIntegerParam(pC_->motorStatusProblem_, false); @@ -422,8 +421,10 @@ asynStatus EL734Axis::poll(bool *moving) comStatus = pC_->transactController(axisNo_,command,reply); if(comStatus) goto skip; sscanf(reply,"%x",&msr); - // errlogPrintf("Axis %d, reply %s, msr %d, position = %lf\n", - // axisNo_, reply, msr, position); + + //errlogPrintf("Axis %d, reply %s, msr %d, oredmsr = %d, position = %lf\n", + // axisNo_, reply, msr, oredMSR, position); + oredMSR |= msr; if( (msr & 0x1) == 0){ // done: check for trouble @@ -447,8 +448,9 @@ asynStatus EL734Axis::poll(bool *moving) setIntegerParam(pC_->motorStatusAtHome_, true); } setIntegerParam(pC_->motorStatusProblem_, false); - if(oredMSR &0x1000){ + if(oredMSR & 0x1000){ setIntegerParam(pC_->motorStatusProblem_, true); + // errlogPrintf("Detected air cushion error on %d", axisNo_); errlogSevPrintf(errlogMajor, "Air cushion problem on %d", axisNo_); updateMsgTxtFromDriver("Air cushion error"); driverError = 1; @@ -465,7 +467,7 @@ asynStatus EL734Axis::poll(bool *moving) *moving = true; next_poll = -1; setIntegerParam(pC_->motorStatusDone_, false); - //updateMsgTxtFromDriver("Creeping"); + updateMsgTxtFromDriver("Creeping"); } skip: