Help!!!
Below is my VB 6 code. Just AIs: one strain gage, 3 thermo, the rest just regular AIs.
Error occurs on this
DAQmxErrChk DAQmxReadAnalogF64(taskHandle, numSampsPerChannel, dblDuration + 1 / Val(Me.txtFreq), _
DAQmx_Val_GroupByChannel, data(0), arraySizeInSamps, sampsPerChanRead, z)
Said z needs to be NULL, I used NULL then z = NULL, v,v,v couldn't solve the problem.
Any help is very very appreciated.
Thank you all
***********************************
DAQmxErrChk DAQmxCreateTask("", taskHandle)
DAQmxErrChk DAQmxCreateAIStrainGageChan(taskHandle, "cDAQ1Mod1/ai0", "P5", _
-0.0125, 0.0125, DAQmx_Val_StrainUnits1_FromCustomScale, DAQmx_Val_StrainGageBridgeType1_FullBridgeI, _
DAQmx_Val_ExcitationSource_External, 10, 1, 0, 350, 1, 1, "P5S")
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod2/ai0", "P1", _
DAQmx_Val_InputTermCfg_Diff, MinValue, MaxValue, _
DAQmx_Val_VoltageUnits2_FromCustomScale, "P1S")
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod2/ai2", "P3", _
DAQmx_Val_InputTermCfg_Diff, -5, 5, _
DAQmx_Val_VoltageUnits2_FromCustomScale, "P3S")
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod3/ai0", "F1", _
DAQmx_Val_InputTermCfg_Diff, 0, 1000, _
DAQmx_Val_VoltageUnits2_FromCustomScale, "F1S")
DAQmxErrChk DAQmxCreateAIThrmcplChan(taskHandle, "cDAQ1Mod4/ai0", "T1", _
0, 100, DAQmx_Val_DegC, DAQmx_Val_ThermocoupleType1_T_Type_TC, _
DAQmx_Val_CJCSource1_BuiltIn, 0#, "")
DAQmxErrChk DAQmxSetAITermCfg(taskHandle, "T1", DAQmx_Val_InputTermCfg_Diff)
DAQmxErrChk DAQmxCreateAIThrmcplChan(taskHandle, "cDAQ1Mod4/ai1", "T2", _
0, 100, DAQmx_Val_DegC, DAQmx_Val_ThermocoupleType1_T_Type_TC, _
DAQmx_Val_CJCSource1_BuiltIn, 0#, "")
DAQmxErrChk DAQmxSetAITermCfg(taskHandle, "T2", DAQmx_Val_InputTermCfg_Diff)
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod2/ai1", "P2", _
DAQmx_Val_InputTermCfg_Diff, MinValue, MaxValue, _
DAQmx_Val_VoltageUnits2_FromCustomScale, "P2S")
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod2/ai3", "P4", _
DAQmx_Val_InputTermCfg_Diff, -5, 5, _
DAQmx_Val_VoltageUnits2_FromCustomScale, "P4S")
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod3/ai1", "T3", _
DAQmx_Val_InputTermCfg_Diff, -5, 5, _
DAQmx_Val_VoltageUnits2_FromCustomScale, "T3S")
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod3/ai2", "LP", _
DAQmx_Val_InputTermCfg_Diff, MinValue, MaxValue, _
DAQmx_Val_VoltageUnits2_Volts, "")
DAQmxErrChk DAQmxGetTaskNumChans(taskHandle, numChannels)
numSampsPerChannel = CLng(dblRate * dblDuration)
arraySizeInSamps = numSampsPerChannel * numChannels
ReDim data(arraySizeInSamps)
'Finite samples
DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "OnboardClock", dblRate, DAQmx_Val_Rising, _
DAQmx_Val_AcquisitionType_FiniteSamps, numSampsPerChannel)
'Finite data acquisition
z = Null
DAQmxErrChk DAQmxReadAnalogF64(taskHandle, numSampsPerChannel, dblDuration + 1 / Val(Me.txtFreq), _
DAQmx_Val_GroupByChannel, data(0), arraySizeInSamps, sampsPerChanRead, z)
DAQmxStopTask taskHandle
DAQmxClearTask taskHandle