C/C++, VC6 for UD - Windows | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


C/C++, VC6 for UD - Windows

C/C++, VC for UD - Windows Overview 

Visual C/C++  examples for the Windows UD library. The Windows UD library is the high-level Windows library/driver for the LabJack U3, U6 and UE9. For other LabJack devices, go to the Software page.

These examples demonstrate static linking (load-time dynamic linking). The UD library dlls are required for the applications to load. To see a few examples using run-time dynamic linking, see the Dev-C examples.

UD Examples Overview (Referencable)

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.


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.


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.


Device specific pseudocode can be found in datasheet section 4.3:

U3: https://labjack.com/support/datasheets/u3/high-level-driver/example-pseudocode
U6: https://labjack.com/support/datasheets/u6/high-level-driver/example-pseudocode
UE9: https://labjack.com/support/datasheets/ue9/high-level-driver/example-pseudocode


AIN resolution in U6 examples updated December 27, 2010

I do not see a "...\labjack\drivers\labjackud.lib" file listed in my drivers folder. Where can I get it? Thanks!

The LabJackUD.lib file should be present in the drivers folder where the LabJackUD software was installed (Typically C:\Program Files\LabJack).  You should be able to point that link to there.  If it's not there, which installer version did you use?

Which example is asking for it in "...\labjack\drivers\labjackud.lib"?

I used v3.25 and it wasn't there. The DevC_LJUD example asks for it. I was able to copy it from that file folder and place it in the driver's folder. Thanks!

I am able to successfully link to the LabJackUD.lib when compiling in 32-bit but cannot get the 64-bit to link properly.

I added /64bit to my link directory but it fails to resolve the symbols.

I am compiling win64 (x64) in Visual Studio 2008 on Windows 7.

Am I the only one having this problem?


How is the .lib being linked?  Do you see it in the list of files with all the other files in the project?  If so you might try removing that reference from the project(right click) and then adding the LabJackUD.lib copy from the 64-bit folder.

I couldn't find anything wrong with my setup in Visual Studio.

I uninstalled the Labjack drivers then downloaded the latest and installed them.

That solved the problem.  I must have gotten an older version at some point.



I want to designate the interval variable(about 10ms) between mesurements(AIN)

I look over sample code vc6 but... I can not find sample code related to designating interval time....

And I don't know how can I do this...

So... Can I take some advice or documents??

I use visual studio2010..and the language is c or c++

Read about command-response and stream mode in Section 3.0 of the U3 User's Guide.  In command-response mode you make a loop in your software that reads a scan and use a 10ms software timer for the loop.  In stream mode you tell the hardware the scan interval and the hardware times the scans.  For your interval of 10ms you are in the area where either mode might be best, so I suggest you start with command-response mode.

nihir's picture

How do I upload my C/C++ code on the labjack device (I have a LabJack U3-LV) ??

labjack support's picture

You can't load code onto the U3. Rather all code runs on the host computer:  If you need standalone operation, check out the T-series: