LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQ continuous logging while measuring frequency

Apologies in advance because I'm a seriously novice labview user.

 

I am using a labview script to do a number of things, one of which is to acquire 7 ADC channels from an NI-USB 6218.  6 of the channels are from a force-torque sensor and I'd like to log them continuously.  1 is from a tachometer which is still read as an analog signal even though it's a pulse.  The script was written by some students and some things about it didn't work, one of which was the tachometer measurement.  I was able to get it to work by using the single tone information VI, but I have to collect an adequately-long waveform to identify the frequency.  Meanwhile, I'm trying to continuously measure and log FT sensor data on the other channels.  Is there a clean way to either

 

1) acquire a large number of FT and tach samples and then sort the FT waveform data out, manipulate it (needs to be scaled and offset individually), and store all of the samples along with their waveform time data to a file

 

2) acquire a single set of samples at a time and collect the tach data to a waveform to be analyzed for frequency

 

I like option 2 better because the force logging works well with single-sample mode.  I hope I might be able to get suggestions without the code because I'd rather find out how to do it right than try to make this mess work.  Thank you

0 Kudos
Message 1 of 4
(2,181 Views)

I like the attitude expressed in the last line of your code.

 

If you have not done so, please work through the on-line tutorials to get started with LV.

 

"Script" has a particular meaning in LV (an advanced topic) and it is unlikely that the program written by the students used LV scripting.  The appropriate terminology is "program" or "VI" with VI meaning Virtual Instrument. 

 

Now to your specific questions.

 

There are examples of both continuous and finite data acquisition.  Start with those.  They may not be exactly what you need but they can show you how the concepts work.  This is part of the "clean way."

 

You can acquire the 7 channels as a 2D array. I would not attempt to do two separate acquisitions. It is possible that your DAQ device might not allow it. Use Index Array or Array Subset to extract the tachometer data from the rest of the data.  Acquiring continuously and storing the data in a buffer, possibly in a shift register, until you have a suitable "chunk" to write to file may be a good approach for you.

 

Depending on the frequency range of the tachometer signal it might be easier to measure/calculate the period and take the reciprocal to get the frequency.

 

Also consider the Producer/Consumer (Data) Design Pattern which comes with LV.  This puts the data acquisition in one while loop and the analysis and file saving in a parallel loop.

 

Lynn

 

Message 2 of 4
(2,176 Views)

Hello, maxvdh!

 

No need to apologize - we love helping new LabVIEW users!

 

Lynn is right on the money, it would be an excellent idea to check out some of the online tutorials we offer, found by searching at http://www.ni.com/tutorials/.

 

In addition, LabVIEW includes a number of examples to help get you started. Within LabVIEW, simply go to "Help>>Find Examples..." For your specific task, take a look under Hardware Input and Output>>DAQmx>>Analog Measurements. Here you'll find examples for measuring Force, Torque, and other analog signals. 

 

As you may be aware, there are also a number of community examples available online, found by searching (you guessed it) http://www.ni.com/examples/. These are more specific examples posted by members of the NI community, and you can often find just what you're looking for. 

 

As you look through these, feel free to ask us specific questions. For now, it looks like you have a great place to start.

Will Hilzinger | Switch Product Support Engineer | National Instruments
0 Kudos
Message 3 of 4
(2,133 Views)

Thank you both for your suggestions.  I will go through the examples.  For the moment I'm measuring individual samples in a for loop and creating a new waveform every 100 samples for frequency measurement, which works great.  I will look at examples for the producer/consumer architecture - that sounds like the right strategy.  

0 Kudos
Message 4 of 4
(2,129 Views)