« Close

Datasheets and User Guides

App Notes

Software & Driver

 

14.0 Analog Inputs [T-Series Datasheet]

Analog Inputs Overview

Basics: An analog input (commonly refered as AIN or AI) uses an analog-to-digital converter (ADC) to convert a voltage level into a digital value.  LabJack T-series devices have multiple analog inputs.

Common Uses: For information on measuring various analog signals such as typical analog sensors, measuring small voltages, measuring current (4-20mA), and measuring resistance see the Analog Input (App Note). There are also application specific app notes for temperature sensors and thermocouples.

How to read AIN: See 3.0 Communication for communication basics. Also, LabJack Kipling's Dashboard tab shows live AIN values. 

Configuration: T-series AIN readings can be configured. See below for information on:

  • Resolution Index
  • Flexible I/O - T4 Only
  • Range - T7 Only
  • Single-ended or Differential - T7 Only
  • Settling
  • Other Considerations

AIN Extended Features: T-series AIN Extended Features simplify operations such as:

  • Reading thermocouples and thermistors
  • Calculating RMS, RTD, average/max/min, average/threshold, and circuit element resistance

Extended Channels - T7 Only: The T7's Extended Channels range provides extra AIN channels.

AIN Summary By Device

T4

 
Analog Inputs: 4 high-voltage (AIN0-AIN3)
8 low-voltage (AIN4-AIN11)
Voltage Ranges: ±10V or 0-2.5V (Appendix A-3 and Appendix A-3-2)
Resolution: 12-bit
Max Data Rate: 40 ksamples/second in stream mode (Appendix A-1)
Sampling Modes: Single-ended

T7

 
Analog Inputs: 14 (AIN0-AIN13)
Voltage Ranges: ±10V, ±1V, ±0.1V, and ±0.01V (Appendix A-3 and Appendix A-3-2)
ADC Resolution: T7 = 16-bit
T7-Pro = 16-bit and 24-bit
Effective Resolution: T7 = 16-bit to 19-bit
T7-Pro = 16-bit and 22-bit
At Gain 1x. For more details see Appendix A-3-1.
Max Data Rate: 100 ksamples/second in stream mode (Appendix A-1)
Sampling Modes: Configurable as single-ended or differential
Extended Channels: The number of analog inputs can be extended to 84 with a Mux80 (AIN48-AIN127).

Available AIN Channels

Each T-series device exposes:

  • Some AINs on the screw terminals.
  • Additional AINs on a connector (either a DB15 or a DB37).

T4

 
Figure 14.0-1 T4 Dedicated Analog Inputs
T4 Analog Inputs AIN (0-11)
Figure 14.0-2 T4 Flexible I/O
T4 Flexible I/O (FIO4-7, EIO0-3)

The LabJack T4 has up to 12 built-in analog inputs, readable as AIN0-AIN11:

  • AIN0-AIN3 are dedicated ±10 volt inputs:
    • Available on screw terminals AIN0-AIN3.
    • Always ±10 volt analog inputs.
  • AIN4-AIN7 are flexible 0 to +2.5 volt inputs:
    • Available on screw terminals FIO4-FIO7.
    • Configurable to be digital inputs/outputs.  See "Flexible I/O" below.
  • AIN8-AIN11 are flexible 0 to +2.5 volt inputs:
    • Available on the DB15 connector.
    • Configurable to be digital inputs/outputs. See "Flexible I/O" below.

T4 AIN Channel Registers
Name Start Address Type Access
AIN#(0:11) 0 FLOAT32 R
AIN#(0:11)
- Starting Address: 0
Returns the voltage of the specified analog input.
  • Data type: FLOAT32  (type index = 3)
  • Read-only
  • This register may be streamed
Expanded Names Addresses
AIN0, AIN1, AIN2, AIN3, AIN4, AIN5, AIN6, AIN7, AIN8, AIN9, AIN10, AIN11 Show All 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22 Show All

T7

 
Figure 14.0-3 T7 Analog Inputs
T7 Analog Inputs AIN (0-13)

The LabJack T7 has 14 built-in analog inputs, readable as AIN0-13:

  • AIN0-AIN3 are available on the screw terminals and on the DB37 connector. See "Duplicated Terminals" below.
  • AIN4-AIN13 are available only on the DB37 connector.

T7 AIN Channel Registers
Name Start Address Type Access
AIN#(0:13) 0 FLOAT32 R
AIN#(0:13)
- Starting Address: 0
Returns the voltage of the specified analog input.
  • Data type: FLOAT32  (type index = 3)
  • Read-only
  • This register may be streamed
