forked from epics_driver_modules/motorBase
Updated to PI_GCS2_2013_07_12.tgz
This commit is contained in:
@@ -21,8 +21,8 @@ Created: 15.12.2010
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
//#undef asynPrint
|
||||
//#define asynPrint(user,reason,format...) 0
|
||||
#undef asynPrint
|
||||
#define asynPrint(user,reason,format...) 0
|
||||
|
||||
|
||||
asynStatus PIE517Controller::init()
|
||||
@@ -74,11 +74,4 @@ asynStatus PIE517Controller::getNrOutputChannels()
|
||||
|
||||
}
|
||||
|
||||
asynStatus PIE517Controller::initAxis(PIasynAxis* pAxis)
|
||||
{
|
||||
pAxis->m_movingStateMask = pow(2.0, pAxis->getAxisNo());
|
||||
|
||||
return setServo(pAxis, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,11 @@ public:
|
||||
~PIE517Controller() {}
|
||||
|
||||
virtual asynStatus init(void);
|
||||
virtual asynStatus initAxis(PIasynAxis* pAxis);
|
||||
virtual asynStatus haltAxis(PIasynAxis* pAxis)
|
||||
{
|
||||
// E-517 does support HLT with single axis
|
||||
return PIGCSController::haltAxis(pAxis);
|
||||
}
|
||||
|
||||
private:
|
||||
asynStatus setOnline(int outputChannel, int onlineState);
|
||||
|
||||
@@ -19,8 +19,8 @@ Original Author: Steffen Rau
|
||||
#include "PIasynAxis.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
//#undef asynPrint
|
||||
//#define asynPrint(user,reason,format...) 0
|
||||
#undef asynPrint
|
||||
#define asynPrint(user,reason,format...) 0
|
||||
|
||||
|
||||
asynStatus PIE755Controller::getStatus(PIasynAxis* pAxis, int& homing, int& moving, int& negLimit, int& posLimit, int& servoControl)
|
||||
|
||||
@@ -55,6 +55,12 @@ PIGCSController* PIGCSController::CreateGCSController(asynUser* pInterface, cons
|
||||
{
|
||||
return new PIE517Controller(pInterface, szIDN);
|
||||
}
|
||||
else if ( strstr(szIDN, "E-753") != NULL
|
||||
|| strstr(szIDN, "E-709") != NULL
|
||||
)
|
||||
{
|
||||
return new PIGCSPiezoController(pInterface, szIDN);
|
||||
}
|
||||
else if ( strstr(szIDN, "E-755") != NULL)
|
||||
{
|
||||
return new PIE755Controller(pInterface, szIDN);
|
||||
@@ -314,8 +320,6 @@ asynStatus PIGCSController::moveCts( PIasynAxis** pAxesArray, int* pTargetCtsArr
|
||||
|
||||
asynStatus PIGCSController::moveCts( PIasynAxis* pAxis, int targetCts )
|
||||
{
|
||||
asynStatus status;
|
||||
char cmd[100];
|
||||
double target = double(targetCts) * pAxis->m_CPUdenominator / pAxis->m_CPUnumerator;
|
||||
asynPrint(m_pInterface, ASYN_TRACE_FLOW|ASYN_TRACE_ERROR,
|
||||
"PIGCSController::moveCts(, %d) \n", targetCts);
|
||||
|
||||
@@ -21,8 +21,8 @@ Created: 15.12.2010
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
//#undef asynPrint
|
||||
//#define asynPrint(user,reason,format...) 0
|
||||
#undef asynPrint
|
||||
#define asynPrint(user,reason,format...) 0
|
||||
|
||||
|
||||
asynStatus PIGCSPiezoController::getStatus(PIasynAxis* pAxis, int& homing, int& moving, int& negLimit, int& posLimit, int& servoControl)
|
||||
@@ -46,3 +46,33 @@ asynStatus PIGCSPiezoController::getReferencedState(PIasynAxis* pAxis)
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
asynStatus PIGCSPiezoController::initAxis(PIasynAxis* pAxis)
|
||||
{
|
||||
pAxis->m_movingStateMask = pow(2.0, pAxis->getAxisNo());
|
||||
|
||||
return setServo(pAxis, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Currenty no Piezo controller supports "HLT".
|
||||
* use STP - which will stop all axes...
|
||||
*/
|
||||
asynStatus PIGCSPiezoController::haltAxis(PIasynAxis* pAxis)
|
||||
{
|
||||
asynStatus status = sendOnly("STP");
|
||||
if (status != asynSuccess)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
int err = getGCSError();
|
||||
// controller will set error code to PI_CNTR_STOP (10)
|
||||
if (err != PI_CNTR_STOP)
|
||||
{
|
||||
asynPrint(m_pCurrentLogSink, ASYN_TRACE_FLOW|ASYN_TRACE_ERROR,
|
||||
"PIGCSPiezoController::haltAxis() failed, GCS error %d", err);
|
||||
return asynError;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
~PIGCSPiezoController() {}
|
||||
|
||||
virtual asynStatus init(void) { return PIGCSController::init(); }
|
||||
virtual asynStatus initAxis(PIasynAxis* pAxis);
|
||||
virtual asynStatus haltAxis(PIasynAxis* pAxis);
|
||||
|
||||
virtual asynStatus getStatus(PIasynAxis* pAxis, int& homing, int& moving, int& negLimit, int& posLimit, int& servoControl);
|
||||
virtual asynStatus getReferencedState(PIasynAxis* pAxis);
|
||||
|
||||
@@ -43,6 +43,7 @@ asynStatus PIHexapodController::init(void)
|
||||
m_bCanReadStatusWithChar4 = false;
|
||||
getGCSError(); // clear error UNKNOWN COMMAND
|
||||
}
|
||||
/* m_bCanReadPosWithChar3=true causes DMOV problems */
|
||||
// status = sendAndReceive(char(3), buf, 199);
|
||||
// if (status == asynSuccess)
|
||||
// {
|
||||
@@ -229,6 +230,7 @@ asynStatus PIHexapodController::moveCts( PIasynAxis** pAxesArray, int* pTargetCt
|
||||
|
||||
asynStatus PIHexapodController::getAxisPosition(PIasynAxis* pAxis, double& position)
|
||||
{
|
||||
m_pCurrentLogSink = m_pInterface;
|
||||
if (!m_bAnyAxisMoving)
|
||||
{
|
||||
return PIGCSController::getAxisPosition(pAxis, position);
|
||||
|
||||
@@ -35,6 +35,7 @@ Based on drvMotorSim.c, Mark Rivers, December 13, 2009
|
||||
#include <iocsh.h>
|
||||
#include <epicsExport.h>
|
||||
#include <asynOctetSyncIO.h>
|
||||
#include <motorVersion.h>
|
||||
#include <motor_interface.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -261,7 +262,7 @@ asynStatus PIasynController::writeInt32(asynUser *pasynUser, epicsInt32 value)
|
||||
* status at the end, but that's OK */
|
||||
status = pAxis->setIntegerParam(function, value);
|
||||
|
||||
if (function == motorClosedLoop_)
|
||||
if (function == motorSetClosedLoop_)
|
||||
{
|
||||
asynPrint(pasynUser, ASYN_TRACE_FLOW,
|
||||
"%s:%s: %sing Closed-Loop Control flag on driver %s\n",
|
||||
@@ -346,7 +347,7 @@ asynStatus PIasynController::writeFloat64(asynUser *pasynUser, epicsFloat64 valu
|
||||
/* Call base class call its method (if we have our parameters check this here) */
|
||||
status = asynMotorController::writeFloat64(pasynUser, value);
|
||||
}
|
||||
else if (function == motorEncoderRatio_)
|
||||
else if (function == motorEncRatio_)
|
||||
{
|
||||
/* Call base class call its method (if we have our parameters check this here) */
|
||||
status = asynMotorController::writeFloat64(pasynUser, value);
|
||||
@@ -486,15 +487,16 @@ asynStatus PIasynController::configAxis(PIasynAxis *pAxis)
|
||||
|
||||
asynStatus PIasynController::poll()
|
||||
{
|
||||
return m_pGCSController->getGlobalState(pAxes_, numAxes_);
|
||||
m_pGCSController->getGlobalState(pAxes_, numAxes_);
|
||||
|
||||
setDoubleParam( 0, PI_SUP_RBPIVOT_X, m_pGCSController->GetPivotX());
|
||||
setDoubleParam( 0, PI_SUP_RBPIVOT_X, m_pGCSController->GetPivotX());
|
||||
setDoubleParam( 0, PI_SUP_RBPIVOT_Y, m_pGCSController->GetPivotY());
|
||||
setDoubleParam( 0, PI_SUP_RBPIVOT_Z, m_pGCSController->GetPivotZ());
|
||||
|
||||
setIntegerParam( 0, PI_SUP_LAST_ERR, m_pGCSController->GetLastError() );
|
||||
|
||||
callParamCallbacks();
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user