diff --git a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf index 7674e122b0..c395de6884 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf @@ -5970,8 +5970,7 @@ Function PSQ_Ramp(string device, STRUCT AnalysisFunction_V3 &s) // stop DAQ, set DA to zero from now to the end and start DAQ again // fetch the very last fifo position immediately before we stop it - NVAR tgID = $GetThreadGroupIDFIFO(device) - fifoOffset = TS_GetNewestFromThreadQueue(tgID, "fifoPos") + fifoOffset = HW_ITC_ReadFifoPos(device) TFH_StopFIFODaemon(HARDWARE_ITC_DAC, deviceID) HW_StopAcq(HARDWARE_ITC_DAC, deviceID) HW_ITC_PrepareAcq(deviceID, DATA_ACQUISITION_MODE, offset = fifoOffset) @@ -5988,14 +5987,13 @@ Function PSQ_Ramp(string device, STRUCT AnalysisFunction_V3 &s) // fetch newest fifo position, blocks until it gets a valid value // its zero is now fifoOffset - NVAR tgID = $GetThreadGroupIDFIFO(device) - fifoPos = TS_GetNewestFromThreadQueue(tgID, "fifoPos") + fifoPos = HW_ITC_ReadFifoPos(device) ASSERT(fifoPos > 0, "Invalid fifo position, has the thread died?") // wait until the hardware is finished with writing this chunk // this is to avoid that two threads write simultaneously into the DAQDataWave for(;;) - val = TS_GetNewestFromThreadQueue(tgID, "fifoPos") + val = HW_ITC_ReadFifoPos(device) if(val > fifoPos) break diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index d8233ffc32..3a51ba09f1 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -2428,4 +2428,8 @@ StrConstant CONF_DEFAULT_SAVE_LOCATION = "C:MiesSave" // TP_TSAnalysis // GetTPResultAsyncBuffer // GetTPResults (reuses same dimlabels partially) -StrConstant TP_ANALYSIS_DATA_LABELS = "BASELINE;STEADYSTATERES;INSTANTRES;ELEVATED_SS;ELEVATED_INST;NOW;HEADSTAGE;MARKER;NUMBER_OF_TP_CHANNELS;TIMESTAMP;TIMESTAMPUTC;CLAMPMODE;CLAMPAMP;BASELINEFRAC;CYCLEID;TPLENGTHPOINTSADC;PULSELENGTHPOINTSADC;PULSESTARTPOINTSADC;SAMPLINGINTERVALADC;TPLENGTHPOINTSDAC;PULSELENGTHPOINTSDAC;PULSESTARTPOINTSDAC;SAMPLINGINTERVALDAC;" +StrConstant TP_ANALYSIS_DATA_LABELS = "BASELINE;STEADYSTATERES;INSTANTRES;ELEVATED_SS;ELEVATED_INST;HEADSTAGE;MARKER;NUMBER_OF_TP_CHANNELS;TIMESTAMP;TIMESTAMPUTC;CLAMPMODE;CLAMPAMP;BASELINEFRAC;CYCLEID;TPLENGTHPOINTSADC;PULSELENGTHPOINTSADC;PULSESTARTPOINTSADC;SAMPLINGINTERVALADC;TPLENGTHPOINTSDAC;PULSELENGTHPOINTSDAC;PULSESTARTPOINTSDAC;SAMPLINGINTERVALDAC;" + +// Object names for thread data transfer out of ITC Fifothread @ref TFH_FifoLoop +StrConstant ITC_THREAD_FIFOPOS = "fifopos" +StrConstant ITC_THREAD_TIMESTAMP = "timestamp" diff --git a/Packages/MIES/MIES_DAC-Hardware.ipf b/Packages/MIES/MIES_DAC-Hardware.ipf index 612d22fd41..a4763b3bea 100644 --- a/Packages/MIES/MIES_DAC-Hardware.ipf +++ b/Packages/MIES/MIES_DAC-Hardware.ipf @@ -626,6 +626,11 @@ Function HW_WriteDeviceInfo(variable hardwareType, string device, WAVE deviceInf endswitch End +threadsafe Function/S HW_GetAcquisitionStartTimestamp() + + return GetIso8601TimeStamp(numFracSecondsDigits = 9) +End + /// @brief Start data acquisition /// /// @param hardwareType One of @ref HardwareDACTypeConstants @@ -635,12 +640,18 @@ End /// @param repeat [optional, default 0] for NI devices, repeats the scan after it ends Function HW_StartAcq(variable hardwareType, variable deviceID, [variable triggerMode, variable flags, variable repeat]) + string device + HW_AssertOnInvalid(hardwareType, deviceID) if(ParamIsDefault(triggerMode)) triggerMode = HARDWARE_DAC_DEFAULT_TRIGGER endif + device = HW_GetMainDeviceName(hardwareType, deviceID, flags = flags) + SVAR lastAcqStartTime = $GetLastAcquisitionStartTime(device) + lastAcqStartTime = HW_GetAcquisitionStartTimestamp() + switch(hardwareType) case HARDWARE_ITC_DAC: HW_ITC_StartAcq(deviceID, triggerMode, flags = flags) @@ -1515,7 +1526,7 @@ threadsafe Function HW_ITC_StartAcq_TS(variable deviceID, variable triggerMode, End /// @see HW_StartAcq -Function HW_ITC_StartAcq(variable deviceID, variable triggerMode, [variable flags]) +static Function HW_ITC_StartAcq(variable deviceID, variable triggerMode, [variable flags]) variable tries @@ -2153,6 +2164,28 @@ Function HW_ITC_IsValidDeviceName(string deviceName) return !isEmpty(deviceName) End +/// @brief Read out the fifopos from the ITC fifothread and update the acquisition start time if needed +Function HW_ITC_ReadFifoPos(string device, [variable timeout_tries, variable timeout_default]) + + timeout_default = ParamIsDefault(timeout_default) ? NaN : timeout_default + timeout_tries = ParamIsDefault(timeout_tries) ? Inf : timeout_tries + + Make/FREE/T varNames = {ITC_THREAD_FIFOPOS, ITC_THREAD_TIMESTAMP} + + NVAR tgID = $GetThreadGroupIDFIFO(device) + WAVE/Z data = TS_GetNewestFromThreadQueueMult(tgID, varNames, timeout_tries = timeout_tries, timeout_default = timeout_default) + if(!WaveExists(data)) + // ITC TFH_FifoLoop thread stopped + return NaN + endif + if(!IsNaN(data[%$ITC_THREAD_TIMESTAMP])) + SVAR lastAcqStartTime = $GetLastAcquisitionStartTime(device) + lastAcqStartTime = GetISO8601TimeStamp(secondsSinceIgorEpoch = data[%$ITC_THREAD_TIMESTAMP], numFracSecondsDigits = 9) + endif + + return data[%$ITC_THREAD_FIFOPOS] +End + ///@} ///@} @@ -2224,7 +2257,7 @@ static Constant HW_NI_FIFO_MIN_FREE_DISK_SPACE = 960000000 /// /// @see HW_StartAcq -Function HW_NI_StartAcq(variable deviceID, variable triggerMode, [variable flags, variable repeat]) +static Function HW_NI_StartAcq(variable deviceID, variable triggerMode, [variable flags, variable repeat]) string device, realDeviceOrPressure, FIFONote, noteID, fifoName, errMsg variable i, pos, endpos, channelTimeOffset, err @@ -3499,7 +3532,7 @@ static Function [variable hwChannel, string encode] HW_SU_GetEncodeFromUnassocDA return [hwChannel, encode] End -Function HW_SU_StartAcq(variable deviceId, [variable flags]) +static Function HW_SU_StartAcq(variable deviceId, [variable flags]) string device, cmdError, cmdDone diff --git a/Packages/MIES/MIES_DataAcquisition_Multi.ipf b/Packages/MIES/MIES_DataAcquisition_Multi.ipf index dd4e66992b..ce9cfd707e 100644 --- a/Packages/MIES/MIES_DataAcquisition_Multi.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Multi.ipf @@ -87,8 +87,7 @@ Function DQM_FIFOMonitor(STRUCT BackgroundStruct &s) endtry break case HARDWARE_ITC_DAC: - NVAR tgID = $GetThreadGroupIDFIFO(device) - fifoLatest = TS_GetNewestFromThreadQueue(tgID, "fifoPos", timeout_default = HARDWARE_ITC_FIFO_ERROR, timeout_tries = THREAD_QUEUE_TRIES) + fifoLatest = HW_ITC_ReadFifoPos(device, timeout_default = HARDWARE_ITC_FIFO_ERROR, timeout_tries = THREAD_QUEUE_TRIES) if(fifoLatest != s.lastReceivedFifoPos) s.ticksLastReceivedFifoPos = ticks @@ -126,7 +125,7 @@ Function DQM_FIFOMonitor(STRUCT BackgroundStruct &s) endif // once TFH_FifoLoop is finished the thread is done as well and - // therefore we get NaN from TS_GetNewestFromThreadQueue + // therefore we get NaN from HW_ITC_ReadFifoPos isFinished = IsNaN(fifoLatest) // Update ActiveChunk Entry for ITC, not used in DAQ mode diff --git a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf index 9a7fbcd1cb..6fa46ba4df 100644 --- a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf +++ b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf @@ -518,6 +518,12 @@ Function/S GetNI_TTLTaskID(string device) return GetNVARAsString(GetDevicePath(device), "NI_TTL_taskID", initialValue = NaN) End +/// @brief Returns the global that stores the last acquisition start time +Function/S GetLastAcquisitionStartTime(string device) + + return GetSVARAsString(GetDevicePath(device), "LastAcquisitionStartTime", initialValue = "") +End + /// @brief Return the experiment session start time in NWB-speech /// /// This is the time when the last device was locked. diff --git a/Packages/MIES/MIES_LogbookViewer.ipf b/Packages/MIES/MIES_LogbookViewer.ipf index a0bad751b8..7c082b4d3d 100644 --- a/Packages/MIES/MIES_LogbookViewer.ipf +++ b/Packages/MIES/MIES_LogbookViewer.ipf @@ -1228,8 +1228,8 @@ static Function LBV_LimitXRangeToSelected(string browser) endif // convert to local time zone - first += date2secs(-1, -1, -1) - last += date2secs(-1, -1, -1) + first = UTCTimeToLocal(first) + last = UTCTimeToLocal(last) ASSERT(IsFinite(first) && IsFinite(last), "Invalid first/last") else diff --git a/Packages/MIES/MIES_MiesUtilities_Sweep.ipf b/Packages/MIES/MIES_MiesUtilities_Sweep.ipf index 70142e4171..428c057d76 100644 --- a/Packages/MIES/MIES_MiesUtilities_Sweep.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Sweep.ipf @@ -303,7 +303,7 @@ threadsafe static Function UpgradeSweepWave(WAVE sweepWave, WAVE/T componentName // we also have to preserve the original modification time ASSERT_TS(!CmpStr(WaveUnits(sweepWave, ROWS), "ms"), "Expected ms as wave units") modTimeStr = StringByKeY("MODTIME", WaveInfo(sweepWave, 0)) - sweepCreationTimeUTC = str2num(modTimeStr) - date2secs(-1, -1, -1) + sweepCreationTimeUTC = LocalTimeToUTC(str2num(modTimeStr)) sweepCreationTimeUTC -= DimSize(sweepWave, ROWS) * DimDelta(sweepWave, ROWS) * MILLI_TO_ONE oldSweepName = UniqueWaveName(sweepWaveDFR, sweepWaveName + "_preUpgrade") @@ -440,7 +440,10 @@ End Function LeftOverSweepTime(string device, variable fifoPos) - ASSERT(IsFinite(fifoPos), "Unexpected non-finite fifoPos") + if(IsNaN(fifopos)) + // TFH_FifoLoop thread finished -> sweep finished regular (or manually stopped) + return 0 + endif WAVE DAQDataWave = GetDAQDataWave(device, DATA_ACQUISITION_MODE) NVAR stopCollectionPoint = $GetStopCollectionPoint(device) diff --git a/Packages/MIES/MIES_Oscilloscope.ipf b/Packages/MIES/MIES_Oscilloscope.ipf index e8b2e02d22..60035e9508 100644 --- a/Packages/MIES/MIES_Oscilloscope.ipf +++ b/Packages/MIES/MIES_Oscilloscope.ipf @@ -466,7 +466,7 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari STRUCT TPAnalysisInput tpInput variable i, j variable tpChannels, numADCs, numDACs, tpLengthPointsADC, tpStart, tpEnd, tpStartPos - variable TPChanIndex, saveTP, clampAmp + variable TPChanIndex, saveTP, clampAmp, timeSinceAcqStart, timeOfAcqStartUTC, tpCounter variable headstage, fifoLatest, channelIndex string hsList @@ -478,6 +478,7 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari chunk = 0 endif ASSERT(ParamIsDefault(fifoPos), "optional parameter fifoPos is not possible with TEST_PULSE_MODE") + tpCounter = chunk elseif(dataAcqOrTP == DATA_ACQUISITION_MODE) ASSERT(!ParamIsDefault(fifoPos), "optional parameter fifoPos missing") ASSERT(ParamIsDefault(chunk), "optional parameter chunk is not possible with DATA_ACQUISITION_MODE") @@ -489,11 +490,15 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari case HARDWARE_NI_DAC: ASSERT(!ParamIsDefault(deviceID), "optional parameter deviceID missing (required for NI devices in TP mode)") SCOPE_NI_UpdateOscilloscope(device, dataAcqOrTP, deviceID, fifoPos) + if(dataAcqOrTP == TEST_PULSE_MODE) + tpCounter = ROVar(GetNITestPulseCounter(device)) + endif break case HARDWARE_SUTTER_DAC: if(dataAcqOrTP == TEST_PULSE_MODE) ASSERT(!ParamIsDefault(chunk), "optional parameter chunk is missing with TEST_PULSE_MODE") ASSERT(ParamIsDefault(fifoPos), "optional parameter fifoPos is not possible with TEST_PULSE_MODE") + tpCounter = chunk elseif(dataAcqOrTP == DATA_ACQUISITION_MODE) ASSERT(!ParamIsDefault(fifoPos), "optional parameter fifoPos missing") ASSERT(ParamIsDefault(chunk), "optional parameter chunk is not possible with DATA_ACQUISITION_MODE") @@ -529,6 +534,8 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari numDACs = DimSize(DACs, ROWS) numADCs = DimSize(ADCs, ROWS) + timeOfAcqStartUTC = ParseISO8601TimeStamp(ROStr(GetLastAcquisitionStartTime(device))) + // note: currently this works for multiplier = 1 only, see DC_PlaceDataInDAQDataWave Make/FREE/N=(tpLengthPointsADC) channelData WAVE tpInput.data = channelData @@ -543,7 +550,6 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari tpInput.pulseStartPointsDAC = (dataAcqOrTP == TEST_PULSE_MODE) ? TPSettingsCalc[%pulseStartPointsTP] : TPSettingsCalc[%pulseStartPointsDAQ] tpInput.samplingIntervalDAC = DimDelta(scaledDataWave[0], ROWS) tpInput.baselineFrac = TPSettingsCalc[%baselineFrac] - tpInput.readTimeStamp = ticks * TICKS_TO_SECONDS tpInput.activeADCs = tpChannels tpInput.cycleId = ROVAR(GetTestpulseCycleID(device)) @@ -557,6 +563,9 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari DEBUGPRINT("tpChannels: ", var = tpChannels) DEBUGPRINT("tpLength: ", var = tpLengthPointsADC) + // In TP mode the loop only runs once. Only the last TP is evaluated for ITC and SUTTER. + // For NI the caller loops over all pending TPs. + // In DAQ mode all TPs are evaluated in this loop for(i = tpStart; i < tpEnd; i += 1) tpInput.measurementMarker = tpMarker[i - tpStart] @@ -574,8 +583,9 @@ Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [vari endif // Use same time for all headstages - tpInput.timeStamp = DateTime - tpInput.timeStampUTC = DateTimeInUTC() + timeSinceAcqStart = (tpCounter + i) * tpInput.samplingIntervalDAC * tpInput.tpLengthPointsDAC * MILLI_TO_ONE + tpInput.timeStampUTC = timeOfAcqStartUTC + timeSinceAcqStart + tpInput.timeStamp = UTCTimeToLocal(tpInput.timeStampUTC) tpInput.sendTPMessage = 1 for(j = 0; j < numADCs; j += 1) diff --git a/Packages/MIES/MIES_Publish.ipf b/Packages/MIES/MIES_Publish.ipf index 47eac0516a..f8dac874aa 100644 --- a/Packages/MIES/MIES_Publish.ipf +++ b/Packages/MIES/MIES_Publish.ipf @@ -847,7 +847,6 @@ threadsafe Function PUB_TPResult(string device, WAVE tpData, WAVE ampParamStorag JSON_AddVariable(jsonID, path + "/headstage", tpData[%HEADSTAGE]) JSON_AddVariable(jsonID, path + "/clamp mode", tpData[%CLAMPMODE]) - PUB_AddTPResultEntry(jsonId, path + "/time of tp acquisition", tpData[%NOW], "s") PUB_AddTPResultEntry(jsonId, path + "/clamp amplitude", tpData[%CLAMPAMP], daUnit) PUB_AddTPResultEntry(jsonId, path + "/tp length ADC", tpData[%TPLENGTHPOINTSADC], "points") PUB_AddTPResultEntry(jsonId, path + "/pulse duration ADC", tpData[%PULSELENGTHPOINTSADC], "points") diff --git a/Packages/MIES/MIES_Structures.ipf b/Packages/MIES/MIES_Structures.ipf index 6ef19e175c..98ca4c66eb 100644 --- a/Packages/MIES/MIES_Structures.ipf +++ b/Packages/MIES/MIES_Structures.ipf @@ -308,7 +308,6 @@ Structure TPAnalysisInput variable pulseStartPointsDAC variable samplingIntervalDAC variable baselineFrac - variable readTimeStamp variable headstage string device variable measurementMarker diff --git a/Packages/MIES/MIES_TestPulse.ipf b/Packages/MIES/MIES_TestPulse.ipf index 1b365c0825..465b14b0c4 100644 --- a/Packages/MIES/MIES_TestPulse.ipf +++ b/Packages/MIES/MIES_TestPulse.ipf @@ -366,7 +366,6 @@ Function TP_ROAnalysis(STRUCT ASYNC_ReadOutStruct &ar) MultiThread TPResults[%ResistanceInst][] = asyncBuffer[i][%INSTANTRES][q] MultiThread TPResults[%ElevatedSteadyState][] = asyncBuffer[i][%ELEVATED_SS][q] MultiThread TPResults[%ElevatedInst][] = asyncBuffer[i][%ELEVATED_INST][q] - MultiThread TPResults[%NOW][] = asyncBuffer[i][%NOW][q] MultiThread TPResults[%HEADSTAGE][] = asyncBuffer[i][%HEADSTAGE][q] MultiThread TPResults[%MARKER][] = asyncBuffer[i][%MARKER][q] MultiThread TPResults[%NUMBER_OF_TP_CHANNELS][] = asyncBuffer[i][%NUMBER_OF_TP_CHANNELS][q] @@ -405,7 +404,7 @@ Function TP_ROAnalysis(STRUCT ASYNC_ReadOutStruct &ar) TP_AutoAmplitudeAndBaseline(device, TPResults, marker) DQ_ApplyAutoBias(device, TPResults) - TP_RecordTP(device, TPResults, inData[%NOW]) + TP_RecordTP(device, TPResults) endif End @@ -1040,7 +1039,6 @@ threadsafe Function/DF TP_TSAnalysis(DFREF dfrInp) variable pulseLengthPointsADC = ASYNC_FetchVariable(dfrInp, "pulseLengthPointsADC") variable baselineFrac = ASYNC_FetchVariable(dfrInp, "baselineFrac") variable tpLengthPointsADC = ASYNC_FetchVariable(dfrInp, "tpLengthPointsADC") - variable now = ASYNC_FetchVariable(dfrInp, "now") variable headstage = ASYNC_FetchVariable(dfrInp, "headstage") string device = ASYNC_FetchString(dfrInp, "device") variable marker = ASYNC_FetchVariable(dfrInp, "marker") @@ -1061,8 +1059,8 @@ threadsafe Function/DF TP_TSAnalysis(DFREF dfrInp) Duplicate data, dfrOut:colors Duplicate data, dfrOut:data WAVE colors = dfrOut:colors - colors = 0 - colors[0, lengthTPInPoints - 1] = 100 + colors = 0 + colors[0, tpLengthPointsADC - 1] = 100 #endif WAVE tpData = GetTPAnalysisDataWave() @@ -1098,7 +1096,7 @@ threadsafe Function/DF TP_TSAnalysis(DFREF dfrInp) DEBUGPRINT_TS("steady state range eng (ms): ", var = refTime) DEBUGPRINT_TS("steady state average: ", var = avgTPSS) // color steady state - refpt = lengthTPInPoints - tpStartPoint - evalOffsetPointsCorrected + refpt = tpLengthPointsADC - tpStartPoint - evalOffsetPointsCorrected colors[refpt - evalRange / samplingIntervalADC, refpt] = 50 // color instantaneous refpt = tpStartPoint + evalOffsetPointsCorrected @@ -1140,7 +1138,6 @@ threadsafe Function/DF TP_TSAnalysis(DFREF dfrInp) // additional data copy string/G dfrOut:device = device - tpData[%NOW] = now tpData[%HEADSTAGE] = headstage tpData[%MARKER] = marker tpData[%NUMBER_OF_TP_CHANNELS] = activeADCs @@ -1195,18 +1192,15 @@ End /// @brief Records values from TPResults into TPStorage at defined intervals. /// /// Used for analysis of TP over time. -static Function TP_RecordTP(string device, WAVE TPResults, variable now) +static Function TP_RecordTP(string device, WAVE TPResults) - variable delta, i, ret, lastPressureCtrl + variable delta, i, ret, lastPressureCtrl, now WAVE TPStorage = GetTPStorage(device) WAVE hsProp = GetHSProperties(device) variable count = GetNumberFromWaveNote(TPStorage, NOTE_INDEX) variable lastRescaling = GetNumberFromWaveNote(TPStorage, DIMENSION_SCALING_LAST_INVOC) if(!count) - // time of the first sweep - TPStorage[0][][%TimeInSeconds] = now - WAVE statusHS = DAG_GetChannelState(device, CHANNEL_TYPE_HEADSTAGE) for(i = 0; i < NUM_HEADSTAGES; i += 1) @@ -1237,7 +1231,6 @@ static Function TP_RecordTP(string device, WAVE TPResults, variable now) : TPStorage[count][q][%HoldingCmd_IC] endif - TPStorage[count][][%TimeInSeconds] = TPResults[%NOW][q] TPStorage[count][][%TimeStamp] = TPResults[%TIMESTAMP][q] TPStorage[count][][%TimeStampSinceIgorEpochUTC] = TPResults[%TIMESTAMPUTC][q] @@ -1255,7 +1248,7 @@ static Function TP_RecordTP(string device, WAVE TPResults, variable now) TPStorage[count][][%Baseline_VC] = (hsProp[q][%ClampMode] == V_CLAMP_MODE) ? TPResults[%BaselineSteadyState][q] : NaN TPStorage[count][][%Baseline_IC] = (hsProp[q][%ClampMode] == I_CLAMP_MODE) ? TPResults[%BaselineSteadyState][q] : NaN - TPStorage[count][][%DeltaTimeInSeconds] = (count > 0) ? (now - TPStorage[0][0][%TimeInSeconds]) : 0 + TPStorage[count][][%DeltaTimeInSeconds] = TPResults[%TIMESTAMP][q] - TPStorage[0][q][%TimeStamp] TPStorage[count][][%TPMarker] = TPResults[%MARKER][q] TPStorage[count][][%TPCycleID] = TPResults[%CYCLEID][q] @@ -1278,6 +1271,7 @@ static Function TP_RecordTP(string device, WAVE TPResults, variable now) TPStorage[count][][%AutoTPCycleID] = hsProp[q][%Enabled] ? TPSettings[%autoTPCycleID][q] : NaN lastPressureCtrl = GetNumberFromWaveNote(TPStorage, PRESSURE_CTRL_LAST_INVOC) + now = DateTime if((now - lastPressureCtrl) > TP_PRESSURE_INTERVAL) P_PressureControl(device) SetNumberInWaveNote(TPStorage, PRESSURE_CTRL_LAST_INVOC, now, format = "%.06f") @@ -1312,7 +1306,7 @@ threadsafe static Function TP_FitResistance(WAVE TPStorage, variable startRow, v try V_FitError = 0 V_AbortCode = 0 - CurveFit/Q/N=1/NTHR=1/M=0/W=2 line, kwCWave=coefWave, TPStorage[startRow, endRow][headstage][%SteadyStateResistance]/X=TPStorage[startRow, endRow][headstage][%TimeInSeconds]/AD=0/AR=0; AbortOnRTE + CurveFit/Q/N=1/NTHR=1/M=0/W=2 line, kwCWave=coefWave, TPStorage[startRow, endRow][headstage][%SteadyStateResistance]/X=TPStorage[startRow, endRow][headstage][%TimeStamp]/AD=0/AR=0; AbortOnRTE return coefWave[1] catch ClearRTError() @@ -1679,7 +1673,6 @@ Function/DF TP_PrepareAnalysisDF(string device, STRUCT TPAnalysisInput &tpInput) ASYNC_AddParam(threadDF, var = tpInput.pulseLengthPointsADC, name = "pulseLengthPointsADC") ASYNC_AddParam(threadDF, var = tpInput.baselineFrac, name = "baselineFrac") ASYNC_AddParam(threadDF, var = tpInput.tpLengthPointsADC, name = "tpLengthPointsADC") - ASYNC_AddParam(threadDF, var = tpInput.readTimeStamp, name = "now") ASYNC_AddParam(threadDF, var = tpInput.headstage, name = "headstage") ASYNC_AddParam(threadDF, str = tpInput.device, name = "device") ASYNC_AddParam(threadDF, var = tpInput.measurementMarker, name = "marker") diff --git a/Packages/MIES/MIES_TestPulse_Multi.ipf b/Packages/MIES/MIES_TestPulse_Multi.ipf index d398b4b218..a1f5b91c24 100644 --- a/Packages/MIES/MIES_TestPulse_Multi.ipf +++ b/Packages/MIES/MIES_TestPulse_Multi.ipf @@ -156,7 +156,7 @@ Function TPM_BkrdTPFuncMD(STRUCT BackgroundStruct &s) HW_SU_StopAcq(deviceId) ActiveDeviceList[i][%ActiveChunk] = NaN HW_SU_PrepareAcq(deviceId, TEST_PULSE_MODE) - HW_SU_StartAcq(deviceId) + HW_StartAcq(HARDWARE_SUTTER_DAC, deviceId) endif break @@ -207,7 +207,7 @@ Function TPM_BkrdTPFuncMD(STRUCT BackgroundStruct &s) if(V_FIFOChunks > TPM_NI_FIFO_THRESHOLD_SIZE) HW_NI_StopAcq(deviceID) HW_NI_PrepareAcq(deviceID, TEST_PULSE_MODE) - HW_NI_StartAcq(deviceID, HARDWARE_DAC_DEFAULT_TRIGGER) + HW_StartAcq(HARDWARE_NI_DAC, deviceID, triggerMode = HARDWARE_DAC_DEFAULT_TRIGGER) tpCounter = 0 endif while(checkAgain) @@ -215,8 +215,7 @@ Function TPM_BkrdTPFuncMD(STRUCT BackgroundStruct &s) case HARDWARE_ITC_DAC: WAVE ITCDataWave = GetDAQDataWave(device, TEST_PULSE_MODE) - NVAR tgID = $GetThreadGroupIDFIFO(device) - fifoPos = TS_GetNewestFromThreadQueue(tgID, "fifoPos", timeout_tries = THREAD_QUEUE_TRIES) + fifoPos = HW_ITC_ReadFifoPos(device, timeout_tries = THREAD_QUEUE_TRIES) // should never be hit if(!IsFinite(fifoPos)) diff --git a/Packages/MIES/MIES_ThreadedFIFOHandling.ipf b/Packages/MIES/MIES_ThreadedFIFOHandling.ipf index 81ba35b388..075dbf6989 100644 --- a/Packages/MIES/MIES_ThreadedFIFOHandling.ipf +++ b/Packages/MIES/MIES_ThreadedFIFOHandling.ipf @@ -81,12 +81,15 @@ End /// - An error during ITC operation calls /// - The input queue is not empty /// -/// Pushes the following entries into the thread queue: -/// - fifoPos: fifo position (relative to offset) +/// Pushes the following entries into the thread queue in a free DFR dfrOut if the entries have updated values +/// Otherwise an entry does not get pushed +/// - $ITC_THREAD_FIFOPOS: fifo position (relative to offset) +/// - $ITC_THREAD_TIMESTAMP: timestamp of acquisition start threadsafe static Function TFH_FifoLoop(WAVE config, variable deviceID, variable stopCollectionPoint, variable ADChannelToMonitor, variable mode) - variable flags, moreData, fifoPos + variable flags, moreData, fifoPos, timestamp + DFREF dfrOut = NewFreeDataFolder() flags = HARDWARE_ABORT_ON_ERROR do @@ -97,9 +100,9 @@ threadsafe static Function TFH_FifoLoop(WAVE config, variable deviceID, variable endif moreData = HW_ITC_MoreData_TS(deviceID, ADChannelToMonitor, stopCollectionPoint, config, fifoPos = fifoPos, flags = flags) - fifoPos = limit(fifoPos, 0, stopCollectionPoint) - TS_ThreadGroupPutVariable(MAIN_THREAD, "fifoPos", fifoPos) + timestamp = NaN + fifoPos = limit(fifoPos, 0, stopCollectionPoint) if(!moreData) switch(mode) @@ -107,6 +110,7 @@ threadsafe static Function TFH_FifoLoop(WAVE config, variable deviceID, variable HW_ITC_StopAcq_TS(deviceID, prepareForDAQ = 1, flags = flags) HW_ITC_ResetFifo_TS(deviceID, config, flags = flags) + timestamp = ParseISO8601TimeStamp(HW_GetAcquisitionStartTimestamp()) HW_ITC_StartAcq_TS(deviceID, HARDWARE_DAC_DEFAULT_TRIGGER, flags = flags) break case TFH_STOP_ACQ: @@ -120,6 +124,14 @@ threadsafe static Function TFH_FifoLoop(WAVE config, variable deviceID, variable break endswitch endif + + variable/G dfrOut:$ITC_THREAD_FIFOPOS = fifopos + if(IsNaN(timestamp)) + KillVariables/Z dfrOut:$ITC_THREAD_TIMESTAMP + else + variable/G dfrOut:$ITC_THREAD_TIMESTAMP = timestamp + endif + TS_ThreadGroupPutDFR(MAIN_THREAD, dfrOut) while(1) return 0 diff --git a/Packages/MIES/MIES_ThreadsafeUtilities.ipf b/Packages/MIES/MIES_ThreadsafeUtilities.ipf index 44ef20e024..a1cef3b8b9 100644 --- a/Packages/MIES/MIES_ThreadsafeUtilities.ipf +++ b/Packages/MIES/MIES_ThreadsafeUtilities.ipf @@ -19,7 +19,7 @@ static Constant TS_ERROR_INVALID_TGID = 980 // Invalid Thread Group ID or /// Throws away anything else in the datafolder from the thread queue. Function TS_GetNewestFromThreadQueue(variable tgID, string varName, [variable timeout_default, variable timeout_tries]) - variable var, err, i + variable var, err, i, timeout, readValidVar ASSERT_TS(!isEmpty(varName), "varName must not be empty") @@ -37,11 +37,9 @@ Function TS_GetNewestFromThreadQueue(variable tgID, string varName, [variable ti ASSERT(IsInteger(timeout_tries) && timeout_tries > 0, "Invalid timeout_tries") endif - var = NaN - for(i = 0; i < timeout_tries; i += 1) AssertOnAndClearRTError() - DFREF dfr = ThreadGroupGetDFR(tgID, TS_GET_REPEAT_TIMEOUT_IN_MS); err = GetRTError(1) + DFREF dfr = ThreadGroupGetDFR(tgID, timeout); err = GetRTError(1) if(err) ASSERT(err == TS_ERROR_INVALID_TGID, "Unexpected error value of " + num2str(err)) @@ -49,13 +47,16 @@ Function TS_GetNewestFromThreadQueue(variable tgID, string varName, [variable ti endif if(!DataFolderRefStatus(dfr)) - if(IsFinite(var)) + if(readValidVar) return var elseif(TS_ThreadGroupFinished(tgID)) return NaN else + timeout = TS_GET_REPEAT_TIMEOUT_IN_MS continue endif + else + timeout = 0 endif NVAR/Z/SDFR=dfr var_thread = $varName @@ -63,7 +64,8 @@ Function TS_GetNewestFromThreadQueue(variable tgID, string varName, [variable ti ASSERT_TS(NVAR_Exists(var_thread), "Expected variable from thread does not exist: " + varName) // overwrite old values - var = var_thread + var = var_thread + readValidVar = 1 endfor return timeout_default @@ -77,7 +79,7 @@ End /// Throws away anything else in the datafolder from the thread queue. Function/WAVE TS_GetNewestFromThreadQueueMult(variable tgID, WAVE/T varNames, [variable timeout_default, variable timeout_tries]) - variable numEntries, i, j, oneValidEntry, err + variable numEntries, i, j, oneValidEntry, err, timeout string varName ASSERT_TS(DimSize(varNames, COLS) == 0, "Expected a 1D wave") @@ -94,7 +96,7 @@ Function/WAVE TS_GetNewestFromThreadQueueMult(variable tgID, WAVE/T varNames, [v if(ParamIsDefault(timeout_tries)) timeout_tries = Inf else - ASSERT(IsInteger(timeout_tries) && timeout_tries > 0, "Invalid timeout_tries") + ASSERT(IsInf(timeout_tries) || (IsInteger(timeout_tries) && timeout_tries > 0), "Invalid timeout_tries") endif numEntries = DimSize(varNames, ROWS) @@ -108,7 +110,7 @@ Function/WAVE TS_GetNewestFromThreadQueueMult(variable tgID, WAVE/T varNames, [v for(i = 0; i < timeout_tries; i += 1) AssertOnAndClearRTError() - DFREF dfr = ThreadGroupGetDFR(tgID, TS_GET_REPEAT_TIMEOUT_IN_MS); err = GetRTError(1) + DFREF dfr = ThreadGroupGetDFR(tgID, timeout); err = GetRTError(1) if(err) ASSERT(err == TS_ERROR_INVALID_TGID, "Unexpected error value of " + num2str(err)) @@ -119,12 +121,15 @@ Function/WAVE TS_GetNewestFromThreadQueueMult(variable tgID, WAVE/T varNames, [v if(TS_ThreadGroupFinished(tgID)) return $"" elseif(!oneValidEntry) + timeout = TS_GET_REPEAT_TIMEOUT_IN_MS continue endif return result endif + timeout = 0 + for(j = 0; j < numEntries; j += 1) NVAR/Z/SDFR=dfr var = $GetDimLabel(result, ROWS, j) diff --git a/Packages/MIES/MIES_Utilities_Time.ipf b/Packages/MIES/MIES_Utilities_Time.ipf index 2c6f07c243..2eb5703565 100644 --- a/Packages/MIES/MIES_Utilities_Time.ipf +++ b/Packages/MIES/MIES_Utilities_Time.ipf @@ -34,10 +34,22 @@ Function/S GetTimeStamp([variable secondsSinceIgorEpoch, variable humanReadable] return Secs2Date(secondsSinceIgorEpoch, -2, "_") + "_" + ReplaceString(":", Secs2Time(secondsSinceIgorEpoch, 3), "") End +/// @brief Convert UTC time in Local time +threadsafe Function UTCTimeToLocal(variable utcTime) + + return utcTime + date2secs(-1, -1, -1) +End + +/// @brief Convert Local time in secs to UTC +threadsafe Function LocalTimeToUTC(variable localTime) + + return localTime - date2secs(-1, -1, -1) +End + /// @brief Return the seconds, including fractional part, since Igor Pro epoch (1/1/1904) in UTC time zone threadsafe Function DateTimeInUTC() - return DateTime - date2secs(-1, -1, -1) + return LocalTimeToUTC(DateTime) End /// @brief Return a string in ISO 8601 format with timezone UTC diff --git a/Packages/MIES/MIES_WaveDataFolderGetters.ipf b/Packages/MIES/MIES_WaveDataFolderGetters.ipf index 29699aa1c6..0bfb56cd99 100644 --- a/Packages/MIES/MIES_WaveDataFolderGetters.ipf +++ b/Packages/MIES/MIES_WaveDataFolderGetters.ipf @@ -3019,49 +3019,49 @@ End /// - 1: Amplifier bias current (Current Clamp) /// - 2: (Peak/Instantaneous) Resistance /// - 3: (Steady State) Resistance -/// - 4: Time in s (arbitrary zero) -/// - 5: Delta time in s relative to the entry in the first row of layer 3 -/// - 6: (Steady State) Resistance slope -/// - 7: Pressure in psi -/// - 8: Timestamp since igor epoch (*with* timezone offsets) -/// - 9: Timestamp in UTC since igor epoch -/// - 10: Pressure changed -/// - 11: Holding current (pA, Voltage Clamp) -/// - 12: Vrest (mV, Current Clamp) -/// - 13: AD channel -/// - 14: DA channel -/// - 15: Headstage -/// - 16: ClampMode -/// - 17: UserPressure -/// - 18: PressureMethod (see @ref PressureModeConstants) -/// - 19: ValidState (true if the entry is considered valid, false otherwise) -/// - 20: UserPressureType (see @ref PressureTypeConstants) -/// - 21: UserPressureTimeStampUTC timestamp since Igor Pro epoch in UTC where +/// - 4: Delta time in s relative to the entry in the first row of layer 3 +/// - 5: (Steady State) Resistance slope +/// - 6: Pressure in psi +/// - 7: Timestamp since igor epoch (*with* timezone offsets) +/// - 8: Timestamp in UTC since igor epoch +/// - 9: Pressure changed +/// - 10: Holding current (pA, Voltage Clamp) +/// - 11: Vrest (mV, Current Clamp) +/// - 12: AD channel +/// - 13: DA channel +/// - 14: Headstage +/// - 15: ClampMode +/// - 16: UserPressure +/// - 17: PressureMethod (see @ref PressureModeConstants) +/// - 18: ValidState (true if the entry is considered valid, false otherwise) +/// - 19: UserPressureType (see @ref PressureTypeConstants) +/// - 20: UserPressureTimeStampUTC timestamp since Igor Pro epoch in UTC where /// the user pressure was acquired -/// - 22: TPMarker unique number identifying this set of TPs -/// - 23: Cell state: Pressure control values defining the cell state, one of @ref CellStateValues -/// - 24: Testpulse Cycle Id (changes whenever TP is started, allows to group TPs together) -/// - 25: Auto TP Amplitude: success/fail state -/// - 26: Auto TP Baseline: success/fail state -/// - 27: Auto TP Baseline Range Exceeded: True/False -/// - 28: Auto TP Cycle ID: Unique number which is constant until the "Auto TP" +/// - 21: TPMarker unique number identifying this set of TPs +/// - 22: Cell state: Pressure control values defining the cell state, one of @ref CellStateValues +/// - 23: Testpulse Cycle Id (changes whenever TP is started, allows to group TPs together) +/// - 24: Auto TP Amplitude: success/fail state +/// - 25: Auto TP Baseline: success/fail state +/// - 26: Auto TP Baseline Range Exceeded: True/False +/// - 27: Auto TP Cycle ID: Unique number which is constant until the "Auto TP" /// state is switched (aka on->off or off->on) -/// - 29: Auto TP Baseline Fit result: One of @ref TPBaselineFitResults -/// - 30: Auto TP Delta V [mV] -/// - 31: Clamp Amplitude [mV] or [pA] depending on Clamp Mode -/// - 32: Testpulse full length in points for AD channel [points] -/// - 33: Testpulse pulse length in points for AD channel [points] -/// - 34: Point index of pulse start for AD channel [point] -/// - 35: Sampling interval for AD channel [ms] -/// - 36: Testpulse full length in points for DA channel [points] -/// - 37: Testpulse pulse length in points for DA channel [points] -/// - 38: Point index of pulse start for DA channel [point] -/// - 39: Sampling interval for DA channel [ms] +/// - 28: Auto TP Baseline Fit result: One of @ref TPBaselineFitResults +/// - 29: Auto TP Delta V [mV] +/// - 30: Clamp Amplitude [mV] or [pA] depending on Clamp Mode +/// - 31: Testpulse full length in points for AD channel [points] +/// - 32: Testpulse pulse length in points for AD channel [points] +/// - 33: Point index of pulse start for AD channel [point] +/// - 34: Sampling interval for AD channel [ms] +/// - 35: Testpulse full length in points for DA channel [points] +/// - 36: Testpulse pulse length in points for DA channel [points] +/// - 37: Point index of pulse start for DA channel [point] +/// - 38: Sampling interval for DA channel [ms] Function/WAVE GetTPStorage(string device) DFREF dfr = GetDeviceTestPulse(device) - variable versionOfNewWave = 16 - variable numLayers = 40 + variable versionOfNewWave = 17 + variable numLayersV16 = 40 + variable numLayers = 39 WAVE/Z/D/SDFR=dfr wv = TPStorage @@ -3070,7 +3070,7 @@ Function/WAVE GetTPStorage(string device) endif if(WaveExists(wv)) - Redimension/N=(-1, NUM_HEADSTAGES, numLayers)/D wv + Redimension/N=(-1, NUM_HEADSTAGES, numLayersV16)/D wv if(WaveVersionIsSmaller(wv, 10)) wv[][][17] = NaN @@ -3092,6 +3092,11 @@ Function/WAVE GetTPStorage(string device) if(WaveVersionIsSmaller(wv, 16)) wv[][][31, numLayers - 1] = NaN endif + if(WaveVersionIsSmaller(wv, 17)) + // Delete the former layer for %TimeInSeconds that was layer 4 + // The functionality is replaced by a precise %TimeStamp + DeletePoints/M=(LAYERS) 4, 1, wv + endif else Make/N=(MINIMUM_WAVE_SIZE_LARGE, NUM_HEADSTAGES, numLayers)/D dfr:TPStorage/WAVE=wv @@ -3106,45 +3111,44 @@ Function/WAVE GetTPStorage(string device) SetDimLabel LAYERS, 1, HoldingCmd_IC, wv SetDimLabel LAYERS, 2, PeakResistance, wv SetDimLabel LAYERS, 3, SteadyStateResistance, wv - SetDimLabel LAYERS, 4, TimeInSeconds, wv - SetDimLabel LAYERS, 5, DeltaTimeInSeconds, wv - SetDimLabel LAYERS, 6, Rss_Slope, wv - SetDimLabel LAYERS, 7, Pressure, wv - SetDimLabel LAYERS, 8, TimeStamp, wv - SetDimLabel LAYERS, 9, TimeStampSinceIgorEpochUTC, wv - SetDimLabel LAYERS, 10, PressureChange, wv - SetDimLabel LAYERS, 11, Baseline_VC, wv - SetDimLabel LAYERS, 12, Baseline_IC, wv - SetDimLabel LAYERS, 13, ADC, wv - SetDimLabel LAYERS, 14, DAC, wv - SetDimLabel LAYERS, 15, Headstage, wv - SetDimLabel LAYERS, 16, ClampMode, wv - SetDimLabel LAYERS, 17, UserPressure, wv - SetDimLabel LAYERS, 18, PressureMethod, wv - SetDimLabel LAYERS, 19, ValidState, wv - SetDimLabel LAYERS, 20, UserPressureType, wv - SetDimLabel LAYERS, 21, UserPressureTimeStampUTC, wv - SetDimLabel LAYERS, 22, TPMarker, wv - SetDimLabel LAYERS, 23, CellState, wv - SetDimLabel LAYERS, 24, TPCycleID, wv - SetDimLabel LAYERS, 25, AutoTPAmplitude, wv - SetDimLabel LAYERS, 26, AutoTPBaseline, wv - SetDimLabel LAYERS, 27, AutoTPBaselineRangeExceeded, wv - SetDimLabel LAYERS, 28, AutoTPCycleID, wv - SetDimLabel LAYERS, 29, AutoTPBaselineFitResult, wv - SetDimLabel LAYERS, 30, AutoTPDeltaV, wv + SetDimLabel LAYERS, 4, DeltaTimeInSeconds, wv + SetDimLabel LAYERS, 5, Rss_Slope, wv + SetDimLabel LAYERS, 6, Pressure, wv + SetDimLabel LAYERS, 7, TimeStamp, wv + SetDimLabel LAYERS, 8, TimeStampSinceIgorEpochUTC, wv + SetDimLabel LAYERS, 9, PressureChange, wv + SetDimLabel LAYERS, 10, Baseline_VC, wv + SetDimLabel LAYERS, 11, Baseline_IC, wv + SetDimLabel LAYERS, 12, ADC, wv + SetDimLabel LAYERS, 13, DAC, wv + SetDimLabel LAYERS, 14, Headstage, wv + SetDimLabel LAYERS, 15, ClampMode, wv + SetDimLabel LAYERS, 16, UserPressure, wv + SetDimLabel LAYERS, 17, PressureMethod, wv + SetDimLabel LAYERS, 18, ValidState, wv + SetDimLabel LAYERS, 19, UserPressureType, wv + SetDimLabel LAYERS, 20, UserPressureTimeStampUTC, wv + SetDimLabel LAYERS, 21, TPMarker, wv + SetDimLabel LAYERS, 22, CellState, wv + SetDimLabel LAYERS, 23, TPCycleID, wv + SetDimLabel LAYERS, 24, AutoTPAmplitude, wv + SetDimLabel LAYERS, 25, AutoTPBaseline, wv + SetDimLabel LAYERS, 26, AutoTPBaselineRangeExceeded, wv + SetDimLabel LAYERS, 27, AutoTPCycleID, wv + SetDimLabel LAYERS, 28, AutoTPBaselineFitResult, wv + SetDimLabel LAYERS, 29, AutoTPDeltaV, wv // Dimlabels starting from here are taken from TP_ANALYSIS_DATA_LABELS // This is not required but convenient because in @ref TP_RecordTP data from TPResults (@ref GetTPResults) // is transferred to tpStorage and TPResults also uses dimlabels from TP_ANALYSIS_DATA_LABELS partially. - SetDimLabel LAYERS, 31, CLAMPAMP, wv - SetDimLabel LAYERS, 32, TPLENGTHPOINTSADC, wv - SetDimLabel LAYERS, 33, PULSELENGTHPOINTSADC, wv - SetDimLabel LAYERS, 34, PULSESTARTPOINTSADC, wv - SetDimLabel LAYERS, 35, SAMPLINGINTERVALADC, wv - SetDimLabel LAYERS, 36, TPLENGTHPOINTSDAC, wv - SetDimLabel LAYERS, 37, PULSELENGTHPOINTSDAC, wv - SetDimLabel LAYERS, 38, PULSESTARTPOINTSDAC, wv - SetDimLabel LAYERS, 39, SAMPLINGINTERVALDAC, wv + SetDimLabel LAYERS, 30, CLAMPAMP, wv + SetDimLabel LAYERS, 31, TPLENGTHPOINTSADC, wv + SetDimLabel LAYERS, 32, PULSELENGTHPOINTSADC, wv + SetDimLabel LAYERS, 33, PULSESTARTPOINTSADC, wv + SetDimLabel LAYERS, 34, SAMPLINGINTERVALADC, wv + SetDimLabel LAYERS, 35, TPLENGTHPOINTSDAC, wv + SetDimLabel LAYERS, 36, PULSELENGTHPOINTSDAC, wv + SetDimLabel LAYERS, 37, PULSESTARTPOINTSDAC, wv + SetDimLabel LAYERS, 38, SAMPLINGINTERVALDAC, wv SetNumberInWaveNote(wv, AUTOBIAS_LAST_INVOCATION_KEY, 0) SetNumberInWaveNote(wv, DIMENSION_SCALING_LAST_INVOC, 0) diff --git a/Packages/tests/Basic/UTF_ZeroMQPublishing.ipf b/Packages/tests/Basic/UTF_ZeroMQPublishing.ipf index 873672db25..84bb39b080 100644 --- a/Packages/tests/Basic/UTF_ZeroMQPublishing.ipf +++ b/Packages/tests/Basic/UTF_ZeroMQPublishing.ipf @@ -450,7 +450,6 @@ End static Function/WAVE PrepareTPData() WAVE tpData = GetTPAnalysisDataWave() - tpData[%NOW] = 1E6 tpData[%HEADSTAGE] = 1 tpData[%MARKER] = 1234 tpData[%NUMBER_OF_TP_CHANNELS] = 2 @@ -495,10 +494,6 @@ static Function CheckTPData(variable jsonId) CHECK_EQUAL_STR(stv, "TestDevice") var = JSON_GetVariable(jsonID, "/properties/clamp mode") CHECK_EQUAL_VAR(var, clampMode) - var = JSON_GetVariable(jsonID, "/properties/time of tp acquisition/value") - CHECK_EQUAL_VAR(var, 1E6) - stv = JSON_GetString(jsonID, "/properties/time of tp acquisition/unit") - CHECK_EQUAL_STR(stv, "s") var = JSON_GetVariable(jsonID, "/properties/clamp amplitude/value") CHECK_EQUAL_VAR(var, 10) stv = JSON_GetString(jsonID, "/properties/clamp amplitude/unit") diff --git a/Packages/tests/Compilation/CompilationTester.ipf b/Packages/tests/Compilation/CompilationTester.ipf index fbf8e8b268..34c3e3c5e3 100644 --- a/Packages/tests/Compilation/CompilationTester.ipf +++ b/Packages/tests/Compilation/CompilationTester.ipf @@ -71,6 +71,7 @@ Function/WAVE GetDefines() "TESTS_WITH_NI_HARDWARE", \ "TESTS_WITH_SUTTER_HARDWARE", \ "WAVECACHE_DISABLED", \ + "TP_ANALYSIS_DEBUGGING", \ "THREADING_DISABLED"} SetDimensionLabelsFromWaveContents(defines) diff --git a/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf b/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf index f2c131e02b..6cbbad9ab4 100644 --- a/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf +++ b/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf @@ -1493,10 +1493,6 @@ static Function TestTPPublishing_REENTRY([string str]) daUnit = GetDAChannelUnit(var) adUnit = GetADChannelUnit(var) - var = JSON_GetVariable(jsonID, "/properties/time of tp acquisition/value") - CHECK_EQUAL_VAR(var, tpStorage[index][headstage][%TimeInSeconds]) - stv = JSON_GetString(jsonID, "/properties/time of tp acquisition/unit") - CHECK_EQUAL_STR(stv, "s") var = JSON_GetVariable(jsonID, "/properties/clamp amplitude/value") CHECK_EQUAL_VAR(var, tpStorage[index][headstage][%CLAMPAMP]) stv = JSON_GetString(jsonID, "/properties/clamp amplitude/unit")