2.2.7 - eWriteAddressString | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver

Saturday/Sunday, March 28th&29th, 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 55/56 products in stock.
Supply Chain: Some disruptions.

2.2.7 - eWriteAddressString

Writes a string, specified by address.


LJM_ERROR_RETURN LJM_eWriteAddressString(
                      int Handle, 
                      int Address, 
                      const char * String) 


Handle [in]
A device handle. The handle is a connection ID for an active device. Generate a handle with LJM_Open or LJM_OpenS.
Address [in]
The address that specifies the Modbus string-type register to write.  Addresses can be found throughout the device datasheet or in the Modbus Map.
String [in]
The string to write. Must null-terminate at size LJM_STRING_ALLOCATION_SIZE (50) or less.  


LJM errorcodes or 0 for no error.


See also LJM_eReadAddressString. This is a convenience function that uses LJM_eAddresses. Only for use with Modbus registers listed as type LJM_STRING (98). More code examples coming soon.


[C/C++] Change the device name.

int LJMError;
char newName[LJM_STRING_ALLOCATION_SIZE] = "My Favorite DAQ Device";

// handle comes from LJM_Open()
LJMError = LJM_eWriteAddressString(handle, 60500, newName);
if (LJMError != LJME_NOERROR) {
    // Deal with error