Expanded Names Addresses
AIN0, AIN1, AIN2, AIN3, AIN4, AIN5, AIN6, AIN7, AIN8, AIN9, AIN10, AIN11, AIN12, AIN13 Show All 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26 Show All

In addition to the 14 built-in analog inputs, the T7 has special and extended channels.

    • AIN14 is internally connected to an internal temperature sensor.
    • AIN15 is internally connected to GND which is useful for detecting ground offsets.
    • AIN16-AIN47 are optional extended channels that can be created with custom analog input muxing circuitry. See Section 14.2 Extended Channels for more information.
    • AIN48-AIN127 are extended channels that are available when using a Mux80.

T7 Extended AIN Channel Registers
Name Start Address Type Access
AIN#(48:127) 96 FLOAT32 R
AIN#(48:127)
- Starting Address: 96
Returns the voltage of the specified analog input.
  • Data type: FLOAT32  (type index = 3)
  • Read-only
  • This register may be streamed
Expanded Names Addresses
AIN48, AIN49, AIN50, AIN51, AIN52, AIN53, AIN54, AIN55, AIN56, AIN57, AIN58, AIN59, AIN60, AIN61, AIN62, AIN63, AIN64, AIN65, AIN66, AIN67, AIN68, AIN69, AIN70, AIN71, AIN72, AIN73, AIN74, AIN75, AIN76, AIN77, AIN78, AIN79, AIN80, AIN81, AIN82, AIN83, AIN84, AIN85, AIN86, AIN87, AIN88, AIN89, AIN90, AIN91, AIN92, AIN93, AIN94, AIN95, AIN96, AIN97, AIN98, AIN99, AIN100, AIN101, AIN102, AIN103, AIN104, AIN105, AIN106, AIN107, AIN108, AIN109, AIN110, AIN111, AIN112, AIN113, AIN114, AIN115, AIN116, AIN117, AIN118, AIN119, AIN120, AIN121, AIN122, AIN123, AIN124, AIN125, AIN126, AIN127 Show All 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254 Show All

Example:

To read a voltage connected to AIN1, read AIN1 (address 2). The result will be in the form of a floating point number, like 8.82332V.

Resolution Index

A higher resolution index results in lower noise and higher effective resolution but increases sample times.

Resolution Index Registers
Name Start Address Type Access
AIN#(0:13)_RESOLUTION_INDEX 41500 UINT16 R/W
AIN_ALL_RESOLUTION_INDEX 43903 UINT16 R/W
AIN#(0:13)_RESOLUTION_INDEX
- Starting Address: 41500
The resolution index for command-response and AIN-EF readings. A larger resolution index generally results in lower noise and longer sample times.
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Default value: 0
  • T7:
    • Valid values: 0-8 for T7, 0-12 for T7-Pro. Default value of 0 corresponds to an index of 8 (T7) or 9 (T7-Pro).
  • T4:
    • Valid values: 0-5. Default value of 0 corresponds to an index of 5.
Expanded Names Addresses
AIN0_RESOLUTION_INDEX, AIN1_RESOLUTION_INDEX, AIN2_RESOLUTION_INDEX, AIN3_RESOLUTION_INDEX, AIN4_RESOLUTION_INDEX, AIN5_RESOLUTION_INDEX, AIN6_RESOLUTION_INDEX, AIN7_RESOLUTION_INDEX, AIN8_RESOLUTION_INDEX, AIN9_RESOLUTION_INDEX, AIN10_RESOLUTION_INDEX, AIN11_RESOLUTION_INDEX, AIN12_RESOLUTION_INDEX, AIN13_RESOLUTION_INDEX Show All 41500, 41501, 41502, 41503, 41504, 41505, 41506, 41507, 41508, 41509, 41510, 41511, 41512, 41513 Show All
AIN_ALL_RESOLUTION_INDEX
- Address: 43903
The resolution index for command-response and AIN-EF readings. A larger resolution index generally results in lower noise and longer sample times. A write to this global parameter affects all AIN. A read will return the correct setting if all channels are set the same, but otherwise will return 0xFFFF.
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Default value: 0
  • T7:
    • Valid values: 0-8 for T7, 0-12 for T7-Pro. Default value of 0 corresponds to an index of 8 (T7) or 9 (T7-Pro).
    • Minimum firmware version: 0.9328
  • T4:
    • Valid values: 0-5. Default value of 0 corresponds to an index of 5.

Defaults

Setting resolution index to 0 sets the default resolution index to:

  • 5 for command-response mode on a T4
  • 8 for command-response mode on a T7
  • 9 for command-response mode on a T7-Pro

