{"id":21511,"library":"labjack-ljm","title":"LabJack LJM","description":"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.","status":"active","version":"1.23.0","language":"python","source_language":"en","source_url":"https://github.com/labjack/labjack-ljm-python","tags":["labjack","data acquisition","T7","T8","LJM"],"install":[{"cmd":"pip install labjack-ljm","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Incorrect import path; 'labjack.ljm' is the correct module.","wrong":"from labjack import ljm","symbol":"LJM","correct":"import labjack.ljm as ljm"},{"note":"","wrong":null,"symbol":"LJM","correct":"from labjack import ljm"}],"quickstart":{"code":"import labjack.ljm as ljm\n\n# Open first found LabJack device\nhandle = ljm.openS(\"ANY\", \"ANY\", \"ANY\")  # returns handle\ninfo = ljm.getHandleInfo(handle)\nprint(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]}\")\n\n# Write and read analog output\nljm.eWriteName(handle, \"DAC0\", 2.5)  # set DAC0 to 2.5V\nvalue = ljm.eReadName(handle, \"DAC0\")\nprint(f\"DAC0 value: {value}\")\n\nljm.close(handle)","lang":"python","description":"Open a LabJack device, write to DAC0, read back, and close."},"warnings":[{"fix":"Upgrade to labjack-ljm >= 1.20.0 to use T8.","message":"LabJack T8 support introduced in LJM 1.20.0. Older LJM versions do not support T8 devices. Update accordingly.","severity":"breaking","affected_versions":"<=1.19.0"},{"fix":"Check the release notes for exact changes. Use floats for analog values.","message":"In LJM 1.22.0, some function signatures changed (e.g., eWriteName now expects a float for analog outputs instead of int).","severity":"breaking","affected_versions":"==1.22.0"},{"fix":"Download and install LJM from LabJack's website (https://labjack.com/support/software/ljm).","message":"LJM requires the LabJack LJM library (shared library) to be installed on the system. pip install does not install the native library.","severity":"gotcha","affected_versions":"all"},{"fix":"Always close the handle after use with ljm.close(handle).","message":"When opening devices, ensure only one instance of the device is open. Multiple handles to the same device can cause undefined behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace ljm.listAll() with ljm.listAllS() in your code.","message":"ljm.listAll() is deprecated; use ljm.listAllS() instead.","severity":"deprecated","affected_versions":">=1.22.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Check USB/ethernet connection, ensure device is powered, and verify LJM native library is installed (run 'ljm_install' or see LabJack docs).","cause":"Device not connected or LJM library not installed properly.","error":"LJMError: LJM_ERROR_DEVICE_NOT_FOUND"},{"fix":"Install with 'pip install labjack-ljm' and import using 'import labjack.ljm as ljm'.","cause":"labjack-ljm Python package not installed or wrong import path.","error":"ImportError: No module named labjack.ljm"},{"fix":"Ensure handle is obtained from ljm.openS() and not closed before use.","cause":"Device handle is invalid (closed or never opened).","error":"LJMError: LJM_ERROR_INVALID_HANDLE"},{"fix":"Install the LJM native library from LabJack's website. On Linux, set LD_LIBRARY_PATH to the directory containing the library.","cause":"Native LJM library (liblabjacklm.so or LabJackLM.dll) not found in system library path.","error":"LJMError: LJM_ERROR_LIBRARY_NOT_FOUND"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}