I am setting up a system using the Keithley 7065 Hall Effect card and am using the Keithley 2400 Sourcemeter, 2000 Multimeter, 6514 Electrometer, and 7001 Switch System. I have a program in VB6 that is attempting to measure the resistivity of a sample by measuring voltages and currents. There are 8 different combinations of currents and voltages being measured. For each combination, 30 V and I measurements are taken (and averaged) to determine the R. When I use the electrometer to measure the current, the program goes through 4 different VI combinations (at 30 measurements each) successfully before crashing (crashes when j = 5 and i = 4), giving EDVR(0) and EHDL(23) errors (see attached NI Spy screen capture). When I trace the program, the measured voltage is coming back as an empty string (and so is the measured current). Is it because I am filling up some buffer and so I can't take any more measurements? That could explain why it works fine at first and then crashes.
Here is a part of my code:
NOTE: for some reason, I can't get SEND() to work, so I altered it to just use the device-level commands (e.g, ibrd)
For i = 0 To 7 'go through each different voltage combination
sumVavg = 0
sumIavg = 0
DoEvents
Call send(ss, ":CLOS (@" + getCrossPointsRes(i) + ")", status)
Call send(sm, ":OUTP:STAT ON", status)
DoEvents
Sleep PauseTime
numit = 30 'number of measurements to take for each combo
For j = 1 To numit
srcbeep (j)
Call send(mm, ":MEAS:VOLT?", status)
Call GetReply(meas_volt, CInt(255), CInt(1), mm, status)
Call send(em, ":MEAS:CURR?", status)
Call GetReply(meas_curr, CInt(255), CInt(1), em, status)
sumVavg = sumVavg + val(meas_volt)
sumIavg = sumIavg + val(meas_curr)
DoEvents
Next j
Call send(sm, ":OUTP:STAT OFF", status)
Call send(ss, ":OPEN ALL", status)
data(0, i) = sumVavg / numit
data(1, i) = sumIavg / numit
data(2, i) = data(0, i) / data(1, i)
txtCurrent(i).Caption = data(1, i)
txtVoltage(i).Caption = data(0, i)
txtRes(i).Caption = data(2, i)
Next i
Public Sub GetReply(r As String, Maxlen As Integer, l As Integer, addr As Integer, status As Integer)
Dim stl As Long
Dim ll As Long
Dim myStr As String * 1024
stl = ibdev32(0, addr, 0, 13, 1, 0)
blah = ConvertLongToInt(stl)
r = ilrd(blah, myStr$, Len(myStr$))
l = ll
r = myStr
status = stl
End Sub
Sub send(addr As Integer, myCom As String, mtStat As Integer)
blah = ConvertLongToInt(ibdev32(0, addr, 0, 13, 1, 0))
Call ilwrt(blah, myCom, Len(myCom))
End Sub