0.60

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 only.

With no thermocouple channels, the device samples the inputs on its own clock. With one or more thermocouple channels, the Driver reads one sample of each channel at a time, and the Stream rate has no effect. See timing.

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 Driver does not apply this field. Each input uses the default range of the device.
neg_chan 199 The negative input for a differential reading, on the T7 only. 199 means a single-ended input.
Scale scale None None, linear (slope and offset), or map (from a raw range to a scaled range).

Troubleshooting

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