Example:

To read AIN1 with resolution index 4:

    1. Set the AIN1 resolution index to 4 by writing 5 to AIN1_RESOLUTION_INDEX (address 41501)
    2. Read AIN1

Remarks

Resolution index ranges:

  • T4 resolution index ranges from 0 to 5
  • T7 resolution index ranges from 0 to 8
  • T7-Pro resolution index ranges from 0 to 12
    • Settings 9-12 use the alternate high-resolution converter (24-bit sigma-delta)

AIN#(0:13)_RESOLUTION_INDEX and AIN_ALL_RESOLUTION_INDEX do not apply to stream mode, for which there is a dedicated resolution index register.

For typical noise levels and sample times at different combinations of resolution index and gain, see Appendix A-3-1 Noise and Resolution.

For general discussion on the meaning of resolution, see the Noise and Resolution App Note.

Flexible I/O - T4 Only

 

Flexible I/O are I/O ports that may be configured as analog inputs, or as digital inputs or outputs.

Flexible I/O Configuration
Name Start Address Type Access
DIO_INHIBIT 2900 UINT32 R/W
DIO_ANALOG_ENABLE 2880 UINT32 R/W
DIO_INHIBIT
- Address: 2900
A single binary-encoded value where each bit determines whether _STATE, _DIRECTION or _ANALOG_ENABLE writes affect that bit of digital I/O. 0=Default=Affected, 1=Ignored.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
Constant Value
Affected 0
Ignored 1
DIO_ANALOG_ENABLE
- Address: 2880
Read or write the analog configuration of all digital I/O in a single binary-encoded value. 1=Analog mode and 0=Digital mode. When switching fron analog to digital, the lines will be set to input. Writes are filtered by the value in DIO_INHIBIT.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Constant Value
Digital mode 0
Analog mode 1

AIN4-AIN11 are flexible I/O. To configure these channels as analog inputs:

  • Set the correct bit of DIO_INHIBIT to 0
  • Set the correct bit of DIO_ANALOG_ENABLE to 1

The bit to set of DIO_INHIBIT and of DIO_ANALOG_ENABLE is the same as the channel number. For example, to configure AIN4 (screw terminal FIO4) as an analog input:

  • Set bit 4 of DIO_INHIBIT to 0
  • Set bit 4 of DIO_ANALOG_ENABLE to 1

AIN0-AIN3 are dedicated analog inputs and cannot be configured as digital I/O.

For more information on configuring flexible I/O, see Section 13.1 Flexible I/O.

Single-ended or Differential - T7 Only

 

Single-ended AIN readings are read with ground (GND) as a reference point. Differential readings use a second AIN as a reference point. For more, see the Differential Readings App Note.

Negative Channel Registers
Name Start Address Type Access
AIN#(0:13)_NEGATIVE_CH 41000 UINT16 R/W
AIN_ALL_NEGATIVE_CH 43902 UINT16 R/W
AIN#(0:13)_NEGATIVE_CH
- Starting Address: 41000
Specifies the negative channel to be used for each positive channel. 199=Default=> Single-Ended.
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Default value: 199
  • T7:
    • For base differential channels, positive must be even channel from 0-12 and negative must be positive+1. For extended channels 16-127, see Mux80 datasheet.
Expanded Names Addresses
AIN0_NEGATIVE_CH, AIN1_NEGATIVE_CH, AIN2_NEGATIVE_CH, AIN3_NEGATIVE_CH, AIN4_NEGATIVE_CH, AIN5_NEGATIVE_CH, AIN6_NEGATIVE_CH, AIN7_NEGATIVE_CH, AIN8_NEGATIVE_CH, AIN9_NEGATIVE_CH, AIN10_NEGATIVE_CH, AIN11_NEGATIVE_CH, AIN12_NEGATIVE_CH, AIN13_NEGATIVE_CH Show All 41000, 41001, 41002, 41003, 41004, 41005, 41006, 41007, 41008, 41009, 41010, 41011, 41012, 41013 Show All
AIN_ALL_NEGATIVE_CH
- Address: 43902
A write to this global parameter affects all AIN. Writing 1 will set all AINs to differential. Writing 199 will set all AINs to single-ended. A read will return 1 if all AINs are set to differential and 199 if all AINs are set to single-ended. If AIN configurations are not consistent 0xFFFF will be returned.
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Default value: 199
  • T7:

