LabVIEW for UD - Windows | LabJack
 
« Close

Datasheets and User Guides

App Notes

Software & Driver

 

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 Section 4.1 of the U3/U6/UE9 User's Guide for an overview of the UD library.
  5. Refer to Section 4.2 of the U3/U6/UE9 User's Guide for documentation of the parameters of each function.
  6. Refer to Section 4.3 of the U3/U6/UE9 User's Guide for documentation of what values to pass.
  7. Start with the easy function examples.  Open and run "Uxx eAIN Example.vi".
  8. 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".

 

Overview

The UD library has easy functions to read or write a single analog or digital I/O.  For basic applications these might be all that are needed:

  • eAIN() - read 1 analog input, "Uxx eAIN Example.vi".  Refer to "Configuration", "Analog Inputs", and "Easy Functions" pseudocode sections in the U3/U6/UE9 User's Guide.
  • eDAC() - write 1 analog output, "Uxx eDAC Example.vi".  Refer to "Analog Outputs" and "Easy Functions" pseudocode sections in the U3/U6/UE9 User's Guide.
  • eDI() - read 1 digital input, "Uxx eDI Example.vi".  Refer to "Digital I/O" and "Easy Functions" pseudocode sections in the U3/U6/UE9 User's Guide.
  • eDO() - write 1 digital output, "Uxx eDO Example.vi".  Refer to "Digital I/O" and "Easy Functions" pseudocode sections in the U3/U6/UE9 User's Guide.

For more flexible and efficient operation you would move on to the basic Add-Go-Get technique described in Section 4.1 of the U3/U6/UE9 User's Guide.  With this technique you give the drive a list of requests to perform (Add), execute the list (Go), and read the results of each request (Get).  There are a few different functions to perform different variations of Add-Go-Get, but they all have the same parameters:

  • Handle – This is an input to all request/result functions that tells the function what LabJack it is talking to.  The handle is obtained from the OpenLabJack function.
  • IOType – This is an input to all request/result functions that specifies what type of action is being done.
  • Channel – This is an input to all request/result functions.  If you are operating on a singular input or output (e.g. IOType = LJ_ioGET_AIN), then Channel specifies which channel of I/O is being written/read.  If you are operating on something not specific to a particular channel (e.g. serial number), then IOType is usually LJ_ioGET_CONFIG or LJ_ioPUT_CONFIG and a special channel constant (e.g. LJ_chSERIAL_NUMBER) is used to specify what you are operating on.
  • Value – This is an input or output to all request/result functions that is used to write or read the value for the item being operated on.
  • x1 – This parameter is only used in some of the request/result functions, and is used when extra information is needed for certain IOTypes.

 

Where are the Functions and Parameters Defined?

Refer to Section 4.2 of the U3/U6/UE9 User's Guide for documentation of the parameters of each function.

 

What Values are Passed for Different Parameters?

The pseudocode sections, 4.3 of the U3/U6/UE9 User's Guide, are a good spot to look for this information.  Also see the applicable Hardware Description section in the U3/U6/UE9 User's Guide.

 

52 comments

sandy reynaldy's picture

regards

I am a student and a beginner in this tool, please I can't connect LJ U6 to the io instrument on Labview.
 

LabJack Support's picture

The easiest way to get started is with our LabVIEW examples: https://labjack.com/support/software/examples/ud/labview

Pages