Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Getting Started with LabJack U6 C#


  • Please log in to reply
1 reply to this topic

#1 MarcoAndarcia

MarcoAndarcia
  • Members
  • 17 posts

Posted 30 July 2012 - 03:16 PM

Hi, 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); return voltage; } 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. Marco.

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 06 August 2012 - 03:15 PM

Hi,

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);
return voltage;
}

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.

Marco.


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