LabVIEW Examples (Windows UD)
LabVIEW driver/example VIs for the Windows UD driver (U3, U6, UE9). LabVIEW is one of, if not the, most popular programming languages used by our customers. Refer to the "readme.txt" file in the zip for more information. The archive is maintained in LabVIEW 6.0, and the normal archive below is recommended for LabVIEW 6-8. LabVIEW 2009+ will not open LabVIEW 6 VIs, so an archive mass-compiled to 7.1 is also available.
Note that using a LabJack in LabVIEW is not identical to using NI hardware in LabVIEW. The NI hardware is talked to through the NI-DAQ driver, while the U3/U6/UE9 is talked to through the LabJack UD driver. That means that you will not use measurement & automation explorer, DAQ assistant, or similar NI wizards.
Steps to get started using the U3/U6/UE9 in LabVIEW:
- Do the normal quickstart steps (install the driver and test in LJControlPanel). This is found at labjack.com/support/uxx.
- Read through Section 4 of the U3/U6/UE9 User's Guide.
- Download the LabVIEW_LJUD archive and read the "readme.txt" contained within.
- Please, read the "readme.txt" file in the archive. We never read readme files either, but this one answers the most common questions we get when people are first starting.
- Start with the easy function examples. Open and run "Uxx eAIN Example.vi"
May 24, 2011
DAQ Devices
- UD Series (U3, U6, UE9)
- U3
- U6
- UE9
- Software Options
- Installers and Drivers
- Applications
- Programming (UD)
- Windows Example Code
- DAQFactory Examples (Windows UD)
- DASYLab
- Delphi (Windows UD)
- Dev-C (C, C++, Windows UD)
- DotNet (.NET)
- FlowStone
- Igor Pro Windows
- Java (Windows UD)
- LabVIEW
- LabWindows/CVI (Windows UD)
- MATLAB Examples (Windows UD)
- PureBasic (Windows UD)
- VC6 (Windows UD)
- VEE (Windows UD)
- Visual Basic (VB6, VBA, Windows UD)
- LabJackPython
- LabVIEW Mac OS X Linux
- Windows Example Code
- DAQFactory
- CloudDot
- U12
- T Series
All Support Guides
Search
Shopping Cart
Testimonials
-
Just wanted to thank you guys for making it so easy to use Matlab to control our U3-HV DAQ device. [...] You guys certainly made interfacing with Matlab a pain free experience.
—Ashwin, Duke University

Comments
#1
New LJ user, lost in startup under LabVIEW 2010 !
I see some simple example code to output or input a single bit, but I'm looking to output a set of a few bits to EIO, say EIO0-EIO2, and read back the state of EIO3.
RawOutIn.vi looked useful, as I want to perform that operation on a series of outputs, but I don't understand many of the parameters.
Channel Offset seemed clear, and I figured I'd need an offset of 8 to get from FIO0 to EIO0. Unfortunately, anything other than 0 or 1 throws an error in LJUD_eGetS.vi.
I also clearly need to set I/O bit functions (all digital is fine) and direction. I inserted PinConfigReset.vi and PinConfig.vi, the latter with all 0 and False, except leaving Timer/Counter Pin Offset at 4. That didn't seem to have any effect. Setting the 4 to 0 made things worse, throwing the error in LJUD_GetNextResutl.vi with any Channel Offset. With those two vi's, I still am missing direction bits, aren't I?
A little help or direction here would be greatly appreciated!
Dave
#2
Which device do you have? Make sure you read through Section 4 of the User's Guide first. You want to understand what to do with the UD driver in general, and then do that general thing in your programming language (LabVIEW in this case).
You could just make a few calls to eDO and a call to eDI, but if you want the fastest time you want to combine your operations in a single Add/Go/Get block. I suggest you do a request with iotype LJ_ioPUT_DIGITAL_PORT to set the state and direction of EIO0-EIO3 and then do a request with iotype LJ_ioGET_DIGITAL_BIT to read and set the direction of EIO4. See Section 4.3.5 of the U3 User's Guide.
To see an add/go/get block in LabVIEW, check out "U3 Multiple IO Example.vi".
#3
Sorry, I see I missed that - I'm using a U3-HV.
Yes, I wanted to move the data faster than successive calls to eDO/eDI, and also to have multiple output bits change state on the same operation.
I did read 4.3.5; that's the part where I was floundering, figuring out all the parameters, and mentally mapping them to the provided vi's.
I don't have LV on this machine (checking in from home), but will dig into this further tomorrow. If I understand your suggestion correctly, LJ_ioPUT_DIGITAL_PORT and LJ_ioGET_DIGITAL_BIT accomplish setting direction and data transfer in one step. That sounds perfect, with a loop sequencing my output state data and building the input data Boolean array. Now, I believe those are iotype enums, and I need to feed them to the I/O function vi(s). Is it correct that I load them into an Add, then execute the Go and Get functions, for each pass through the loop?
Thanks for the help!
Dave
#4
Put-digital-port lets you update a block of outputs in one command, and the comment in 4.3.5 notes that in addition to setting the states it also sets the directions to output. Get-digital-bit reads 1 digital input and sets its direction to input at the same time (basically the same as eDI, except that you use it in an add/go/get block).
If you find you need to get into further detail, I suggest starting a topic on our forum.
#5
Hi!
Is it possible to have an example about multichannel in differential entrance for U6 device?. For stream mode, preferable.
That's because I need to meassure 6 diff channels at ~200 S/s. Thank you.
#6
Check out "U6 easy Stream.vi". The sub-vi "easy stream start U6.vi" has an unwired input for negative channels that you can use to get differential. Or just look at "U6 easy Stream Full.vi".
Also check out the Differential Analog Inputs App Note as many common mistakes are made with differential inputs, and most signals (besides those from bridge circuits) are naturally single-ended and should be acquired that way.
#7
Thanks,
But I don't know how to use exactly the Scan List (-), If I want to use single-ended then I should put in 199, but if I want to use differential then I should put pairs? like 0 for Scan List (+) and 0 for Scan List (-), or , 0 for Scan List (+) and 1 for Scan List (-) then 2 for Scan List (+) and 3 for Scan List (-) ...
Thank you.
#8
ScanList- should have a matching element for each element in ScanList+. These element pairs are the positive and negative channel. From Section 2.6 and Section 2.6.1, differential channels are even/odd pairs, so you should use 0/1, 2/3, ..., and so on.
#9
The setup for external triggering on UE in Labview.
#10
See "UE9 Externally Triggered Stream Example.vi".
#11
There's no helping comment on each of the VI. It would have been helpful if you just writted one or two sentences for each VI to introduce their use.
#12
Good suggestion, and we will work on adding more comments. Many of the more complicated programs, such as stream examples, do already have comments on the front panel and/or wiring diagram. Many of the simpler examples are explained by Section 4 of the applicable device user's guide, but I agree that more comments are good.
#13
I think what Etienne means, is that in each VI you can place a comment in File->VI Properties and then selecting Documentation. The reason this is more desirable (and also standard practice) than comments on the front panel or block diagram is that when you mouse over a sub-VI in an application (and many other places), the comments you place in this section will show up in the context help. This is much more useful and accessible than a comment on the front panel or block diagram.
I'd second the suggestion, not just for more comments, but for the comments to be placed in the documentation section as described above.
In either case, two thumbs up for having LabVIEW example at all! Thanks!