Digital Multimeters (DMMs) and Precision DC Sources

cancel
Showing results for 
Search instead for 
Did you mean: 

regular sampling of frequency

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

0 Kudos
Message 1 of 6
(6,083 Views)

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.

Jake H | Product Manager
0 Kudos
Message 2 of 6
(6,067 Views)

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

0 Kudos
Message 3 of 6
(6,053 Views)

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.

0 Kudos
Message 4 of 6
(6,048 Views)

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

0 Kudos
Message 5 of 6
(6,032 Views)

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

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 6
(6,025 Views)