LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is this possible in labview 8.2 and the usb daq 6009?

Hi,
 I am wondering if what i am going to do is possible using the usb daq 6009. The aplication is as follows. I need to place a DAQ assistant to run continously in a while loop. Keep it aquiring data and when the signal is above or below a threshold (upper or lower noise levels) to fill an array until the signal goes back to the noise level. When the array has been written with n number of data it should calculate the max min and standard deviation.
 
 I have 4 analog inputs by the way, voltage inputs. the time that takes an object to pass through the sensors is aproximately 2 ms. Is this too fast? I can see the signal when the object passes in the Test window in the DAQ assistant.
 
 I have tried to use the DAQ assistant but it appears that it doesnt have enough time to read the signal, build the array and calculate the statistics it should. So then I created a task from the Measurement and Automation aplication, that consisted of Voltage signals, 500 samples and 1khz. Am i in the right path. I'll upload the VI later. Thanks in advance!
 
 If you think, that my answers are already answered, could you, paste the link in your response please? Thanks!
0 Kudos
Message 1 of 4
(2,762 Views)

The problem with the DAQ assistant is that it does a lot all inside of it.  It creates the task, runs it, then closes it.  That's fine for a one time acquisition, or one that isn't too fast.   But the creating and closing of the task takes time and won't allow it to run very fast in a loop.  So it is best to use the lower level DAQmx functions so that you create the task before the loop, acquire the data inside the loop, and close the task after the loop and program is over.  You may want to look at the producer/consumer architecture so that you can pass the data acquired out of the loop using queues and allow a parallel while loop do the data processing and display.

What is the sensor you are using.  If it passes through the sensors in 2 ms, it sounds like you would only have about 2 samples at 1 kHz where the object is present.  You may need a higher sampling rate.  I guess it all depends on what kind of data you are acquiring and what it means to you.  It looks like the USB-6009 can handle up to 48 kS/sec.  So theoretically you could acquire at a rate of up to 12 kS/sec on each of 4 channels.

It sounds like you are on the right path, so keep experimenting with the setup and working on it.Smiley Happy

0 Kudos
Message 2 of 4
(2,752 Views)
Hey,
 
 I created a VI and followed your tips. I can read the signals and see the graph when a seed passes trough the sensors. The thing is that i can catch the max and min values but the standard deviation is affected because the VI captures noise, and i dont know why.
 
 The sensors are phototransistors. The upper lower limit are adjusted manually. Is this inevitable? Thanks for your help!
0 Kudos
Message 3 of 4
(2,731 Views)

Perhaps you can explain your project in a little more detail and tell us what you are trying to accomplish.  It looks like you are using 4 phototransistors to count seeds?  The seeds pass by 1 at time?  Are there 4 phototransistors to capture a wider area?

If you are counting seeds, why are you worried about the max, min, and std deviation of a voltage?  Why the noise vs. seed boolean switch?  The case structure as a data2 array indicator in the true case, but a value property node that is only rad in the false case.  What is the point behind that?

In your program, you have several controls where you don't use the terminal  (+ and - of gain 0 thru 3).  You use the value property node to read it, but why did you rename the value property nodes to + or - limit 0 thru 3?  This is very confusing and not a good programming practice.  You really should not use value property nodes if you can avoid it.  They are slow and can lead to race conditions.  Local variables are faster, but could still lead to race conditions.  You should use the terminals of controls and indicators, and use shift registers to maintain the values between loop iterations.

PS.  The color choices for your front panel are rather harsh.  It is difficult to read black text on a dark background.Smiley Wink



Message Edited by Ravens Fan on 02-23-2008 04:42 PM
0 Kudos
Message 4 of 4
(2,715 Views)