LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting Data on Graph

Hi there, I have the following question that I would like to ask.

 

I am currently receiving binary data from my ADC chip that I connected to labview via NI data accquirsation card. For every 10 bits of binary data, I have programmed labview to convert it to a decimal number. Therefore, I will constantly be having a set of decimal number in labview.

 

Now I will like to plot this set of decimal number on a graph. Since I am using Analog to Digital chip to convert my Sine Wave, eventually what I am suppose to see on the labview graph, would be something like a dotted Sine Wave, which is made up of the decimal number that I had converted.

 

My question is how can I build my program so that this set of decimal number can be plotted in a Amplitude and Time Domain on  the Graph?

 

Ultimately, what I need to achieve is actually to do a FFT on this constructed waveform so that I can get the frequency of the waveform.

 

Therefore, is there is a way to just supply the set of decimal number that I get and do FFT straight away so that I can retrieve the frequency of the waveform and bypass the step of plotting it onto a graph? 

 

Hope you can understand what I am trying to say.

 

 

Thanks and Regards

Keith Tan

 

 

 

0 Kudos
Message 1 of 5
(3,167 Views)

Do you mean that you wired sime digital I/O lines to your ADC chip?

If it's an I²C interface, that would be CLK and Serial Data Line.

 

In your code you should have an array that retain all the 10 bits data words.

Watch out for the position of the bytes (little endian, big endian)

There is somewhere a paper regarding numerical represention on the LV site 🙂

 

Once you have the correct array, just wire it to a graph control and your wave form should appear.

Tou can try that using a loop that generate random numbers, connect the output of that loop to a graph control.

 

 

Regarding the FFT there are a lot of examples regarding FFT, one will definetly do the job you want.

 

 

But why do you make it so hard on yourself?

Can't you just connect you're anlogue signal to an analogue input?

Then use the DAQmx vi's to do some simple acquisition.

0 Kudos
Message 2 of 5
(3,165 Views)

Hi there,  yea I managed to do up the getting the 10bits data part.

 

I tried to pump the set of 10bits words into a graph, it's only show one point. I believe I will need the help of a shift register, but I dont know how to make it work.

 

As for the FFT, I did try to pump in this set of 10bits data words into FFT function, unfortunately, it cant work. That's where I start to ponder where can I actually pump in data directly into FFT function or do I need to convert it to a waveform type then pump into FFT. In that case, how do i convert the set of data i have into a waveform type and finally pump into FFT function?

 

Thanks for all the help and fast response, really appreciate it.

 

Keith Tan

0 Kudos
Message 3 of 5
(3,133 Views)

It's not clear what you're exactly doing. You said "I tried to pump the set of 10bits words into a graph". What does this mean? How are you converting the 10 bits to a number? What numeric representation are you using? Integer or floating point? Also, are you using a waveform graph, or a waveform chart? If you feed one number to a graph, then you will only see one point. A chart, on the other hand, has a history, so it will plot that point, plus all the others that have been fed before (up to the history length).

 

Can you show us some code?

 

UPDATE: Hold on. This seems to be the same question as this one. Please stick to one thread so everyone can see what's already been covered and suggested, and folks don't waste their time answering something that's already been answered. 

Message Edited by smercurio_fc on 06-11-2009 08:20 PM
0 Kudos
Message 4 of 5
(3,129 Views)

Oh yea, I forgot to mention that, very sorry about that. Please refer to the this post instead. http://forums.ni.com/ni/board/message?board.id=170&thread.id=414857 .

 

 Sorry about that! I will post in the previous thread.

0 Kudos
Message 5 of 5
(3,124 Views)