Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Labview with U3


  • Please log in to reply
5 replies to this topic

#1 Tavan

Tavan
  • Members
  • 6 posts

Posted 14 April 2010 - 02:39 PM

Hey, I have a U3-LV labjack and want to use it to acquire a signal into labview 2009. I'm not too computer savvy so I don't understand what pseudocode is being used for. I used labview before with an NI board and simply clicked and dragged a VI for data aquisition into my file. I can't seem to figure out which labjack VI to use for this same simple purpose? Am I missing something? Also, I tried to add the VIs from the addons list in my Functions Palette (after copying the Labview71_LJUD folder to the proper location) and it does nothing when I click and drag the VI. No error, no VI shows up, nothing. Am I trying to add VIs from the wrong place? Thanks for any help! Regards, Tavan

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 14 April 2010 - 04:04 PM

I have a U3-LV labjack and want to use it to acquire a signal into labview 2009. I'm not too computer savvy so I don't understand what pseudocode is being used for. I used labview before with an NI board and simply clicked and dragged a VI for data aquisition into my file. I can't seem to figure out which labjack VI to use for this same simple purpose? Am I missing something?

Sounds like you found the readme file in the LabVIEW71_LJUD archive. LabVIEW is a programming language very similar to C, except graphical images are used instead of text. So the pseudocode in Sectoin 4 of the U3 User's Guide is very similar to what you do in LabVIEW.

I suggest you start with examples. The easiest ones to start with are the e-function examples in the "\Examples\U3\Easy Functions" folder.

The easiest way to read an analog input is with the eAIN function. See the LabVIEW example, and read more about the function here:

http://labjack.com/s...rs-guide/4.2.17

http://labjack.com/s...ers-guide/4.3.9


Also, I tried to add the VIs from the addons list in my Functions Palette (after copying the Labview71_LJUD folder to the proper location) and it does nothing when I click and drag the VI. No error, no VI shows up, nothing. Am I trying to add VIs from the wrong place?

So you see the VIs on the function palette, or do you just see question marks. We have found that if you are using the LabVIEW71_LJUD archive you have to rename the folder to LabVIEW_LJUD in addons, then run LabVIEW and see if it loads it properly.

Nonetheless, rather than using the function palette to get LJUD functions, it is more common to just copy code from example VIs or use the balloon on the function palette to select the VI by name.

#3 Tavan

Tavan
  • Members
  • 6 posts

Posted 14 April 2010 - 04:15 PM

Thanks for the fast reply! I found the U3 Stream Simple Example and it seems to stream data from the labjack. My one issue is it is streaming all 4 channels at once. I'm trying to better understand the labview VI, and I see a string constant "LJ_chALL_CHANNELS" that is used to specify the channels streamed. How can I make this constant simply say something like Channel 0? I tried a variety of different things and I get an error every time. Thanks a lot, Tavan

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 14 April 2010 - 04:36 PM

Do you need to use stream mode? Do you want to collect data at perhaps >100 scans/second?

http://labjack.com/s...users-guide/3.1

http://labjack.com/s...users-guide/3.2


The example you mention streams whatever channels are in the array "Scan List (+)". Check out the example "U3 easy Stream Example.vi".

#5 Tavan

Tavan
  • Members
  • 6 posts

Posted 14 April 2010 - 05:11 PM

As far as I'm concerned, about 10 samples per second would suffice. I'm looking at the U3 easy stream example (the examples are named so similarly lol) and I got it to only show one waveform by removing the other elements from the array. So from what I understand from the block diagram Scan List + is an array that dictates which channel is being read from via the labjack. Also the data comes in and is stored in a 2D array which is then plotted on a graph. Does that sound right? I plan to somehow use this information in conjunction with a peak detector to trigger an event when the waveform reaches a certain voltage. In my previous experience with NI-DAQ boards I could just send the acquired signal through a peak detector VI. Now, however, the signal isn't a signal (it's a 2D array? orange wire?) so I'm just curious if I'll still be able to use the old VIs (which I always connected to the NI-DAQ assistant VI and it showed up as blue wires). Or perhaps labview will do the conversion for me? Thanks for all your help I'm starting to get the hang of it!

#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 14 April 2010 - 08:10 PM

At that speed you don't have to use stream mode, so you might just do software timed acquisition. You could start with "U3 EFunction Loop Example.vi", and then remove the calls you don't need (eDAC, eDO, and eDI). Perhaps the peak detector VI you use takes a waveform datatype. This is a special LabVIEW datatype that combines an array of samples with other information about the signal. I am not a LabVIEW Waveform expert, but know that LabVIEW does have utilities to help you make a Waveform out of an Array. I would go to the NI forum for more specific LabVIEW help with datatypes.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users