Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain frequency from a sine graph

Hi All,

 

I'm able to procure data from serial port and was able to plot the Sinewave, where the sampled input signal is a voltage signal at 50Hz.

Is it possible to count the waveforms in a sec and update the freq tab?

 

I tried using the available blocks, found few type cast errors resolved them, but not effectively.

Can any one help how to convert string data to dynamic data so that I can use the ready blocks for THD and frequency.

 

Thanks,

Raz

 

 

 

 

Download All
0 Kudos
Message 1 of 6
(3,993 Views)

Extract Single Tone Information is the vi you are looking for. You can directly connect it to your signal.

greetings from the Netherlands
0 Kudos
Message 2 of 6
(3,987 Views)

Hi

 

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

Look at your data: You read up to 4 bytes from the serial port and convert them to an integer then to a flotaing point scalar. Then you convert that (the hard way) to an array containing only one element. The array is then converted to the Dynamic Data Type (but still contains only one data point) which is fed to the Tone Measurements VI.

 

So what do you expect the frequency of one data point to be?

 

You need to accumulate the data from multiple reads and look at that.  Either pull the data from the chart history or accumulate it in a shift register.

 

Lynn

0 Kudos
Message 4 of 6
(3,965 Views)

Thank you John, your data flow approach was helpful,

 

I'm new to labview, trying out ways to work on labview, I'm sampling 50Hz voltage signal at 8000 samples/sec(for 1cycle 160 samples)

and transmitting it through serialport at a baudrate of 115200. What methodology should I follow to extract data properly

so as to display a sine wave as well as anayse frequency from it.

 

All your inputs will be helpful.

 

 

-raz

 

 

0 Kudos
Message 5 of 6
(3,951 Views)

At the moment yo save the data in the graph, but you also can build up the data in an array and use that for analyzing the frequency.

You also need timing information. Check what single tone vi needs by reading the extended help rigorously.

greetings from the Netherlands
0 Kudos
Message 6 of 6
(3,946 Views)