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

Parameter Type Required Default Description
device string Yes - Key of the LabJack device
sample_rate number No 10 Samples per second (Hz)
stream_rate number No 5 Rate data is streamed to Synnax (Hz), must be ≤ sample_rate
channels array Yes - 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.

Parameter Type Required Default Description
channel number Yes - Synnax channel key
port string Yes - Port location (e.g., AIN0, AIN1)
range number No 10.0 Voltage range (±range volts)
neg_chan number No 199 Negative channel for differential measurements (199 = single-ended/GND)
scale object No - 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.

Parameter Type Required Default Description
channel number Yes - Synnax channel key
port string Yes - AIN port the positive lead is wired to (e.g., AIN0, AIN1)
thermocouple_type enum No K B, E, J, K, N, R, S, T, C
units enum No K Temperature units (K, C, F)
cjc_source string No TEMPERATURE_DEVICE_K CJC source: TEMPERATURE_DEVICE_K, TEMPERATURE_AIR_K, or AIN#
cjc_slope number No 1.0 CJC voltage to temperature slope (K/V)
cjc_offset number No 0.0 CJC temperature offset (K)
neg_chan number No 199 Negative channel for differential measurements (199 = single-ended/GND)
scale object No - 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.

Parameter Type Required Default Description
channel number Yes - Synnax channel key
port string Yes - 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