2.2.4 - eReadAddress | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


2.2.4 - eReadAddress

Read one value, specified by address.


                      int Handle,
                      int Address,
                      int Type,
                      double * Value)


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 register(s) to read. Addresses can be found throughout the device datasheet or in the Modbus Map.
Type [in]
The data type of the value:
Type LJM Constant Name LJM Constant Value
unsigned 16-bit integer LJM_UINT16 0
unsigned 32-bit integer LJM_UINT32 1
signed 32-bit integer LJM_INT32 2
floating point 32-bit LJM_FLOAT32 3
Value [out]
The value returned from the device. The output data type is a double, and will be converted according to the Type input.


LJM errorcodes or 0 for no error.


For an alternate function using a name rather than address, see LJM_eReadName.  More code examples coming soon.


[C/C++] Read the serial number of the device.

int LJMError;
double newValue;

// handle comes from LJM_Open()
LJMError = LJM_eReadAddress(handle, 60028, 1, &newValue);
if (LJMError != LJME_NOERROR) {
    // Deal with error
printf("SERIAL_NUMBER: %f\n", newValue);