« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_OLD_FIRMWARE_CHECK

Summary

LJM_OLD_FIRMWARE_CHECK is a numerical readable-writable LJM library configuration which sets whether or not LJM will check the Modbus constants file to make sure the firmware of the current device is compatible with the Modbus register(s) being read from or written to.

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

Values

0 - false/disabled

1 - true/enabled (default)

It is recommended to not disable LJM_OLD_FIRMWARE_CHECK.

Details

For all Easy functions and for LJM_MBFBComm, each address being read from or written to that also exists in the Modbus constants file, LJM will compare the firmware version of the current device against the minimum firmware required for that address. If the device does not have adequate firmware, the function will abort before communicating with the device and return the error LJME_OLD_FIRMWARE (1307).

Relevant Functions

To read, use LJM_ReadLibraryConfigS.

To write, use LJM_WriteLibraryConfigS or LJM_LoadConfigurationFile.

Affects the error checking of all Easy functions and also LJM_MBFBComm.

Example

[C/C++] Read LJM_OLD_FIRMWARE_CHECK, then disable it.

char ErrorString[LJM_MAX_NAME_SIZE];
double value;

int LJMError = LJM_ReadLibraryConfigS(LJM_OLD_FIRMWARE_CHECK, &value);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_ReadLibraryConfigS error: %s\n", ErrorString);
}
printf("The default for LJM_OLD_FIRMWARE_CHECK is %.00f\n", value);

value = 0;
printf("Setting LJM_OLD_FIRMWARE_CHECK to %.00f\n", value);
LJMError = LJM_WriteLibraryConfigS(LJM_OLD_FIRMWARE_CHECK, value);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_WriteLibraryConfigS error: %s\n", ErrorString);
}

 

For more LJM configurations, see Library Configuration Functions.