diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index a8fb0b502f..57d880f125 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -39,7 +39,7 @@ Constant SWEEP_EPOCH_VERSION = 9 /// - New/Changed layers of entries /// ///@{ -Constant LABNOTEBOOK_VERSION = 81 +Constant LABNOTEBOOK_VERSION = 82 Constant RESULTS_VERSION = 3 ///@} @@ -2090,6 +2090,7 @@ StrConstant CO_PSX_CLIPPED_STATS = "psx_clippedStats" StrConstant CO_ARCHIVE_ONCE = "ArchiveLogs" StrConstant CO_PSX_UPGRADE_EVENT = "psx_updateEvent" StrConstant CO_AB_LOADHISTORYFROMPXP = "ABLoadHistoryFromPXP" +StrConstant CO_DAP_DIFF_FALLBACK_NI = "DiffFallbackNI" ///@} /// @name Constants for SweepFormula Meta data in JSON format diff --git a/Packages/MIES/MIES_DAC-Hardware.ipf b/Packages/MIES/MIES_DAC-Hardware.ipf index 983ddaea0f..90460a57ba 100644 --- a/Packages/MIES/MIES_DAC-Hardware.ipf +++ b/Packages/MIES/MIES_DAC-Hardware.ipf @@ -112,14 +112,19 @@ static Constant SUTTER_ACQUISITION_BACKGROUND = 2 /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// @param offset [optional, defaults to zero] offset into the data wave in points -Function HW_PrepareAcq(variable hardwareType, variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +/// @param ADCConfig [optional, defaults to NaN] available ADC configurations (NI hardware only) +Function HW_PrepareAcq(variable hardwareType, variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) + + if(ParamIsDefault(ADCConfig)) + ADCConfig = NaN + endif switch(hardwareType) case HARDWARE_ITC_DAC: return HW_ITC_PrepareAcq(deviceID, mode, flags = flags) break case HARDWARE_NI_DAC: - return HW_NI_PrepareAcq(deviceID, mode, flags = flags) + return HW_NI_PrepareAcq(deviceID, mode, flags = flags, ADCConfig = ADCConfig) break case HARDWARE_SUTTER_DAC: return HW_SU_PrepareAcq(deviceID, mode, flags = flags) @@ -1691,7 +1696,8 @@ End /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param offset [optional, defaults to zero] offset into the data wave in points /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +/// @param ADCConfig [optional] Not supported for ITC hardware +Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) string device variable tries @@ -1720,6 +1726,10 @@ Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCR config[][%Offset] = offset endif + if(!ParamIsDefault(ADCConfig)) + FATAL_ERROR("ADCConfig is not supported") + endif + WAVE config_t = HW_ITC_Transpose(config) do @@ -2018,7 +2028,7 @@ Function HW_ITC_DebugMode(variable state, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) DEBUGPRINT("Unimplemented") End @@ -2228,11 +2238,11 @@ Function/S HW_NI_AnalogInputToString(variable config) endif if(config & HW_NI_CONFIG_DIFFERENTIAL) - str += "Differential, " + str += "DIFF, " endif if(config & HW_NI_CONFIG_PSEUDO_DIFFERENTIAL) - str += "Pseudo Differential, " + str += "PDIFF, " endif ASSERT(!IsEmpty(str), "Invalid config") @@ -2249,6 +2259,8 @@ static Constant HW_NI_MIN_VOLTAGE = -10.0 static Constant HW_NI_MAX_VOLTAGE = +10.0 ///@} +/// Not to be confused with @ref NIAnalogInputConfigs +/// this is a fDAQmx_ReadChan flag only. static Constant HW_NI_DIFFERENTIAL_SETUP = 0 static Constant HW_NI_FIFOSIZE = 120 @@ -2322,10 +2334,11 @@ End /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param offset [optional, defaults to zero] offset into the data wave in points /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +/// @param ADCConfig Available ADC configurations (NI hardware only) +Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) string device, tempStr, realDeviceOrPressure, filename, clkStr, wavegenStr, TTLStr, fifoName, errMsg - variable i, aiCnt, ttlCnt, channels, sampleIntervall, numEntries, fifoSize, err, minimum, maximum + variable i, aiCnt, ttlCnt, channels, sampleIntervall, numEntries, fifoSize, err, minimum, maximum, ADCConfigBit DEBUGPRINTSTACKINFO() @@ -2352,6 +2365,18 @@ Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCRE FATAL_ERROR("Offset is not supported") endif + if(ParamIsDefault(ADCConfig)) + FATAL_ERROR("ADCConfig is missing") + endif + + if((ADCConfig & HW_NI_CONFIG_RSE) == HW_NI_CONFIG_RSE) + ADCConfigBit = HW_NI_CONFIG_RSE + elseif((ADCConfig & HW_NI_CONFIG_DIFFERENTIAL) == HW_NI_CONFIG_DIFFERENTIAL) + ADCConfigBit = HW_NI_CONFIG_DIFFERENTIAL + else + FATAL_ERROR("Can neither use RSE nor DIFFERENTIAL for DAQ, please file a bug report.") + endif + WAVE gain = SWS_GetChannelGains(device, timing = GAIN_BEFORE_DAQ) fifoName = GetNIFIFOName(deviceID) @@ -2371,7 +2396,7 @@ Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCRE ASSERT(!IsFreeWave(NIDataWave[i]), "Can not work with free waves") switch(config[i][%ChannelType]) case XOP_CHANNEL_TYPE_ADC: - scanStr += num2str(config[i][%ChannelNumber]) + "/RSE," + scanStr += num2str(config[i][%ChannelNumber]) + "/" + HW_NI_AnalogInputToString(ADCConfigBit) + "," scanStr += num2str(NI_ADC_MIN) + "," + num2str(NI_ADC_MAX) + "," scanStr += num2str(gain[i]) + ",0" scanStr += ";" @@ -2549,8 +2574,10 @@ Function HW_NI_PrintPropertiesOfDevices() lines = RemoveEnding(lines, ",") + Make/FREE/N=(numAI) ADCConfigs = HW_NI_GetAnalogInputConfig(device, p) + printf "Device name: %s\r", device - printf "#AI %d, #AO %d, #Cnt %d, #DIO ports %d with (%s) lines\r", numAI, numAO, numCounter, numDIO, lines + printf "#AI %d (config bits: [%s]), #AO %d, #Cnt %d, #DIO ports %d with (%s) lines\r", numAI, NumericWaveToList(ADCConfigs, ", ", trailSep = 0), numAO, numCounter, numDIO, lines printf "Last self calibration: %s\r", SelectString(IsFinite(selfCalDate), "na", GetIso8601TimeStamp(secondsSinceIgorEpoch = selfCalDate)) printf "Last external calibration: %s\r", GetIso8601TimeStamp(secondsSinceIgorEpoch = extCalDate) endfor @@ -3112,7 +3139,7 @@ Function HW_NI_StartAcq(variable deviceID, variable triggerMode, [variable flags DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) DoAbortNow("NI-DAQ XOP is not available") End @@ -3367,7 +3394,8 @@ End /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param offset [optional, defaults to zero] offset into the data wave in points /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +/// @param ADCConfig [optional] Not supported for Sutter hardware +Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) string device, encodeInfo variable channels, i, haveTTL, unassocADCIndex, unassocDACIndex @@ -3397,6 +3425,10 @@ Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCRE FATAL_ERROR("Offset is not supported") endif + if(!ParamIsDefault(ADCConfig)) + FATAL_ERROR("ADCConfig is not supported") + endif + WAVE gain = SWS_GetChannelGains(device, timing = GAIN_BEFORE_DAQ) WAVE hwGainTable = GetSUDeviceInputGains(device) @@ -3764,7 +3796,7 @@ Function HW_SU_StopAcq(variable deviceId, [variable zeroDAC, variable flags]) DoAbortNow("SUTTER XOP is not available") End -Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) +Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset, variable ADCConfig]) DoAbortNow("SUTTER XOP is not available") End diff --git a/Packages/MIES/MIES_DAEphys.ipf b/Packages/MIES/MIES_DAEphys.ipf index 45dc03cf2d..b453b5d8a4 100644 --- a/Packages/MIES/MIES_DAEphys.ipf +++ b/Packages/MIES/MIES_DAEphys.ipf @@ -2434,6 +2434,17 @@ Function DAP_CheckSettings(string device, variable mode) endif endif + WAVE statusADFiltered = DC_GetFilteredChannelState(device, DATA_ACQUISITION_MODE, CHANNEL_TYPE_ADC) + numEntries = DimSize(statusADFiltered, ROWS) + for(i = 0; i < numEntries; i += 1) + + if(!statusADFiltered[i]) + continue + endif + + DAP_GatherADCConfiguration(device, i) + endfor + // unlock DAQDataWave, this happens if user functions error out and we don't catch it WAVE DAQDataWave = GetDAQDataWave(device, mode) if(GetLockState(DAQDataWave)) @@ -2453,6 +2464,39 @@ Function DAP_CheckSettings(string device, variable mode) return 0 End +/// @brief Gather the ADC configuration bits +/// +/// Only for NI hardware, also warn users once if RSE can not be used. +static Function DAP_GatherADCConfiguration(string device, variable ADC) + + variable ADCConfigRead + + if(GetHardwareType(device) != HARDWARE_NI_DAC) + // nothing to do + return NaN + endif + + ADCConfigRead = HW_NI_GetAnalogInputConfig(device, ADC) + + NVAR ADCConfig = $GetDeviceADCConfig(device) + + if(IsNaN(ADCConfig)) + ADCConfig = ADCConfigRead + else + ASSERT(ADCConfig == ADCConfigRead, "Differing ADC configurations are not supported.") + endif + + if((ADCConfigRead & HW_NI_CONFIG_RSE) == HW_NI_CONFIG_RSE) + return NaN + endif + + if(!AlreadyCalledOnce(CO_DAP_DIFF_FALLBACK_NI)) + printf "The NI device %s does not support Single-Ended-Ground-Referenced (RSE) configuration for the ADC channel %d.\r", device, ADC + printf "If available we will fallback to Differential (Diff), see also https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019QRZSA2.\r" + ControlWindowToFront() + endif +End + static Function DAP_CheckAsyncSettings(string device) variable i, hwChannel, minValue, maxValue, auxOffset, isADinUse diff --git a/Packages/MIES/MIES_DataAcquisition_Multi.ipf b/Packages/MIES/MIES_DataAcquisition_Multi.ipf index 306594d582..4b8dadea16 100644 --- a/Packages/MIES/MIES_DataAcquisition_Multi.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Multi.ipf @@ -221,6 +221,8 @@ End /// at the very beginning of DAQ, turn off for RA Function DQM_StartDAQMultiDevice(string device, [variable initialSetupReq]) + variable ADCConfig + ASSERT(WhichListItem(GetRTStackInfo(2), DAQ_ALLOWED_FUNCTIONS) != -1, \ "Calling this function directly is not supported, please use PGC_SetAndActivateControl.") @@ -249,7 +251,8 @@ Function DQM_StartDAQMultiDevice(string device, [variable initialSetupReq]) // configure passed device NVAR deviceID = $GetDAQDeviceID(device) - HW_PrepareAcq(GetHardwareType(device), deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR) + ADCConfig = ROVar(GetDeviceADCConfig(device)) + HW_PrepareAcq(GetHardwareType(device), deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR, ADCConfig = ADCConfig) DAP_UpdateITIAcrossSets(device, maxITI) DQM_BkrdDataAcq(device) diff --git a/Packages/MIES/MIES_DataAcquisition_Single.ipf b/Packages/MIES/MIES_DataAcquisition_Single.ipf index 8cb3c2b4f1..cdf84c97f6 100644 --- a/Packages/MIES/MIES_DataAcquisition_Single.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Single.ipf @@ -48,12 +48,13 @@ End Function DQS_DataAcq(string device) - variable fifoPos, gotTPChannels, moreData + variable fifoPos, gotTPChannels, moreData, ADCConfig string oscilloscopeSubwindow = SCOPE_GetGraph(device) NVAR deviceID = $GetDAQDeviceID(device) - HW_PrepareAcq(HARDWARE_ITC_DAC, deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR) + ADCConfig = ROVar(GetDeviceADCConfig(device)) + HW_PrepareAcq(HARDWARE_ITC_DAC, deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR, ADCConfig = ADCConfig) if(DAG_GetNumericalValue(device, "Check_DataAcq1_RepeatAcq")) DQ_StartDAQDeviceTimer(device) @@ -89,8 +90,11 @@ End /// @ingroup BackgroundFunctions Function DQS_BkrdDataAcq(string device) + variable ADCConfig + NVAR deviceID = $GetDAQDeviceID(device) - HW_PrepareAcq(HARDWARE_ITC_DAC, deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR) + ADCConfig = ROVar(GetDeviceADCConfig(device)) + HW_PrepareAcq(HARDWARE_ITC_DAC, deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR, ADCConfig = ADCConfig) if(DAG_GetNumericalValue(device, "Check_DataAcq1_RepeatAcq")) DQ_StartDAQDeviceTimer(device) diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index 0b489b5291..cb61da43c3 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -1121,6 +1121,8 @@ static Function DC_PrepareLBNEntries(string device, STRUCT DataConfigurationResu DC_DocumentChannelProperty(device, RA_ACQ_CYCLE_ID_KEY, INDEP_HEADSTAGE, NaN, NaN, var = raCycleID) + DC_DocumentChannelProperty(device, "ADC Configuration bits", INDEP_HEADSTAGE, NaN, NaN, var = RoVar(GetDeviceADCConfig(device))) + // get maximum ITI from all DACs for(i = 0; i < s.numDACEntries; i += 1) maxITI = max(maxITI, WB_GetITI(s.stimSet[i], s.setColumn[i])) diff --git a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf index 580c28161e..5eebb84633 100644 --- a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf +++ b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf @@ -810,3 +810,11 @@ Function/S GetSweepFormulaBufferOffsetTracker() return GetNVARAsString(GetSweepFormulaPath(), "sweepFormulaParserBufferOffset", initialValue = NaN) End + +/// @brief Get the ADC configuration for NI devices +/// +/// Combination of @ref NIAnalogInputConfigs bits +Function/S GetDeviceADCConfig(string device) + + return GetNVARAsString(GetDevicePath(device), "ADCConfig", initialValue = NaN) +End diff --git a/Packages/MIES/MIES_TestPulse.ipf b/Packages/MIES/MIES_TestPulse.ipf index e35803fd8c..b0af277eb1 100644 --- a/Packages/MIES/MIES_TestPulse.ipf +++ b/Packages/MIES/MIES_TestPulse.ipf @@ -1489,6 +1489,8 @@ End /// @param fast [optional, defaults to false] Performs only the totally necessary steps for setup Function TP_Setup(string device, variable runMode, [variable fast]) + variable ADCConfig + if(ParamIsDefault(fast)) fast = 0 else @@ -1502,7 +1504,8 @@ Function TP_Setup(string device, variable runMode, [variable fast]) // fast restart is considered to be part of the same cycle NVAR deviceID = $GetDAQDeviceID(device) - HW_PrepareAcq(GetHardwareType(device), deviceID, TEST_PULSE_MODE, flags = HARDWARE_ABORT_ON_ERROR) + ADCConfig = ROVar(GetDeviceADCConfig(device)) + HW_PrepareAcq(GetHardwareType(device), deviceID, TEST_PULSE_MODE, flags = HARDWARE_ABORT_ON_ERROR, ADCConfig = ADCConfig) return NaN endif @@ -1523,7 +1526,8 @@ Function TP_Setup(string device, variable runMode, [variable fast]) DAP_AdaptAutoTPColorAndDependent(device) NVAR deviceID = $GetDAQDeviceID(device) - HW_PrepareAcq(GetHardwareType(device), deviceID, TEST_PULSE_MODE, flags = HARDWARE_ABORT_ON_ERROR) + ADCConfig = ROVar(GetDeviceADCConfig(device)) + HW_PrepareAcq(GetHardwareType(device), deviceID, TEST_PULSE_MODE, flags = HARDWARE_ABORT_ON_ERROR, ADCConfig = ADCConfig) End /// @brief Common setup calls for TP and TP during DAQ diff --git a/Packages/MIES/MIES_WaveDataFolderGetters.ipf b/Packages/MIES/MIES_WaveDataFolderGetters.ipf index 3ae72cf33d..644de79c18 100644 --- a/Packages/MIES/MIES_WaveDataFolderGetters.ipf +++ b/Packages/MIES/MIES_WaveDataFolderGetters.ipf @@ -32,7 +32,7 @@ static StrConstant TP_SETTINGS_LABELS = "bufferSize;resistanceTol;sendToAllHS;ba static StrConstant LOGBOOK_SUFFIX_SORTEDKEYS = "_sorted" static StrConstant LOGBOOK_SUFFIX_SORTEDKEYSINDICES = "_indices" -static Constant SWEEP_SETTINGS_WAVE_VERSION = 41 +static Constant SWEEP_SETTINGS_WAVE_VERSION = 42 /// @brief Return a wave reference to the corresponding Logbook keys wave from an values wave input threadsafe Function/WAVE GetLogbookValuesFromKeys(WAVE keyWave) @@ -2517,6 +2517,7 @@ End /// - 59: Require amplifier /// - 60: Skip Ahead /// - 61: TP power spectrum +/// - 62: ADC Configuration bits Function/WAVE GetSweepSettingsKeyWave(string device) variable versionOfNewWave = SWEEP_SETTINGS_WAVE_VERSION @@ -2538,7 +2539,7 @@ Function/WAVE GetSweepSettingsKeyWave(string device) if(WaveExists(wv)) Redimension/N=(-1, 63) wv else - Make/T/N=(3, 62) newDFR:$newName/WAVE=wv + Make/T/N=(3, 63) newDFR:$newName/WAVE=wv endif wv = "" @@ -2795,6 +2796,10 @@ Function/WAVE GetSweepSettingsKeyWave(string device) wv[%Units][61] = LABNOTEBOOK_BINARY_UNIT wv[%Tolerance][61] = LABNOTEBOOK_NO_TOLERANCE + wv[%Parameter][62] = "ADC Configuration bits" + wv[%Units][62] = "" + wv[%Tolerance][62] = "0.1" + SetSweepSettingsDimLabels(wv, wv) SetWaveVersion(wv, versionOfNewWave) diff --git a/Packages/MIES/labnotebook_numerical_description.itx b/Packages/MIES/labnotebook_numerical_description.itx index ce017fdca3..e1febdbc1c 100644 --- a/Packages/MIES/labnotebook_numerical_description.itx +++ b/Packages/MIES/labnotebook_numerical_description.itx @@ -1,5 +1,5 @@ IGOR -WAVES/T/N=(196,6) labnotebook_numerical_description +WAVES/T/N=(197,6) labnotebook_numerical_description BEGIN "Name" "Unit" "Tolerance" "Description" "Headstage Contingency" "ClampMode" "SweepNum" "" "-" "Sweep number: Non-repeating non-negative numeric identifier for sweep time series. Increments in the order of acquisition. Starts at zero." "ALL" "" @@ -197,6 +197,7 @@ BEGIN "Require amplifier" "On/Off" "-" "ON if data acquisition was done with an amplifier, OFF if not." "INDEP" "IC;VC;I=0" "Skip Ahead" "" "1" "Determines how many sweeps are skipped from the stimset whan starting data acquisition." "INDEP" "IC;VC;I=0" "Skip Sweeps source" "" "0.1" "Stores who is responsible for sweep skipping. Current values are 0x1 for the user and 0x2 for automatic/internal reasons." "INDEP" "IC;VC;I=0" + "ADC Configuration bits" "" "0.1" "Supported bits (1: RSE, 2: NRSE, 4: Diff, 8: Pseudo-Diff)" "INDEP" "IC;VC;I=0" END X SetScale/P x 0,1,"", labnotebook_numerical_description; SetScale/P y 0,1,"", labnotebook_numerical_description; SetScale d 0,0,"", labnotebook_numerical_description X Note labnotebook_numerical_description, "WAVE_LAYOUT_VERSION:2;" diff --git a/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf b/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf index ffbaed1247..f4edf4a845 100644 --- a/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf +++ b/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf @@ -414,7 +414,7 @@ End static Function UnassociatedChannelsAndTTLs_REENTRY([string str]) string device, sweeps, configs, unit, expectedStr, stimSetLengths2 - variable numEntries, i, j, k, numSweeps, numRacks, hardwareType, index + variable numEntries, i, j, k, numSweeps, numRacks, hardwareType, index, ADCConfig numSweeps = 1 @@ -768,6 +768,22 @@ static Function UnassociatedChannelsAndTTLs_REENTRY([string str]) TestNwbExportV1() TestNwbExportV2() endif + + ADCConfig = GetLastSettingIndep(numericalValues, 0, "ADC Configuration bits", DATA_ACQUISITION_MODE) + + INFO("ADCConfig: %d", n0 = ADCConfig) + + switch(hardwareType) + case HARDWARE_NI_DAC: + CHECK(IsFinite(ADCConfig)) + break + case HARDWARE_ITC_DAC: // fallthrough + case HARDWARE_SUTTER_DAC: + CHECK(IsNaN(ADCConfig)) + break + default: + FATAL_ERROR("Invalid hardware type: " + num2str(hardwareType)) + endswitch End // UTF_TD_GENERATOR DataGenerators#DeviceNameGeneratorMD1 diff --git a/README.md b/README.md index 9082d9787e..fae08e5003 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ Video tutorial of the postsynaptic potential/postsynaptic current data (PSX) ana Other NI hardware models can be added on request. Please open an issue from within MIES, `MIES Panels->Report an issue`, for that. + Better results are obtained if your hardware's analog input channels support Referenced Single Ended (RSE) + Terminal Configuration, but Differential is also supported as a fallback. See also + [this](https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019QRZSA2) article from NI Support. + - Instrutech/HEKA ITC: - [16](http://www.heka.com/downloads/hardware/manual/itc16.pdf) - [18](http://www.heka.com/downloads/hardware/manual/m_itc18.pdf)