ReferenceDriverLabJackRead Task

LabJack Read Task

Learn how to acquire data from LabJack devices with Synnax.

For the task lifecycle, see Task Basics.

Task Configuration Reference

ParameterTypeRequiredDefaultDescription
devicestringYes-Key of the LabJack device
sample_ratenumberNo10Samples per second (Hz)
stream_ratenumberNo5Rate data is streamed to Synnax (Hz), must be ≤ sample_rate
channelsarrayYes-List of input channel configurations

Channel Types Reference

Analog Input (analog)

Reads analog voltage from a specified input terminal. Supports single-ended and differential configurations.

ParameterTypeRequiredDefaultDescription
channelnumberYes-Synnax channel key
portstringYes-Port location (e.g., AIN0, AIN1)
rangenumberNo10.0Voltage range (±range volts)
neg_channumberNo199Negative channel for differential measurements (199 = single-ended/GND)
scaleobjectNo-Custom scaling applied to the reading

Thermocouple (thermocouple)

Reads temperature from a thermocouple with cold junction compensation (CJC).

Performance Note -> Thermocouple channels use LabJack’s built-in thermocouple features, which reduce the maximum reliable sample rate compared to tasks with only analog or digital inputs.

ParameterTypeRequiredDefaultDescription
channelnumberYes-Synnax channel key
portstringYes-AIN port the positive lead is wired to (e.g., AIN0, AIN1)
thermocouple_typeenumNoKB, E, J, K, N, R, S, T, C
unitsenumNoKTemperature units (K, C, F)
cjc_sourcestringNoTEMPERATURE_DEVICE_KCJC source: TEMPERATURE_DEVICE_K, TEMPERATURE_AIR_K, or AIN#
cjc_slopenumberNo1.0CJC voltage to temperature slope (K/V)
cjc_offsetnumberNo0.0CJC temperature offset (K)
neg_channumberNo199Negative channel for differential measurements (199 = single-ended/GND)
scaleobjectNo-Custom scaling applied to the reading

CJC Configuration Examples:

  • Device temp sensor -> cjc_source="TEMPERATURE_DEVICE_K", cjc_slope=1.0, cjc_offset=0.0
  • LM34 sensor -> cjc_source="AIN1", cjc_slope=55.56, cjc_offset=255.37

Digital Input (digital)

Reads digital state (0 or 1) from a specified digital I/O line.

ParameterTypeRequiredDefaultDescription
channelnumberYes-Synnax channel key
portstringYes-Port location (e.g., DIO4, FIO5)

Important Rules

  • Thermocouple performance -> Thermocouple channels lower the maximum sample rate because LJM processes them outside the stream.
  • Stream rate -> For sample rates under 50 Hz, set the stream rate equal to the sample rate. Above that, keep the stream rate under 50 Hz.

How-To