06-16-2011 06:48 PM
I'm using a shunt resistor to measure current. I've tried both methods: reading voltage and dividing by resistor value, and reading current (resistor value passed into function). They yield slightly different results. Please see attached png, first column is voltage measurement, second column is current measurement. Actual current value is approx 100uA, and the displayed values have been scaled up accordingly.
Please advise which method is more accurate/precise?
// Measure voltage using precision resistor
Task analogReadVoltageTask = new Task();
analogReadVoltageTask.AIChannels.CreateVoltageChannel("DAQ0/ai24", "", AITerminalConfiguration.Rse, 0, 4, AIVoltageUnits.Volts);
AnalogSingleChannelReader readerVoltage = new AnalogSingleChannelReader(analogReadVoltageTask.Stream);
double vData = readerVoltage.ReadSingleSample();
//Measure current directly (still needs external shunt resistor)
Task analogReadCurrentTask = new Task();
analogReadCurrentTask.AIChannels.CreateCurrentChannel("DAQ0/ai24", "", AITerminalConfiguration.Rse, 0, .000255, 15000, AICurrentUnits.Amps);// Note: PXIE-6363 does not support internal shunt...
AnalogSingleChannelReader readerCurrent = new AnalogSingleChannelReader(analogReadCurrentTask.Stream);
double iData = readerCurrent.ReadSingleSample();
I'm using the C# interface of DAQmx, but this question is equally applicable to LabVIEW since there are two ways to do the same thing (and they yield slightly different results...
Thanks!
06-17-2011 04:03 PM
Hi ster,
Have you tried using a Test Panel in Measurement and Automation Explorer to see if you can get the correct reading from there? This can be done by right clicking the 6363 and selecting Test Panels. This will reference directly thorugh the hardware and should give you an accurate reading. Give this a try and let me know what you see.
Regards,
Kyle S
06-18-2011 12:14 AM
Hi Kyle,
Sorry if I was not clear. There are 2 ways to measure current using a shunt resistor and DAQmx. One is to measure voltage, then take the resultant measurement and divide by the shunt resistor. The other is to measure the current (which takes in the shunt resistor value as an argument). These yield very close, but slightly different results. Which method is more accurate/precise? Again, 2 ways to do the same thing. What is best practice?
06-20-2011 03:36 PM
Hi ster,
I see what you're saying. Either way is basically doing the same thing, you can never really measure current and must always read voltage. What happens internally on the 6363 is the current is run accross an internal known resistance and the voltage is read. This is then dividing out the resistance and returning a current.
I suggested using Test Panels in MAX because you can see what your card is reading before even introducing it into your code.
Regards,
Kyle S
06-20-2011 03:40 PM
Kyle S -
Please clarify your statement about the internal known resistance of the 6363. It's my understanding you still need an external shunt resistor when using the PXIe-6363, even when measuring current (really voltage and doing the math in the 6363).
06-20-2011 03:51 PM
Hi ster,
I apologize I believe I misspoke. You are correct, the 6363 can not read current directly. Some of our DAQ cards can and I assumed since you were able to use the read current function, the 6363 was one of them. Since you are always going to be reading voltage over a known shunt resistor value I would setup th current task and specify the resistor value. This will allow you to commit the task to hardware and do most of the calculations from there.
Regards,
Kyle S