Skip to main content
Skip table of contents

NameToAddress [LJM User's Guide]

Takes a Modbus register name as input and produces the corresponding Modbus address and type. These two values can serve as input to functions that have Address and Type as input parameters.


const char * Name,
int * Address,
int * Type)


Name [in]

A null-terminated c-string register identifier. This register identifiers can be a register name or a register alternate name.

Address [out]

Output parameter containing the address specified by Name.

Type [out]

Output parameter containing the type specified by Name.


LJM errorcodes or 0 for no error.


If Name is not a valid register identifier, Address will be set to LJM_INVALID_NAME_ADDRESS.


Get the address and type of "AIN3".

int LJMError;
int Address;
int Type;
LJMError = LJM_NameToAddress("AIN3", &Address, &Type);
printf("%d \n", Address);
// prints 6
printf("%d \n", Type);
// prints 3 for LJM_FLOAT32
JavaScript errors detected

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

If this problem persists, please contact our support.