Skip to main content
Skip table of contents

Visual Basic, VB6, VBA for UD - Windows

Visual Basic module and 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.

The examples are VB6 projects and VBA Excel spreadsheets. For VB .NET, we recommend our DotNet archive.

Note to VBA Users: The VB6 examples demonstrate additional UD library usage. VB6 code can be used in VBA, so take a look at the VB6 example as well. The VB6 example's .frm file contains the source code and can be opened in any text editor.

64-bit Compatibility: The PtrSafe keyword is required on function declarations to allow 64-bit compatibility. The PtrSafe keyword is not valid in older VBA versions, so our main example package does not include this keyword on declarations. To add 64-bit compatibility, please replace the LabJackUD_VB.bas file in your example package with the file downloaded by clicking here.

Example Package

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 the device datasheet pseudocode section (U3/U6/UE9).

JavaScript errors detected

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

If this problem persists, please contact our support.