The AIN#(0:13)_NEGATIVE_CH and AIN_ALL_NEGATIVE_CH parameters configure whether the AIN performs differential vs. single-ended readings (not to be confused with bipolar and unipolar—the T7 is always bipolar).

Example:

To take a differential reading on AIN2, set AIN3 as its negative channel (AIN2-AIN3):

    1. Write 3 to AIN2_NEGATIVE_CH (address 41002)
    2. Read AIN2

To read AIN2 single-ended again (AIN2-GND):

    1. Write 199 to AIN2_NEGATIVE_CH (address 41002)
    2. Read AIN2

Built-in AIN

For AIN0 through AIN13, differential channels are adjacent even/odd pairs such that the positive channel is even and the negative channel is greater than the positive channel by 1. Odd channels, such as AIN3_NEGATIVE_CH (address 41003), should not be written to because only an even channel can have an associated negative channel.

Temperature and Ground

AIN14 is the internal temperature sensor and AIN15 is GND. Neither can be read differentially.

Extended AIN

For AIN16 and greater, the rules for pairing differential channels is different. See 14.2 Extended Channels or the Mux80 datasheet for more.

Range / Gain - T7 Only

 

T7 Internal Amplifier: The analog inputs are connected to a high-impedance instrumentation amplifier, as shown in Figure 4.2-2. This in-amp does the following:

  • Buffers the signal for the internal ADCs
  • Allows for single-ended or differential conversions
  • Provides gains of x1, x10, x100, and x1000 (corresponding to ranges of ±10V, ±1V, ±0.1V, and ±0.01V, respectively).

Range Registers
Name Start Address Type Access
AIN#(0:13)_RANGE 40000 FLOAT32 R/W
AIN_ALL_RANGE 43900 FLOAT32 R/W
AIN#(0:13)_RANGE
- Starting Address: 40000
The range/span of each analog input. Write the highest expected input voltage.
  • Data type: FLOAT32  (type index = 3)
  • Readable and writable
  • Default value: 0
  • T7:
    • Valid values/ranges: 0.0=Default=> +/-10V, 10.0=> +/-10V, 1.0=> +/-1V, 0.1=> +/-0.1V, or 0.01=> +/-0.01V.
  • T4:
    • Valid values/ranges: 0.0=Default=> 0-2.5 V on LV lines and ±10 V on HV lines.
Expanded Names Addresses
AIN0_RANGE, AIN1_RANGE, AIN2_RANGE, AIN3_RANGE, AIN4_RANGE, AIN5_RANGE, AIN6_RANGE, AIN7_RANGE, AIN8_RANGE, AIN9_RANGE, AIN10_RANGE, AIN11_RANGE, AIN12_RANGE, AIN13_RANGE Show All 40000, 40002, 40004, 40006, 40008, 40010, 40012, 40014, 40016, 40018, 40020, 40022, 40024, 40026 Show All
AIN_ALL_RANGE
- Address: 43900
A write to this global parameter affects all AIN. A read will return the correct setting if all channels are set the same, but otherwise will return -9999.
  • Data type: FLOAT32  (type index = 3)
  • Readable and writable
  • Default value: 0
  • T7:

Example:

If the voltage source connected to AIN1 has a known range of 0 to 0.7V, the appropriate range for AIN1 is the ±1V range. To read AIN1 with the ±1V range:

    1. Write 1.0 to AIN1_RANGE (address 40002)
    2. Read AIN1

