Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

measurement of resistance by USB 6008

Hi all,


I am trying to measure resistance by USB 6008. I use DAQ assistant and have to input data for Iex value. How can I determined the Iex value ? 



Thank you for your reply

0 Kudos
Message 1 of 22

The USB-6008 does not have an output for excitation current. The best you can do with that device is to use an analog output voltage as excitation (maximum current 5 mA).


Put a known resistor in series with the unknown resistance. Connect the excitation voltage across the series combination. Use two analog input channels to measure the voltages across both resistors. Then you can calculate the value of the unknown resistance. The accuracy will be limited by the uncertainty of the known resistance value as well as teh accuracy of the AI measurements.  This method works best if the value of the known resistor is close to the expected value of the unknown resistance.



0 Kudos
Message 2 of 22



I was able to use a PCI 6024e DAQ along with  a BNC 2090 interface to measure resistance a few years ago.

Check my post and you should be able to configure the 6008 to get resistance measuremnts.


Hope this helps.



0 Kudos
Message 3 of 22

Thank you for your reply. Can you explain how can I do  by using only USB 6008? How can be the constant current generated?


Thank you.

0 Kudos
Message 4 of 22



I can't say if this is going to work, but give it a try.




VB Code


Hope it works




'Set Refereances to NI Libraries
Imports NationalInstruments.Analysis.Math
Imports NationalInstruments.DAQmx

'Acq Code

    Sub getResistance()

        Dim myTask As Task
        Dim reader As AnalogMultiChannelReader
        Dim AverageVal(2) As Double
        Dim j As Integer = 0


            myTask = New Task()

            ' Initialize local variables
            Dim sampleRate As Double = 1000
            Dim rangeMin As Double = 0
            Dim rangeMax As Double = 10
            Dim samplesPerChan As Int32 = 100

            sampleRate = 100000
            samplesPerChan = 1000
            ' Create a channel
            myTask.AIChannels.CreateVoltageChannel("Dev1/ai0,Dev1/ai4", "", AITerminalConfiguration.Rse, rangeMin, rangeMax, AIVoltageUnits.Volts)

            ' Configure timing specs 
            myTask.Timing.ConfigureSampleClock("", sampleRate, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, samplesPerChan)

            ' Verify the task
            reader = New AnalogMultiChannelReader(myTask.Stream)

            ' Read the data
            Dim data As Double(,) = reader.ReadMultiSample(samplesPerChan)

            Dim data0(samplesPerChan) As Double
            Dim data1(samplesPerChan) As Double

            data0 = ArrayOperation.CopyRow(data, 0)
            data1 = ArrayOperation.CopyRow(data, 1)

            AverageVal(0) = Statistics.Mean(data0)
            AverageVal(1) = Statistics.Mean(data1)

            Dim resistance As Double


            resistance = (AverageVal(0) - AverageVal(1)) / (AverageVal(1) / 10000)

            txtData.AppendText(resistance.ToString("0.0000") + vbCrLf)

        Catch ex As Exception

        End Try
    End Sub
0 Kudos
Message 5 of 22

Depending of the range of the resistor to measure , you just need to connect it to GND 🙂

See page 12 of the user manual. The voltage divider is already build in 😄

Only some math involved 😉   

A more 'precise' measurement is possible if you apply some known resistors to determine more presice values of the build in resistors.


And with  the quite low input impedance of this input circuit (144k), you will need a closer look anyway if you use an external reference resistor.



Greetings from Germany

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Message 6 of 22



Good points.  I have done that in the past but forgot when I posted earlier in this thread.


to 1085,


Using the USB-6008 input circuit as Henrik suggested is not only a simple way to measure resistance (over a limited range) but also good exercise in reading manuals and understanding basic circuit theory. It would be useful to calculate the ranges of resistances which can be measured and what the resolution and accuracy is in each range.



Message 7 of 22



I have the same issue. I am trying to measure impedance but my device does not create internal current excitation so I am gonna try with excitation by voltage.  Actually I am using a DAQ device USB-6218. At first I thought at using a shunt resistor in serie with my load, but then I show your solution. the thing is that  I could not found in the user manual the specification of a voltage divider and its resistance values, like the one for USB 6008 you mentioned. Do you know where I can find it? Also I don´t understand well when you say you can directly connect the resistance to GND and get its value. could you help me? thank you 

0 Kudos
Message 8 of 22

Well for the 6008 I suggested a 'bug' as a feature ....  you have a 6218... different (and much better) thing.

You have an anaolg output and two channels input , all it needs is another known impedance (a resistor?) , one of the FRF (frequency response function) example vis provided (Help/ Find examples) and some math to calulate your unknown impedance with the measured FRF and the known impedance.

Depending on the range of the (unknown) impedance and the test current you want to apply, you maybe need an amplifier for the AO... could be an old stereo for AC 😉

If you know what an (complex) impedance is, you should be able to do the (complex) math to match your setup.

Greetings from Germany

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

0 Kudos
Message 9 of 22

Thank you for your replay, You mentioned test current, but USB 6218 does no supply internal excitation current for resistance measurement, you need external current source or excitation by voltage. 

I have another issue now concerning the circuit design and calculating maximum driving voltage. I will use it for 2 applications: bioimpedance and textile impedance and the values for impedances depending on which we use vary a lot.

Bioimpedance: 1 KOhm and electrode impedance around 100 Kohm 

Impedance in textiles: 200 or 300 Kohm and contact impedance in textiles 1 Mohm


I think that to get more accurate results the shunt resistor should be similar to our load value right? Which option will work the best? As you can see form those values, I will have to use 3 or 4 wire connection in measuring impedance due to the high values of electrode resistance and contact impedance in textiles.

0 Kudos
Message 10 of 22