was an output, the errorcode should be evaluated.
None of the Get functions will clear results from the list. The first AddRequest() call subsequent to a Go call will clear the internal
lists of requests and results for a particular device.
When processing raw in/out or stream data requests, the call to a Get function does not actually cause the data arrays to be filled.
The arrays are filled during the Go call (if data is available), and the Get call is used to find out many elements were placed in the
array.
GetResultS() is a special version of the Get function 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 declaration for the S
version of Get is the same as below except for (…, const char *pIOType, …).
GetResultSS() is a special version of the Get function 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 version of Get is the same as below except for (…, const char *pIOType, const char
*pChannel, …).
It is acceptable to pass NULL (or 0) for any pointer that is not required.
Declaration:
LJ_ERROR _stdcall GetResult ( LJ_HANDLE Handle,
long IOType,
long Channel,
double *pValue)
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.
Channel
– The channel number of the particular IOType.
Outputs:
pValue
– A pointer to the result value.
4.2.9 - GetFirstResult() and GetNextResult()
Calling either Go function creates a list of results that matches the list of requests. Use GetFirstResult() and GetNextResult() to
step through the list of results in order. When either function returns LJE_NO_MORE_DATA_AVAILABLE, there are no more items
in the list of results. Items can be read more than once by calling GetFirstResult() to move back to the beginning of the list.
UserData is provided for tracking information, or whatever else the user might need.
None of the Get functions clear results from the list. The first AddRequest() call subsequent to a Go call will clear the internal lists of
requests and results for a particular device.
When processing raw in/out or stream data requests, the call to a Get function does not actually cause the data arrays to be filled.
The arrays are filled during the Go call (if data is available), and the Get call is used to find out many elements were placed in the
array.
It is acceptable to pass NULL (or 0) for any pointer that is not required.
The parameter lists are the same for the GetFirstResult() and GetNextResult() declarations.
Declaration:
LJ_ERROR _stdcall GetFirstResult ( LJ_HANDLE Handle,
long *pIOType,
long *pChannel,
double *pValue,
long *px1,
double *pUserData)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
Handle
– Handle returned by OpenLabJack().
Outputs:
pIOType
– A pointer to the IOType of this item in the list.
pChannel
– A pointer to the channel number of this item in the list.
pValue
– A pointer to the result value.
px1
– A pointer to the x1 parameter of this item in the list.
pUserData
– A pointer to data that is simply passed along with the request, and returned unmodified. Can be used to store
any sort of information with the request, to allow a generic parser to determine what should be done when the results are
received.
4.2.10 - DoubleToStringAddress()
Some special-channels of the config IOType pass IP address (and others) in a double. This function is used to convert the double
into a string in normal decimal-dot or hex-dot notation.
Declaration:
LJ_ERROR _stdcall DoubleToStringAddress ( double Number,
char *pString,
long HexDot)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
Number
– Double precision number to be converted.
pString
– Must pass a buffer for the string of at least 24 bytes.
HexDot
– If not equal to zero, the string will be in hex-dot notation rather than decimal-dot.
Outputs:
pString
– A pointer to the string representation.
4.2.11 - StringToDoubleAddress()
29