06-28-2011 12:32 AM
I would like take samples of the votage frequency output from my generator and write this data to a file. I currently have the sine waveform signal coming in and can determine the fundamental frequency using the "extract single tone" VI but I want this to refresh every few cycles and append to file so I can see if there is any disturbances in the supply frequency. Being a first time user of Labview I am not sure if there is an easy way of doing this using current VI's or if I need to build a loop of some kind...
Any advice would be appreciated.
Thanks
06-29-2011 10:53 AM
If you want the Extract Single Tone VI to refresh every so often and write to file, I would recommend putting the VI in a while loop and using a Wait timer. You can build the frequency values into an array and then use the Write to Measurement File VI and create a True constant for the Append terminal. You can also show the array on a Waveform Chart if you don't need to write it to a file.
07-01-2011 01:53 AM
Thanks for your response Jake. I tried using the while loop and also a timed loop. I am receiving my data stream from an oscilloscope through the ethernet port. If I place a loop around the entire VI the loop is taking around 600ms to execute which is not fast enough for what I need. I am looking to take frequency samples every 40ms. I have also tried to feed the data stream into a timed loop with a 40ms rate but am not sure if this is giving me the correct output because when I look at the excel file the calculated frequency dose not change.
If you could offer any advise on how I have structured my program I would be greatful
thanks
Trent
07-01-2011 09:34 AM - edited 07-01-2011 09:39 AM
Your VI does not make any sense. You take a single reading from the scope and then repeatedly write the same information to a file. If you want to take many readings, you have to put the scope read function inside a loop. Doesn't that make more sense?
Also, be aware that you are going to be limited by how fast the scope can acquire and transfer a complete waveform (10000 points). A 40ms rate may be unrealistic with your hardware. First place just the scope read inside the timed loop and see how fast that runs.
p.s. Your question has nothing to do with NI's multimeters. In the future, post to the Instrument Control thread.
07-05-2011 12:53 AM
The loop is too slow with the scope read inside.
I can aquire 10000 points of data for the waveform in 100ms and write this data to file. Does labview have the capability to read this data file 4000 lines at a time performing an off line analysis on each block of data?
Trent
07-06-2011 02:27 AM
No chance to put a PC near that generator?
Here is a version for a soundcard I wrote some time ago and just tried it with 40ms update.... just plug a coil into the mic input (add two antiparrallel diodes for protection 😉 ) or abuse the headphone and have a try
Better would be a producer consumer architecture ...