From 440176e7c0e9c52541a86f332beb71aa086ea642 Mon Sep 17 00:00:00 2001 From: Mark Rivers Date: Fri, 24 Feb 2023 16:06:47 -0600 Subject: [PATCH] Wait for the status thread to set ADStatus to something other than ADStatusAcquire in the dataTask before finishing an acquisition --- andorApp/src/andorCCD.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index d06801e..2f993b1 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -1686,7 +1686,13 @@ void AndorCCD::dataTask(void) // Now clear main thread flag mAcquiringData = 0; setIntegerParam(ADAcquire, 0); - //setIntegerParam(ADStatus, 0); //Dont set this as the status thread sets it. + // Wait for the status thread to set ADStatus to something other than ADStatusAcquire + while (1) { + epicsInt32 acquireStatus; + getIntegerParam(ADStatus, &acquireStatus); + if (acquireStatus != ADStatusAcquire) break; + epicsThreadSleep(0.01); + } /* Call the callbacks to update any changes */ callParamCallbacks();