From d28f694a5fcbba3f38c82847c1b96d3746f51318 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Thu, 3 Jun 2010 16:02:24 +0000 Subject: [PATCH] Set motorAxisHasEncoder based on CfgFbkPosType parameter. --- motorApp/AerotechSrc/drvEnsembleAsyn.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/motorApp/AerotechSrc/drvEnsembleAsyn.cc b/motorApp/AerotechSrc/drvEnsembleAsyn.cc index aa5e7a79..13973806 100644 --- a/motorApp/AerotechSrc/drvEnsembleAsyn.cc +++ b/motorApp/AerotechSrc/drvEnsembleAsyn.cc @@ -40,6 +40,7 @@ in file LICENSE that is included with this distribution. * error check that pController is not Null. * - changed EOT LS read status from AXISFAULT to AXISSTATUS so * LS status can be monitored independent of fault status. +* .08 06-03-10 rls - Set motorAxisHasEncoder based on CfgFbkPosType parameter. */ @@ -905,10 +906,20 @@ int EnsembleAsynConfig(int card, /* Controller number */ pAxis->homeDirection = atoi(&inputBuff[1]); numAxesFound++; - sprintf(outputBuff, "GETPARM(@%d, %d)", axis, ParameterNumber_LimitLevelMask); /* */ + sprintf(outputBuff, "GETPARM(@%d, %d)", axis, ParameterNumber_LimitLevelMask); sendAndReceive(pController, outputBuff, inputBuff, sizeof(inputBuff)); if (inputBuff[0] == ASCII_ACK_CHAR) pAxis->swconfig.All = atoi(&inputBuff[1]); + + /* Determine if encoder present based on open/closed loop mode. */ + sprintf(outputBuff, "GETPARM(@%d, %d)", axis, ParameterNumber_CfgFbkPosType); + sendAndReceive(pController, outputBuff, inputBuff, sizeof(inputBuff)); + if (inputBuff[0] == ASCII_ACK_CHAR) + { + if (atoi(&inputBuff[1]) > 0) + motorParam->setInteger(pAxis->params, motorAxisHasEncoder, 1); + } + } }