Test an AIN Channel (App Note) | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


Test an AIN Channel (App Note)

If you want to test an analog input (AIN), or you're new to our products, and need to write code to measure or output analog voltages, this is one of the first things that you should try to do.  All I/O on the LabJack share a common ground, so the voltage on an analog output (DAC) can be measured by simply connecting a single wire from that terminal to an analog input compatible terminal. The analog output must be set to a voltage within the range of the analog input.  

Example Connection:

Simply connect a DAC channel to an AIN channel.  Try writing a value to a DAC channel and then reading the AIN channel.


This is an app note?  Really?

Sometimes it is nice to see something is as simple as you thought.

This is great for newbies like me. Thanks!!

I want to read two outputs from my circuit. I just wanted to make sure I understand it well: I have to connect one output to AIN0 and the other to AIN1 and then connect the ground of my circuit to GND on LabJack?

Do I have to configure negative channels if I am doing single ended readings? Your Matlab Streaming code includes the bit I pasted below, is it necessary?

%Configure the negative channels for single ended readings.

    aNames = NET.createArray('System.String', numAddresses);

    aValues = NET.createArray('System.Double', numAddresses);

    for i=1:numAddresses,

        aNames(i) = [char(aScanListNames(i)) '_NEGATIVE_CH'];

        aValues(i) = LJM_CONSTANTS.GND;


    LabJack.LJM.eWriteNames(handle, numAddresses, aNames, aValues, 0);

Thank you in advance.

That sounds right.  Will the voltage of each point (versus ground) be within the valid AIN range of your LabJack?  In your code you are talking to the LJM libary, which suggests you have a T7.  The max AIN range for the T7 is +/-10V.

The default is single-ended (negative channel = 199), so you likely do not need to write those in your case.