From c930a778111d4603a5188bde2103debf1c6bcb2c Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Fri, 21 Jun 2024 15:37:33 -0500 Subject: [PATCH] Added gain checking to the poll method. --- dsmApp/src/MD90Driver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dsmApp/src/MD90Driver.cpp b/dsmApp/src/MD90Driver.cpp index aba0b70..6aaf1ef 100644 --- a/dsmApp/src/MD90Driver.cpp +++ b/dsmApp/src/MD90Driver.cpp @@ -367,6 +367,14 @@ asynStatus MD90Axis::poll(bool *moving) sscanf (pC_->inString_, "%d: %[^:]: %lf", &replyStatus, replyString, &position); setDoubleParam(pC_->motorPosition_, position); + // Read the current motor integral gain (range 1-1000) + sprintf(pC_->outString_, "GGN"); + comStatus = pC_->writeReadController(); + if (comStatus) goto skip; + // The response string is of the form "0: Gain: 1000" + sscanf (pC_->inString_, "%d: %[^:]: %d", &replyStatus, replyString, &replyValue); + setDoubleParam(pC_->motorIGain_, replyValue); + skip: setIntegerParam(pC_->motorStatusProblem_, comStatus ? 1:0); callParamCallbacks();