The range registers (AIN#(0:13)_RANGE and AIN_ALL_RANGE) control the gain of the T7's internal instrumentation amplifier. The in-amp supports gains of x1, x10, x100, and x1000.

    • A range of 10 sets gain=x1 so that the analog input range is ±10 volts. This is the default range.
  • A range of 1 sets gain=x10 so that the analog input range is ±1 volts.
  • A range of 0.1 sets gain=x100 so that the analog input range is ±0.1 volts.
  • A range of 0.01 sets gain=x1000 so that the analog input range is ±0.01 volts.

Values written to RANGE are rounded up (except for values greater than 10.0, which are rounded down). For example, writing 0.5 to AIN_ALL_RANGE will set the analog input range to ±1 volts.

The T7 knows what the internal gain is set to and adjusts the return values to give the voltage at the input terminals, so if you connect a 0.8 volt signal to the input terminals, it will be amplified to 8.0 volts before being digitized, but the reading you get back will be 0.8 volts.

Settling

The settling registers (AIN#(0:13)_SETTLING_US and AIN_ALL_SETTLING_US) set the time from a step change in the input signal to when the signal is sampled by the ADC, as measured in microseconds. A step change in this case is caused when the internal multiplexers change from one channel to another. In general, more settling time is required as gain and resolution are increased.

The value 0 sets automatic settling, which is recommended for most applications. This "auto" settling ensures that the device meets specifications at any gain and resolution for source impedance up to at least 1000 ohms.

Settling Registers
Name Start Address Type Access
AIN#(0:13)_SETTLING_US 42000 FLOAT32 R/W
AIN_ALL_SETTLING_US 43904 FLOAT32 R/W
AIN#(0:13)_SETTLING_US
- Starting Address: 42000
Settling time for command-response and AIN-EF readings.
  • Data type: FLOAT32  (type index = 3)
  • Readable and writable
  • Default value: 0
  • T7:
    • 0 = Auto. Max is 50000 (microseconds).
    • Minimum firmware version: 0.9328
  • T4:
    • 0 = Auto. Max is 10000 (microseconds).
Expanded Names Addresses
AIN0_SETTLING_US, AIN1_SETTLING_US, AIN2_SETTLING_US, AIN3_SETTLING_US, AIN4_SETTLING_US, AIN5_SETTLING_US, AIN6_SETTLING_US, AIN7_SETTLING_US, AIN8_SETTLING_US, AIN9_SETTLING_US, AIN10_SETTLING_US, AIN11_SETTLING_US, AIN12_SETTLING_US, AIN13_SETTLING_US Show All 42000, 42002, 42004, 42006, 42008, 42010, 42012, 42014, 42016, 42018, 42020, 42022, 42024, 42026 Show All
AIN_ALL_SETTLING_US
- Address: 43904
Settling time for command-response and AIN-EF readings. A write to this global parameter affects all AIN. A read will return the correct setting if all channels are set the same, but otherwise will return -9999. Max is 50,000 us.
  • Data type: FLOAT32  (type index = 3)
  • Readable and writable
  • Default value: 0
  • T7:
    • 0 = Auto. Max is 50000 (microseconds).
    • Minimum firmware version: 0.9328
  • T4:
    • 0 = Auto. Max is 10000 (microseconds).

Example:

To read AIN3 with a manual settling time of 500 µs:

    1. Write 500 to AIN3_SETTLING_US (address 42006)
    2. Read AIN3

Remarks

AIN#(0:13)_SETTLING_US and AIN_ALL_SETTLING_US do not apply to stream mode, though they do apply to all command-response communications, including AIN EF.

The timings in Appendix A are measured with "auto" settling.

See the Analog Input Settling Time (App Note) for more details.

Other Considerations

Streaming AIN: See 3.2 Stream Mode for streaming analog inputs. Some stream configurations override the normal AIN configurations:

  • Use STREAM_SETTLING_US instead of AIN_SETTLING_US.
  • Use STREAM_RESOLUTION_INDEX instead of AIN_RESOLUTION_INDEX.

Floating Inputs: The analog inputs are not artificially pulled to 0.0 volts, as that would reduce the input impedance, so readings obtained from floating channels will generally not be 0.0 volts. The readings from floating channels depend on adjacent channels and sample rate and have little meaning. See the floating input application note.

Connections: For information regarding typical analog input connections, please see the Analog Input App Note.

Address Step Size:

Addresses of the FLOAT32 type increment in steps of 2 because FLOAT32 uses two sets of 16-bits. FLOAT32 registers include AIN#, AIN#_RANGE, and AIN#_SETTLING_US.

Addresses of the UINT16 type increment in steps of 1 because UNIT16 uses only one set of 16-bits. UINT16 registers include AIN#_NEGATIVE_CH and AIN#_RESOLUTION_INDEX.

T7 Only: Duplicated Terminals (AIN0-AIN3):

 

AIN0-AIN3 appear on the built-in screw-terminals and also on the DB37 connector. Users should only connect to one or the other, not both at the same time.

To prevent damage due to accidental short circuit, both connection paths have their own series resistor. All AIN lines have a 2.2k series resistor, and in the case of AIN0-AIN3 the duplicated connections each have their own series resistor, so if you measure the resistance between the duplicate terminals you will see about 4.4k.

Analog Input Channels Reference

Table 13.0-1 Analog Input Channel Overview

  Built-in Analog Inputs Extended Channels
AIN 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 AIN (48-127)
T4 AIN (0-3)
High-Voltage ±10V
AIN (4-11)
Low-Voltage 0-2.5V
N/A N/A
T7 AIN (0-13)
High-Voltage ±10V Options: SE/Diff, Gains (1000x, 100x, 10x, 1)
Special
Channels
AIN (48-127)
Mux80