EasyManuals Logo

LabJack U3 User Manual

LabJack U3
120 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #71 background imageLoading...
Page #71 background image
must be for 10 samples. Note that when reading stream data one channel at a time (not using
J_chALL_CHANNELS), the scan list cannot have duplicate channel numbers.
here are three basic wait modes for retrieving the data:
rmine how
it is
Go command will loop
m the device before
n. The time per
ry, but the number of samples read per loop will be the same every
mmand should be called to determine whether all the data was retrieved,
or a timeout condition occurred and none of the data was retrieved.
LJ_swALL_OR_NONE: If available, the Go call will retrieve the amount of data
rwise it will retrieve no data. A Get command should be called to
determine whether all the data was returned or none. This could be a good mode if
execution is desirable, but without the application continuously waiting in
e:
//Must set the number of scans to read each iteration, as the read
//returns the actual number read.
numScans = 1000;
;
owing lines
//get the first sample from each channel.
mputer
//is too slow for some reason the driver might not be able to read
L
T
LJ_swNONE: The Go call will retrieve whatever data is available at the time of the call
up to the requested amount of data. A Get command should be called to dete
many scans were retrieved. This is generally used with a software timed read interval.
The number of samples read per loop iteration will vary, but the time per loop iteration
will be pretty consistent. Since the LabJack clock could be faster than the PC clock,
recommended to request more scans than are expected each time so that the
application does not get behind.
LJ_swSLEEP: This makes the Go command a blocking call. The
until the requested amount of is retrieved or no new data arrives fro
timeout. In this mode, the hardware dictates the timing of the applicatio
loop iteration will va
time. A Get co
requested, othe
hardware timed
SLEEP mode.
The following pseudocode reads data continuously in SLEEP mode as configured abov
//Read data until done.
while(!done)
{
//Read the data. Note that the array passed must be sized to hold
//enough SAMPLES, and the Value passed specifies the number of SCANS
//to read.
eGet(lngHandle, LJ_ioGET_STREAM_DATA, LJ_chALL_CHANNELS, &numScans, array)
actualNumberRead = numScans;
//When all channels are retrieved in a single read, the data
//is interleaved in a 1-dimensional array. The foll
channelA = array[0];
channelB = array[1];
//Retrieve the current U3 backlog. The UD driver retrieves
//stream data from the U3 in the background, but if the co
//the data as fast as the U3 is acquiring it, and thus there will
//be data left over in the U3 buffer.
eGet(lngHandle, LJ_ioGET_CONFIG, LJ_chSTREAM_BACKLOG_COMM, &dblCommBacklog, 0);
}
Finally, stop the stream:
//Stop the stream.
errorcode = ePut (Handle, LJ_ioSTOP_STREAM, 0, 0, 0);
71

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the LabJack U3 and is the answer not in the manual?

LabJack U3 Specifications

General IconGeneral
Analog Outputs2
Analog Output Resolution10 bits
Digital I/O20
Counter/Timers2
InterfaceUSB
Operating Voltage5 V
ManufacturerLabJack Corporation
Analog Inputs16
Analog Input Resolution12-bit
Max Sample Rate50 kHz