From afc7109cd2cf244577f4d690741f5055685da63e Mon Sep 17 00:00:00 2001 From: Michael Dunning Date: Sat, 4 Nov 2017 11:24:07 -0700 Subject: [PATCH] Add support for Frame Transfer Mode --- andorApp/Db/andorCCD.template | 19 +++++++++++++++++++ andorApp/Db/andorCCD_settings.req | 1 + andorApp/src/andorCCD.cpp | 30 ++++++++++++++++++++---------- andorApp/src/andorCCD.h | 4 +++- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/andorApp/Db/andorCCD.template b/andorApp/Db/andorCCD.template index 63b1c4f..cd0c6c1 100644 --- a/andorApp/Db/andorCCD.template +++ b/andorApp/Db/andorCCD.template @@ -387,6 +387,25 @@ record(mbbi, "$(P)$(R)AndorReadOutMode_RBV") field(SCAN, "I/O Intr") } +# Frame Transfer Mode +record(bo, "$(P)$(R)AndorFTMode") +{ + field(PINI, "1") + field(DTYP, "asynInt32") + field(ZNAM, "Disabled") + field(ONAM, "Enabled") + field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))ANDOR_FT_MODE") +} + +record(bi, "$(P)$(R)AndorFTMode_RBV") +{ + field(DTYP, "asynInt32") + field(ZNAM, "Disabled") + field(ONAM, "Enabled") + field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))ANDOR_FT_MODE") + field(SCAN, "I/O Intr") +} + #Records in ADBase that do not apply to Andor record(mbbo, "$(P)$(R)ColorMode") diff --git a/andorApp/Db/andorCCD_settings.req b/andorApp/Db/andorCCD_settings.req index cf7395d..f966548 100644 --- a/andorApp/Db/andorCCD_settings.req +++ b/andorApp/Db/andorCCD_settings.req @@ -9,6 +9,7 @@ $(P)$(R)AndorEMGainMode $(P)$(R)AndorEMGainAdvanced $(P)$(R)AndorADCSpeed $(P)$(R)AndorReadOutMode +$(P)$(R)AndorFTMode file "ADBase_settings.req", P=$(P), R=$(R) file "NDFile_settings.req", P=$(P), R=$(R) diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index 7272a25..2ce9a87 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -153,6 +153,7 @@ AndorCCD::AndorCCD(const char *portName, const char *installPath, int shamrockID createParam(AndorAdcSpeedString, asynParamInt32, &AndorAdcSpeed); createParam(AndorBaselineClampString, asynParamInt32, &AndorBaselineClamp); createParam(AndorReadOutModeString, asynParamInt32, &AndorReadOutMode); + createParam(AndorFrameTransferModeString, asynParamInt32, &AndorFrameTransferMode); // Create the epicsEvent for signaling to the status task when parameters should have changed. // This will cause it to do a poll immediately, rather than wait for the poll time period. @@ -249,6 +250,7 @@ AndorCCD::AndorCCD(const char *portName, const char *installPath, int shamrockID status |= setDoubleParam(ADShutterOpenDelay, 0.); status |= setDoubleParam(ADShutterCloseDelay, 0.); status |= setIntegerParam(AndorReadOutMode, ARImage); + status |= setIntegerParam(AndorFrameTransferMode, 0); setupADCSpeeds(); setupPreAmpGains(); @@ -574,16 +576,16 @@ asynStatus AndorCCD::writeInt32(asynUser *pasynUser, epicsInt32 value) } } } - else if ((function == ADNumExposures) || (function == ADNumImages) || - (function == ADImageMode) || - (function == ADBinX) || (function == ADBinY) || - (function == ADMinX) || (function == ADMinY) || - (function == ADSizeX) || (function == ADSizeY) || - (function == ADReverseX) || (function == ADReverseY) || - (function == ADTriggerMode) || (function == AndorEmGain) || - (function == AndorEmGainMode)|| (function == AndorEmGainAdvanced) || - (function == AndorAdcSpeed) || (function == AndorPreAmpGain) || - (function == AndorReadOutMode)) { + else if ((function == ADNumExposures) || (function == ADNumImages) || + (function == ADImageMode) || + (function == ADBinX) || (function == ADBinY) || + (function == ADMinX) || (function == ADMinY) || + (function == ADSizeX) || (function == ADSizeY) || + (function == ADReverseX) || (function == ADReverseY) || + (function == ADTriggerMode) || (function == AndorEmGain) || + (function == AndorEmGainMode) || (function == AndorEmGainAdvanced) || + (function == AndorAdcSpeed) || (function == AndorPreAmpGain) || + (function == AndorReadOutMode) || (function == AndorFrameTransferMode)) { status = setupAcquisition(); if (function == AndorAdcSpeed) setupPreAmpGains(); if (status != asynSuccess) setIntegerParam(function, oldValue); @@ -1006,6 +1008,7 @@ asynStatus AndorCCD::setupAcquisition() int FKOffset; AndorADCSpeed_t *pSpeed; int readOutMode; + int frameTransferMode; static const char *functionName = "setupAcquisition"; if (!mInitOK) { @@ -1094,6 +1097,8 @@ asynStatus AndorCCD::setupAcquisition() // for the actual size of the image, so we must compute it. setIntegerParam(NDArraySizeX, sizeX/binX); setIntegerParam(NDArraySizeY, sizeY/binY); + + getIntegerParam(AndorFrameTransferMode, &frameTransferMode); try { asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW, @@ -1165,6 +1170,11 @@ asynStatus AndorCCD::setupAcquisition() checkStatus(SetEMCCDGain(emGain)); } + asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s:, SetFrameTransferMode(%d)\n", + driverName, functionName, frameTransferMode); + checkStatus(SetFrameTransferMode(frameTransferMode)); + switch (imageMode) { case ADImageSingle: if (numExposures == 1) { diff --git a/andorApp/src/andorCCD.h b/andorApp/src/andorCCD.h index cfa2dec..625ab6a 100755 --- a/andorApp/src/andorCCD.h +++ b/andorApp/src/andorCCD.h @@ -35,6 +35,7 @@ #define AndorAdcSpeedString "ANDOR_ADC_SPEED" #define AndorBaselineClampString "ANDOR_BASELINE_CLAMP" #define AndorReadOutModeString "ANDOR_READOUT_MODE" +#define AndorFrameTransferModeString "ANDOR_FT_MODE" /** * Structure defining an ADC speed for the ADAndor driver. @@ -97,7 +98,8 @@ class AndorCCD : public ADDriver { int AndorAdcSpeed; int AndorBaselineClamp; int AndorReadOutMode; - #define LAST_ANDOR_PARAM AndorReadOutMode + int AndorFrameTransferMode; + #define LAST_ANDOR_PARAM AndorFrameTransferMode private: