« Close

Datasheets and User Guides

App Notes

Software & Driver


2.7 - Debugging Functions

Debugging Functions Overview

LJM contains debug logging functionality that is disabled by default.

Once enabled, LJM will write messages to the LJM debug log file. These messages can contain error messages, warnings, raw packets, and other information.

LJM's debug logging can be enabled using one of two methods – via ljm_startup_configs.json or via LJM_WriteLibraryConfigS. Both methods (described below) require changing the following LJM configuration parameters:

  • Change LJM_DEBUG_LOG_LEVEL to one of the possible debug levels. Use LJM_STREAM_PACKET (equal to 1) if you want to ensure that all debug messages are output.
  • Change LJM_DEBUG_LOG_FILE_MAX_SIZE to a large number like 123456789 if your program will be running for a long time.

Enabling via ljm_startup_configs.json

The file ljm_startup_configs.json contains the LJM configurations that are used by LJM when LJM is loaded.

Note that ljm_startup_configs.json is installed / replaced every time the LJM installer is run, so this method is temporary. LJM installs ljm_startup_configs.json to the following locations:

  • Windows Vista and later - C:\ProgramData\LabJack\LJM\ljm_startup_configs.json
  • Windows XP - C:\Documents and Settings\All Users\Application Data\LabJack\LJM\ljm_startup_configs.json
  • Mac OS X and Linux - /usr/local/share/LabJack/LJM/ljm_startup_configs.json

After opening ljm_startup_configs.json with a text editor, change the parameters as described above.

Enabling via LJM_WriteLibraryConfigS

Use the function LJM_WriteLibraryConfigS to change the LJM parameters as described above.