Skip to main content
Skip table of contents

LabVIEW for UD - Windows

LabVIEW driver/example VIs for the Windows UD library. The Windows UD library is the high-level Windows library for the LabJack U3, U6 and UE9. For other LabJack devices, go to the Software page.

LabVIEW is one of the most popular programming languages used by our customers. LabVIEW is a graphical programming language, as demonstrated in the code snippet below, but understand that it is still a powerful programming language not a simple software tool.

http://www.ni.com/gettingstarted/labviewbasics/

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 LabJack is talked to through the LabJack UD library.  That means that you will not use measurement & automation explorer, DAQ assistant, or similar NI wizards.

The LabVIEW_LJUD archive is maintained in LabVIEW 7.1, but also available below are the last supported archives for LabVIEW 5 & 6.

The LabVIEW_NXG_LJUD archive is only compatible with LabVIEW NXG and similarly the LabVIEW_LJUD archive is not compatible with LabVIEW NXG.

Our normal software installation package is required by the attached LabVIEW examples.  You can find the latest version of that here.

Getting Started with the U3/U6/UE9 in LabVIEW

  1. Go to the U3/U6/UE9 Quickstart Tutorial and follow the steps to install Windows software and confirm basic operation.

  2. Download the LabVIEW_LJUD or LabVIEW_NXG_LJUD archive below and extract the entire archive. Don't forget to extract the archive before trying to open any of the VIs within.

  3. Read the "readme.txt" file in the archive as it does have some unique information.

  4. In LabVIEW you will be making calls to our UD library.  Read through the UD Library User's Guide for information about the UD library.

  5. Start with the easy function examples.  Open and run "Uxx eAIN Example.vi".

  6. If you need to move beyond the easy functions, start with "Uxx Single IO Example.vi", "Uxx Multiple IO Example.vi", and "Uxx Multiple IO Example Loop.vi".

Package Downloads and Archive Contents

The downloadable zip file "LabVIEW_LJUD-year-month-day.zip" extracts to a single folder called "LabVIEW_LJUD-year-month-day" which contains a few subfolders.  The archive can be stored anywhere, but if you want icons to show up on the LabVIEW function palette (after restarting LabVIEW) place the folder containing the Examples folder, LabJackUD DLL Functions folder, dir.mnu, etc. under ...\national instruments\labview #\vi.lib\addons\ (create the addons folder if it does not exist).  Be sure your folder is named "LabVIEW_LJUD" when added to the LabVIEW addons folder or else the icons may not load properly.

Many people, including us, do not use the palette icons but rather just copy paste from examples and use the "Select a VI..." balloon from the function palette.  In that case you can put the LabVIEW_LJUD folder wherever you want.

We recommend not having more than one copy of the VIs, and not changing these VIs.  If you want to make your own variation of one of the examples, make a copy in a different location and modify that.

If you download new VIs from labjack.com, delete and replace the entire LabVIEW_LJUD folder.

LabVIEW_LJUD-2021-06-04.zip

LabVIEW_LJUD-2020-11-02.zip

LabVIEW_NXG_LJUD_2020_3_31.zip

LabVIEW_LJUD_LV6_20130123.zip (for LV 6 only)

LabVIEW_LJUD_LV5_20070418.zip (for LV 5 only)

UD Library Overview

First read the general overview of the UD library.

The UD driver has a handful of functions, many with the same 4 to 6 parameters.

Functions

The main functions are used to build a list of requests (Add), execute the list (Go), and read the result of each request (Get).  Some functions (e.g. eGet) combine a single add/go/get into one function call.

Parameters

The parameters are described at the bottom of the Overview page.  The meaning of each parameter should be apparent (e.g. Channel is the channel number you are operating on), but when it is not the pseudocode section of the device's datasheet has the extra information needed.

  • Handle:  Always the handle.

  • IOType:  Always the IOType.

  • Channel:  If something besides a channel number the pseudocode section will tell you.

  • Value:  Always the value.

  • X1:  Usually not used, but if used the pseudocode section will tell you.

  • UserData:  Usually not used, but if used the pseudocode section will tell you.

Pseudocode

Device specific pseudocode can be found in the device datasheet pseudocode section (U3/U6/UE9).

Errorcodes

6000 is added to the LabJack errorcodes to shift them into the LabVIEW user range of 5000-9999.  For example, if the open call cannot find the device you requested it will return LabVIEW_LJUD errorcode 7007, which is UD errorcode 1007.  Many errorcodes are listed in the Error Codes section of the UD User's Guide, but every LabVIEW program should use LJUD_ErrorToString.vi to convert the errorcode to a readable string.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.