Skip to Navigation

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:

  1. Do the normal quickstart steps (install the driver and test in LJControlPanel).  This is found at labjack.com/support/uxx.
  2. Read through Section 4 of the U3/U6/UE9 User's Guide.
  3. Download the LabVIEW_LJUD archive, extract the entire archive, and read the "readme.txt" contained within.
  4. 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.
  5. Start with the easy function examples.  Open and run "Uxx eAIN Example.vi"

 

May 24, 2011

 

tags:

Comments

#1

Is there a way to have the U3 to work with Labview 5 ?

Labview 5 is the last version of Labview that allows user  to create executables with embedded Runtime engine.

This IMHO makes a huge difference if you need to distribute or sell your application.

#2

We don't support LV5, but it is possible.  If you have LV6, you can revert our archive, or I actually found a version of the LabVIEW_LJUD archive from April 2007 that was reverted to LV5.  To get it post on our forum or email support@labjack.com.

#3

what is the procedure for calling eDO & eDI VIs in labview program?

#4

See the documentation for eDI and eDO in Sections 4.2.19 and 4.2.20 of the U3 User's Guide, see the easy function pseudocode in Section 4.3.9, and see the applicable LabVIEW examples.

#5

can you send us the link for the following VIs: open_labjackS, error to string??

#6

All sub-VIs are in the archive.  Before you try to open any VIs, make sure you first have unzipped the entire archive.  Don't just click on files within the zipped archive.

I suggest you start by going through steps 1-5 above.

#7

I am using labjack U3 for interfacing level sensor with labview. To start programming i tried to run eDI.vi from the examles u have given. To execute the program which function should replce the questionmark block in the block diagram ??

#8

I question mark sub-vi in a block diagram suggests that it did not find the sub-vi.  When you opened the VI did it give a message about locating a sub-vi?

Start with "U3 eDI Example.vi".  Does this open and run properly?

Perhaps you are talking about the function palette?  Post #2 of forum topic 4875 mentions something about this, and also see the function palette notes in the readme.txt file in the LabVIEW_LJUD archive downloaded from above.

#9

yes,the message to open the sub vi is appearing . what type of sub vi should i must open to run the program for analog input.?

#10

Again, I suggest you start by going through steps 1-5 above.  The example in step 5 is the easiest way to read an analog input.  It is an example of how to use the eAIN function.

#11

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

#12

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".

#13

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

#14

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.

#15

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.

#16

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.

#17

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.

 

#18

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.

#19

The setup for external triggering on UE in Labview.

#20

See "UE9 Externally Triggered Stream Example.vi".

#21

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. 

#22

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.

#23

 

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!