long *aIOTypes,
long *aChannels,
double *aValues,
long *ax1s,
long *aRequestErrors,
long *GoError,
long *aResultErrors)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
Handle
– Handle returned by OpenLabJack().
NumRequests
– This is the number of requests that will be made, and thus the number of results that will be returned. All the
arrays must be initialized with at least this many elements.
aIOTypes
– An array which is the list of IOTypes.
aChannels
– An array which is the list of Channels.
aValues
– An array which is the list of Values to write.
ax1s
– An array which is the list of x1s.
Outputs:
aValues
– An array which is the list of Values read.
aRequestErrors
– An array which is the list of errorcodes from each AddRequest().
GoError
– The errorcode returned by the GoOne() call.
aResultErrors
– An array which is the list of errorcodes from each GetResult().
4.2.5 - AddRequest()
Adds an item to the list of requests to be performed on the next call to Go() or GoOne().
When AddRequest() is called on a particular Handle after a Go() or GoOne() call, all data from previous requests is lost and cannot
be retrieved by any of the Get functions until a Go function is called again. This is on a device by device basis, so you can call
AddRequest() with a different handle while a device is busy performing its I/O.
AddRequest() only clears the request and result lists on the device handle passed and only for the current thread. For example, if a
request is added to each of two different devices, and then a new request is added to the first device but not the second, a call to
Go() will cause the first device to execute the new request and the second device to execute the original request.
In general, the execution order of a list of requests in a single Go call is unpredictable, except that all configuration type requests
are executed before acquisition and output type requests.
AddRequestS() is a special version of the Add 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 Add is the same as below except for (…, const char *pIOType, …).
AddRequestSS() is a special version of the Add 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 Add is the same as below except for (…, const char *pIOType, const char
*pChannel, …).
Declaration:
LJ_ERROR _stdcall AddRequest ( LJ_HANDLE Handle,
long IOType,
long Channel,
double Value,
long x1,
double UserData)
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.
Value
– Value passed for output channels.
x1
– Optional parameter used by some IOTypes.
UserData
– Data that is simply passed along with the request, and returned unmodified by GetFirstResult() or
GetNextResult(). 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.
Outputs:
None
4.2.6 - Go()
After using AddRequest() to make an internal list of requests to perform, call Go() to actually perform the requests. This function
causes all requests on all open LabJacks to be performed. After calling Go(), call GetResult() or similar to retrieve any returned
data or errors.
33
Summary of Contents for UE9
Page 84: ...84 ...