From d6ae408040401e7712a46c6d2581cebaab190ea5 Mon Sep 17 00:00:00 2001 From: kmpeters Date: Wed, 15 Aug 2012 21:05:14 +0000 Subject: [PATCH] Modified drvXPSAsyn.c to set motorAxisPowerOn instead of motorAxisProblem so the CNEN field updates properly. Only set motorAxisProblem if the axis is uninitialized or unreferenced. --- motorApp/NewportSrc/drvXPSAsyn.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/motorApp/NewportSrc/drvXPSAsyn.c b/motorApp/NewportSrc/drvXPSAsyn.c index 966a0964..78108634 100644 --- a/motorApp/NewportSrc/drvXPSAsyn.c +++ b/motorApp/NewportSrc/drvXPSAsyn.c @@ -1332,20 +1332,29 @@ static void XPSPoller(XPSController *pController) } /*Test for states that mean we cannot move an axis (disabled, uninitialised, etc.) - and set problem bit in MSTA.*/ + and set motorAxisPowerOn (CNEN).*/ if ((pAxis->axisStatus < 10) || ((pAxis->axisStatus >= 20) && (pAxis->axisStatus <= 42)) || - (pAxis->axisStatus == 50) || (pAxis->axisStatus == 64)) { + (pAxis->axisStatus == 50) || (pAxis->axisStatus == 63) || (pAxis->axisStatus == 64)) { if ( (pAxis->noDisabledError > 0) && (pAxis->axisStatus==20) ) { - motorParam->setInteger(pAxis->params, motorAxisProblem, 0); + motorParam->setInteger(pAxis->params, motorAxisPowerOn, 1); } else { PRINT(pAxis->logParam, FLOW, "XPS Axis %d is uninitialised/disabled/not referenced. XPS State Code: %d\n", pAxis->axis, pAxis->axisStatus); - motorParam->setInteger(pAxis->params, motorAxisProblem, 1); + motorParam->setInteger(pAxis->params, motorAxisPowerOn, 0); } + } else { + motorParam->setInteger(pAxis->params, motorAxisPowerOn, 1); + } + + /*Test for uninitialized states.*/ + if ((pAxis->axisStatus < 10) || (pAxis->axisStatus == 42) || (pAxis->axisStatus == 50) || (pAxis->axisStatus == 63)) { + PRINT(pAxis->logParam, FLOW, "XPS Axis %d is uninitialised. XPS State Code: %d\n", + pAxis->axis, pAxis->axisStatus); + motorParam->setInteger(pAxis->params, motorAxisProblem, 1); } else { motorParam->setInteger(pAxis->params, motorAxisProblem, 0); } - + } status = GroupPositionSetpointGet(pAxis->pollSocket,