The AddRequest/Go/GetResult method is often the most efficient. As shown above, multiple
ne() call, and the driver might be able to
s already open):
/ePut (Handle, IOType, Channel, Value, x1)
)
N, 3, &dblValue, 0);
e DAC command and
level call, while in the second example using ePut/eGet two low-level
. Examples in the following documentation will use both the add/go/get
t/eGet method, and they are generally interchangeable. See Section 4.3 for
All functions always have 4 common parameters, and some of the
fun
equest/result functions that tells the function
what LabJack it is talking to. The handle is obtained from the OpenLabJack
• IOType – This is an input to all request/result functions that specifies what type
quest/result functions that generally specifies
IOTypes
nnel to specify what is being configured.
at is used to
d in some of the request/result functions, and is
st/result functions,
and is data that is simply passed along with the request, and returned unmodified
ith the request, to
s are
with various different LabJacks with
different development platforms with
epeated with different forms of
. In this
ferred to by their shortest name. For
three variations:
ddRequest(), AddRequestS() or AddRequestSS().
requests can be executed with a single Go() or GoO
optimize the requests into fewer low-level calls. The
other option is to use the eGet or ePut
functions which combine the AddRequest/Go/GetResult into one call. The above code would
hen look like (assuming the U3 i
t
//Set DAC0 to 2.5 volts.
//The general form of the ePut function is:
/
lngErrorcode = ePut (lngHandle, LJ_ioPUT_DAC, 0, 2.50, 0);
//Read AIN3.
//The general form of the eGet function is:
//eGet (Handle, IOType, Channel, *Value, x1
ngErrorcode = eGet (lngHandle, LJ_ioGET_AI
l
the case of the U3, the first example using add/go/get handles both th
In
AIN read in a single low-
commands are used
method and the ePu
more pseudocode examples.
the request and result
ctions have 2 extra parameters:
• Handle – This is an input to all r
function.
of action is being done.
• Channel – This is an input to all re
which channel of I/O is being written/read, although with the config
special constants are passed for cha
•
Value – This is an input or output to all request/result functions th
write or read the value for the item being operated on.
• x1 – This parameter is only use
used when extra information is needed for certain IOTypes.
• UserData – This parameter is only used in some of the reque
by the result. Can be used to store any sort of information w
allow a generic parser to determine what should be done when the result
received.
4.1.1 Function Flexibility
The driver is designed to be flexible so that it can work
different capabilities. It is also designed to work with
different capabilities. For this reason, many of the functions are r
parameters, although their internal functionality remains mostly the same
documentation, a group of functions will often be re
example, a reference to Add or AddRequest most likely refers to any of the
A
45