« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.6.9 - AddressToType

Retrieves the data type for a given Modbus register address.

Syntax

LJM_ERROR_RETURN LJM_AddressToType(
                      int Address, 
                      int * Type)

Parameters

Address [in]
A Modbus address.
Type [out]
Output parameter containing the data type of Address.

Returns

LJM errorcodes or 0 for no error.

Remarks

Convenience function to programmatically discover the type of a Modbus address. Most people can simply look in the Modbus Map.

Examples

[C/C++] Get the type of Modbus address 6, which is AIN3.

int LJMError;
int Type;
LJMError = LJM_AddressesToTypes(6, &Type);
printf("%d \n", Type);
// 3 for LJM_FLOAT32