I have same problem on my 4060 DMM board. Sometime, I get reading way out of range. I set the range to be 10, sometimes, I get -12.xxx. No error reported.
Please post solution on the forum to share. Thanks
********************************
My source code in Visaul Basic
r64Range = 10#
r64Resolution = 0.01
Status = -1
Emit ("Open a session....")
'mstrResource = "DAQ::" & Format$(miNIDeviceNumber, "0") & "::INSTR"
'Open a session to the instrument
iStatus = niDMM_init(mstrResource, VI_TRUE, VI_TRUE, miDeviceHandler)
If iStatus >= VI_SUCCESS Then
Call Writeln("OK.")
Emit ("Configure Resistance Measurement ....")
iStatus = niDMM_ConfigureMeasurement(miDeviceHandler, NIDMM_VAL_2_WIRE_RES, r64Range, r64Resolution)
If CheckError(iStatus) = VI_FALSE Then
Call Writeln("OK.")
Call Emit("Configure Multi Point....")
iStatus = niDMM_ConfigureMultiPoint(miDeviceHandler, TRIGGER_COUNT, SAMPLE_COUNT, NIDMM_VAL_IMMEDIATE, SAMPLE_INTERVAL_SECOND)
If CheckError(iStatus) = VI_FALSE Then
Call Writeln("OK.")
Call Writeln("Measure Resistance....")
'Read the measurements
iStatus = niDMM_ReadMultiPoint(miDeviceHandler, TIMEOUT_LIMINT_MILLI_SECOND, SAMPLE_COUNT, r64MeasArray(1), i32NumPointsRead)
If CheckError(iStatus) = VI_FALSE And i32NumPointsRead > 0 Then
'Status = 0
'Format and display measurements
iGoodSampleCount = 0
For i = 1 To i32NumPointsRead
If IsNumeric(Str$(r64MeasArray(i))) Then
If 0 < r64MeasArray(i) And r64MeasArray(i) < r64Range Then
'only sum up the goog data
dReading = dReading + r64MeasArray(i)
iGoodSampleCount = iGoodSampleCount + 1
End If
Writeln ("Readout " & Format$(r64MeasArray(i), "##0.000000 ") & vbCrLf)
Else
Status = -2
dReading = OVER_RANGE
Writeln ("Over Range" & vbCrLf)
Exit For
End If
Next i
If Status < 2 And (i32NumPointsRead - iGoodSampleCount) < BAD_SAMPLE_COUNT_MAX Then
Status = 0
dReading = dReading / iGoodSampleCount
Writeln ("Ave Read out " & Format$(dReading, "##0.000000") & " Ohms")
Else
Status = -1
Writeln ("Too many bad samples. No valid reading")
End If
Else
Writeln ("Failed")
RaiseEvent ErrorOccurred(PalletID, iStatus, "Failed to read the device", "ResistanceReadout", mstrParameterList)
End If
Else
Writeln ("Failed")
RaiseEvent ErrorOccurred(PalletID, iStatus, "Failed to configure the device", "ResistanceReadout", mstrParameterList)
End If
Else
Writeln ("Failed")
RaiseEvent ErrorOccurred(PalletID, iStatus, "Failed to configure the device", "ResistanceReadout", mstrParameterList)
End If
Else
Call Writeln("Failed.")
RaiseEvent ErrorOccurred(PalletID, iStatus, "Failed to initialize the device", "ResistanceReadout", mstrParameterList)
End If