Next
ReferenceHardwareLabJackRead task

LabJack read task

Read analog, digital, and thermocouple inputs from a LabJack into channels.

A LabJack read task reads the inputs of one LabJack device into channels. For example, it can record a pressure transducer on AIN0 and a switch on DIO4 at 1 kHz.

Before you start, you need a configured device.

Channels and timing

A read task has three types of channels:

  • Analog input -> a voltage on an AIN port.
  • Digital input -> the state of a DIO port, as 0 or 1.
  • Thermocouple -> a temperature from a thermocouple on an AIN port. Thermocouples work on the T7 and the T8.

A task streams: the device samples the inputs on its own clock. A T7 task with thermocouple channels polls instead: the Driver reads one sample of each channel at a time, on its own clock. See timing.

A T8 task with thermocouple channels samples at 250 Hz or less. It needs T8 firmware 1.0038 or later and LJM 1.2304 or later.

A LabJack runs one stream at a time and cannot read AIN ports during a stream, so a streaming task must be the only read task on its device. Add more channels to that task instead of starting a second one.

Create a LabJack read task

Enterprise
  1. In the devices toolbar, right-click the device and select Create read task.
  2. Set Sample rate and Stream rate.
  3. Click Add channel, then select the type of channel and the Port.
  4. Click (Start).

The Console creates the channels. For a device with the identifier lj1, the channel for AIN0 is lj1_AIN0, with the index channel lj1_time. To use a different name, enter it in the channel list before you start the task.

Tare channels

Tare sets the current value of an analog channel to zero. The task must be running.

  1. In the channel list, click Tare on an analog channel. To tare several channels, select them, right-click, and select Tare.
  2. The values of those channels start from zero.

Task options

Console label Python field Default Notes
Device device The serial number of the device.
Sample rate sample_rate 10 Hz Up to 50,000 Hz in the Console.
Stream rate stream_rate 5 Hz See read tasks.
Data saving data_saving_disabled On See data saving.
Auto start auto_start Off Starts the task each time the Driver starts.

Channel reference

Each channel has a channel, the Synnax channel that records the value. Each table shows the Console label of a setting, with its Python field under it.

Analog input

Python AnalogReadChannelTypeScript analog

Reads a voltage.

Setting Default Notes
Port port AIN0 An AIN port.
Max voltage range 10 The input uses the smallest range of the device that covers this voltage. Not on the T4.
Negative channel neg_chan Ground Absent for ground, or the pair of the port for a differential reading. On the T7 only.
Scale scale None None, linear (slope and offset), map (raw range to scaled range), polynomial, or table.

Troubleshooting

For other problems, see Configure a LabJack device and Troubleshoot hardware.