« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_CONSTANTS_FILE

Summary

LJM_CONSTANTS_FILE is a string-based write-only LJM library configuration which sets the absolute or relative path of an existing file to read Modbus constants and error constants from. It is a shortcut for writing to both LJM_MODBUS_MAP_CONSTANTS_FILE and LJM_ERROR_CONSTANTS_FILE.

The constant LJM_CONSTANTS_FILE can be used interchangeably with the string "LJM_CONSTANTS_FILE".

Default Value

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

Relevant Constants

LJM_MODBUS_MAP_CONSTANTS_FILE and LJM_ERROR_CONSTANTS_FILE

Relevant Functions

To write LJM_CONSTANTS_FILE, use LJM_WriteLibraryConfigStringS or LJM_LoadConfigurationFile.

Setting LJM_CONSTANTS_FILE may affect the output of the following functions:

Example

[C/C++] Set LJM_CONSTANTS_FILE to "alternate_constants.json"

char ErrorString[LJM_MAX_NAME_SIZE];
int LJMError = LJM_WriteLibraryConfigStringS(LJM_CONSTANTS_FILE, "alternate_constants.json");
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_WriteLibraryConfigStringS error: %s\n", ErrorString);
}

For more LJM configurations, see Library Configuration Functions.