« Close

Datasheets and User Guides

App Notes

Software & Driver

 

4.2.3 - eGet() and ePut()

The eGet and ePut functions do AddRequest, Go, and GetResult, in one step.

The eGet versions are designed for inputs or retrieving parameters as they take a pointer to a double where the result is placed, but can be used for outputs if pValue is preset to the desired value. This is also useful for things like StreamRead where a value is input and output (number of scans requested and number of scans returned).

The ePut versions are designed for outputs or setting configuration parameters and will not return anything except the errorcode.

eGetPtr() is a 32-bit and 64-bit pointer-address-safe version of the eGet function where the x1 parameter is a void *. This is required when passing a pointer safely to x1. When passing a non-pointer long value to x1, use the normal version of the function. The declaration for the Ptr version is the same as the normal version except for (…, void *x1).

eGetS() and ePutS() are special versions of these functions where IOType is a string rather than a long. This is useful for passing string constants in languages that cannot include the header file, and is generally used with all IOTypes except put/get config. The string should contain the constant name as indicated in the header file (such as “LJ_ioANALOG_INPUT”). The declarations for the S versions are the same as the normal versions except for (…, const char *pIOType, …).

eGetSS() and ePutSS() are special versions of these functions where IOType and Channel are strings rather than longs. This is useful for passing string constants in languages that cannot include the header file, and is generally only used with the put/get config IOTypes. The strings should contain the constant name as indicated in the header file (such as “LJ_ioPUT_CONFIG” and “LJ_chLOCALID”). The declaration for the SS versions are the same as the normal versions except for (…, const char *pIOType, const char *pChannel, …).

The declaration for ePut is the same as eGet except that Value is not a pointer (…, double Value, …), and thus is an input only.

Declaration:

LJ_ERROR _stdcall eGet (  LJ_HANDLE Handle,
                          long IOType,
                          long Channel,
                          double *pValue,
                          long x1)

Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:

  • Handle – Handle returned by OpenLabJack().
  • IOType – The type of request. See Section 4.3 (UE9, U6, U3) of your device’s user guide.
  • Channel – The channel number of the particular IOType.
  • pValue – Pointer to Value sends and receives data.
  • ×1 – Optional parameter used by some IOTypes.

Outputs:

  • pValue – Pointer to Value sends and receives data.