Skip to main content
Skip table of contents

eWriteAddressString [LJM User's Guide]

Write to a device register that expects a string, specified by address.

Syntax

LJM_ERROR_RETURN LJM_eWriteAddressString(

int Handle,

int Address,

const char * String)

Parameters

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.

Returns

LJM errorcodes or 0 for no error.

Remarks

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).

Examples

Change the device name.

C
int LJMError;
// LJM_STRING_ALLOCATION_SIZE is 50
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
}
JavaScript errors detected

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

If this problem persists, please contact our support.