LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic question on plotting sine waves

Hi,

I'm really new to Labview and programming so I'm having a lot of difficulties with the program. I'm trying to plot a sine wave using the "Sine Wave.vi" function and it just plots a straight line. I have no idea why it does this and would like to understand what is happening.

 

I know I can use sine wave generator to plot the sine wave but I'm having trouble with arrays/building arrays and I have no idea how to do it this way.  

 

Any help at all would be appreciated!

Attached is my VI.

0 Kudos
Message 1 of 5
(4,786 Views)

Your frequency specification is wrong and the build array is unnecessary. Have you looked at the example that the detailed link in the context help points you to?

 

Have you tried the Sine Waveform function or even the Express Simulate Signal? Neither requires you to create any array and your comment is a mystery to me.

Message 2 of 5
(4,769 Views)

I've tried both but my biggest problem with labview is that I have little idea about arrays and how to use them correctly hence that unecessary build block. I chose to make a sine wave like this because my professor gave us a waveform in a text file and we have to read it in, plot it and then do a fourier transform. While I can do this with Sine Waveforum  I don't know how to import a sine wave and then plot it if that makes sense.

 

Sorry for the really basic questions and my lack of understanding.

0 Kudos
Message 3 of 5
(4,762 Views)

For reading the file, the simplest way is probably with the Read From Speadsheet function. There have been numerous questions on this subject. It will return a 1D array that you can wire directly to a graph but you will have to first extract the timing information (the dt) in order to do an FFT. Try reading the file and just create an indicator. You may have to experiment with the separator and transpose options. If you get stuck, attach what you have written and the file.

Message 4 of 5
(4,752 Views)

Hi,

 

You say you have little idea about arrays and how to use them. A good place to start is with some of the FREE tutorials available on the NI web site, lots of good stuff that will help you understand!

 

Alan

0 Kudos
Message 5 of 5
(4,726 Views)