Registry / data / labjack-ljm

labjack-ljm

JSON →
library1.23.0pypypi✓ verified 85d ago

Python wrapper for the LabJack LJM library, used to control LabJack T4, T7, and T8 devices. Version 1.23.0 released in 2024. Active development with periodic updates.

pip install labjack-ljm
INSTALL
IMPORT
SIG · LABJACK-LJM
L
labjack-ljm
datapythonv1.23.0
Install
1.7s avg
Import
15ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.23.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.010s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.020s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LJM
import labjack.ljm as ljm
from labjack import ljm
Incorrect import path; 'labjack.ljm' is the correct module.
LJM
from labjack import ljm

Open a LabJack device, write to DAC0, read back, and close.

import labjack.ljm as ljm # Open first found LabJack device handle = ljm.openS("ANY", "ANY", "ANY") # returns handle info = ljm.getHandleInfo(handle) print(f"Opened a LabJack with device type: {info[0]} connection type: {info[1]} serial number: {info[2]} IP address: {info[3]} port: {info[4]} max bytes per MB: {info[5]}") # Write and read analog output ljm.eWriteName(handle, "DAC0", 2.5) # set DAC0 to 2.5V value = ljm.eReadName(handle, "DAC0") print(f"DAC0 value: {value}") ljm.close(handle)
Debug
Known issues
breakingLabJack T8 support introduced in LJM 1.20.0. Older LJM versions do not support T8 devices. Update accordingly.
fix
Upgrade to labjack-ljm >= 1.20.0 to use T8.
affects: <=1.19.0
breakingIn LJM 1.22.0, some function signatures changed (e.g., eWriteName now expects a float for analog outputs instead of int).
fix
Check the release notes for exact changes. Use floats for analog values.
affects: ==1.22.0
gotchaLJM requires the LabJack LJM library (shared library) to be installed on the system. pip install does not install the native library.
fix
Download and install LJM from LabJack's website (https://labjack.com/support/software/ljm).
affects: all
gotchaWhen opening devices, ensure only one instance of the device is open. Multiple handles to the same device can cause undefined behavior.
fix
Always close the handle after use with ljm.close(handle).
affects: all
deprecatedljm.listAll() is deprecated; use ljm.listAllS() instead.
fix
Replace ljm.listAll() with ljm.listAllS() in your code.
affects: >=1.22.0
Errors
Common errors & fixes
LJMError: LJM_ERROR_DEVICE_NOT_FOUND
Device not connected or LJM library not installed properly.
fix
Check USB/ethernet connection, ensure device is powered, and verify LJM native library is installed (run 'ljm_install' or see LabJack docs).
ImportError: No module named labjack.ljm
labjack-ljm Python package not installed or wrong import path.
fix
Install with 'pip install labjack-ljm' and import using 'import labjack.ljm as ljm'.
LJMError: LJM_ERROR_INVALID_HANDLE
Device handle is invalid (closed or never opened).
fix
Ensure handle is obtained from ljm.openS() and not closed before use.
LJMError: LJM_ERROR_LIBRARY_NOT_FOUND
Native LJM library (liblabjacklm.so or LabJackLM.dll) not found in system library path.
fix
Install the LJM native library from LabJack's website. On Linux, set LD_LIBRARY_PATH to the directory containing the library.
Upgrade
Version history
1.23.0latest on PyPI · released Dec 4, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
labjack-ljm — pip install labjack-ljm · libregistry