Getting Started with LabJack U6 C#
Posted 30 July 2012 - 03:16 PM
Posted 06 August 2012 - 03:15 PM
I just installed all the drivers for my labjack u6 pro, I am starting to play with the C# dll, but I got to a roadblock, I can't read the voltage at AIN1. here is my sample code.
public double AnalogIn(int pin)
double voltage = 0;
//Get ADC reading
LJUD.eAIN(m_U6.ljhandle, pin, 0, ref voltage, (int)LJUD.RANGES.UNI10V, DaqSettings.AnalogInResolution, 0, 0);
now according to the UserGuide the way eAIN work is by differential voltage, but I don't know exactly what that means. I am connecting the DAC1 which I set to 4.0V(already tested with Multimeter) I put accross a 1K resistor, but the reading I am getting is like 0.1 V . I would like to know if there is something wrong with my code, or maybe is the wiring.
Thanks in advance.
The code looks correct. You should be able to read the correct voltage without the resistor by just jumpering a wire directly from DAC1 to AIN0 (or whatever pin is defined as). It should read the correct voltage. You can also test it by taping the wire to ground or VS.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users