2.6.7 - NameToAddress | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver

Friday May 29th 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 51 of 56 products are in stock. More details.
Supply Chain: Minor impacts. More details.

2.6.7 - NameToAddress

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.


[C/C++] 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


I guess its a typo in the example. Should be "LJM_NameToAddress" (not the plural version)



Yes, that was a typo. It's been fixed now. Thank you for letting us know!