Skip to main content
Skip table of contents

LJM Library Configuration Functions

This section describes how to configure the LJM library's behavior and interpretation constants. Whenever LJM is started up, it is loaded with default values, so any desired configurations must be applied each time LJM is started.

Behavioral Parameters

The functions LJM_WriteLibraryConfigS and LJM_WriteLibraryConfigStringS are good for setting a few configurations, while LJM_LoadConfigurationFile is more convenient for setting many configurations or for sharing a configuration between programs.

Interpretation Constants

LJM also provides interpretation of Modbus map constants and error constants.

The Modbus map constants affect Name functions that use Name interpretation, such as LJM_eReadName. These Name functions have "Name" in their name and have a const char * Name parameter or const char ** aNames parameter. For each name passed to one of these functions, it is interpreted according to the loaded constants. The Modbus map constants affect the behavior of other functions as well, such as when LJM_OLD_FIRMWARE_CHECK is enabled.

The Error constants affects the LJM_ErrorToString function. The loaded Error constants will be interpreted from an integer error code to a error string. Custom application error codes can be loaded in the 3900-3999 range.

Configuration Parameters

The following parameters are constants defined in the header file LabJackM.h. Each parameter's name is the same as it's value; e.g. LJM_LIBRARY_VERSION is a constant of the string LJM_LIBRARY_VERSION.

Informational parameters

Timeout parameters

Device search parameters

  • LJM_AUTO_IPS - Sets whether or not LJM attempts to use the auto IPs feature. The auto IP feature reads and writes to the LJM_AUTO_IPS_FILE to help open network connections to LabJack devices.
  • LJM_AUTO_IPS_FILE - The file LJM uses for the auto IPs feature.
  • LJM_SPECIFIC_IPS_FILE - The file that specifies Specific IPs, which are IP addresses that are specifically checked for possible LabJack device TCP connections.
  • Other device search parameters

Reconnection parameters

  • LJM_AUTO_RECONNECT_STICKY_CONNECTION - Sets whether or not LJM attempts to reconnect disrupted / disconnected connections according to same connection type as the original handle.
  • LJM_AUTO_RECONNECT_STICKY_SERIAL - Sets whether or not LJM attempts to reconnect disrupted / disconnected connections according to same serial number as the original handle.
  • LJM_AUTO_RECONNECT_WAIT_MS - Determines how long in milliseconds LJM waits between attempts to reconnect when a device has been found to be disconnected.

Packet parameters

  • LJM_ALLOWS_AUTO_MULTIPLE_FEEDBACKS - Whether or not LJM will automatically perform multiple Feedback commands when the desired operations would exceed the maximum packet length.
  • LJM_ALLOWS_AUTO_CONDENSE_ADDRESSES - Whether or not LJM will automatically condense congruent address reads/writes into array reads/writes.
  • LJM_RETRY_ON_TRANSACTION_ID_MISMATCH - Whether or not LJM automatically retries an operation if an LJME_TRANSACTION_ID_ERR occurs.
  • LJM_OLD_FIRMWARE_CHECK - Whether or not LJM will check the Modbus constants file (see LJM_MODBUS_MAP_CONSTANTS_FILE) to make sure the firmware of the current device is compatible with the Modbus register(s) being read from or written to.
  • LJM_USE_TCP_INIT_FOR_T7_WIFI_TCP - Sets/gets whether LJM will use UDP or TCP for T7 WiFi connection initialization when ConnectionType is TCP.
  • LJM_ZERO_LENGTH_ARRAY_MODE - Determines the behavior of array read/write functions when the array size is 0.

Constants file parameters

  • LJM_MODBUS_MAP_CONSTANTS_FILE - The absolute or relative path of the constants file to use for that use the LJM Name functionality.
  • LJM_ERROR_CONSTANTS_FILE - The absolute or relative path of the constants file to use for LJM_ErrorToString.
  • LJM_CONSTANTS_FILE - For setting both LJM_MODBUS_MAP_CONSTANTS_FILE and LJM_ERROR_CONSTANTS_FILE. (Write-only)

Debug logger parameters

  • LJM_DEBUG_LOG_FILE - The absolute or relative path of the file to output log messages to.
  • LJM_DEBUG_LOG_MODE - What conditions will cause LJM to output log messages.
  • LJM_DEBUG_LOG_LEVEL - What priority of log messages are output.
  • LJM_DEBUG_LOG_BUFFER_MAX_SIZE - How many messages the log buffer can hold.
  • LJM_DEBUG_LOG_SLEEP_TIME_MS - How often the logger thread will run.
  • LJM_DEBUG_LOG_FILE_MAX_SIZE - The maximum size of the log file in number of characters.

Stream parameters

Interval-timing parameters:

Altering Configurations

Functions for setting the behavioral configurations of LJM:

Altering Modbus Map Constants or Error Constants

Functions for setting the Modbus and/or Error interpretation maps:

Reading Configurations

Functions for getting the behavioral configurations of LJM:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.