LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SineWave.vi not outputting oscillating values

I'm trying to use the sinewave.vi to output an array of oscillating values to move a mechanical lever up and down but it is only outputting a single element. I used both a for and a while loop to try and solve the problem but it is still only outputting one value. How should I fix this?

Download All
0 Kudos
Message 1 of 5
(796 Views)

Your attached VIs are too new for me or many others to use... if you could save back versions to 2018 or earlier you'll get a lot more people that can help.

 

Generally though you have two options for making a sine wave:  The plain sine wave VI, or the point-by-point sine wave VI. 

 

It sounds like you might be using the second since you say it only outputs a single point.  If that's the case, then probably the problem is that you're not changing the "Time" input to match the current time (or expected time) that you need a point. 

 

If you're using the plain sine wave VI, then if you only get one sample out you've either set the "samples" input to 1 or you're doing something else odd to only get one sample.

 

Or, if you're using the Simulate Signal express VI, the problem could be in the conversion of the Dynamic Data wire to a usable data type.  If this is the case... stop.  Don't use this VI or any other VI that makes dynamic data wires.

0 Kudos
Message 2 of 5
(757 Views)

Thanks for the advice, I've attached 2018 versions of my code below, I'm using a plain sine wave and I did set it to a single sample value but even when I set it to the default value I'm still only getting one output.

Download All
0 Kudos
Message 3 of 5
(751 Views)

Kyle97330_0-1633652180159.png

I mean, there's two reasons you're only getting one point.  First, you have a "1" wired to the "Samples" input, and even then you're taking either the last (with the FOR loop) or first (with the index array) point of the array output and using that.  

 

I guess I'm not understanding where you would put a full sine wave output in your VI even if you had one, either....

0 Kudos
Message 4 of 5
(744 Views)

Why don't you use the Sine Wave Generator that ships with LabVIEW?  Look in the Waveforms Palette (since a Sinusoid is a (small-W) "waveform", sub-Palette Analog Waveforms, sub-Palette Generation, and let it make a sinusoid for you.  

 

Bob Schor

0 Kudos
Message 5 of 5
(715 Views)