LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sinewave y compoent to dbl

Im try to generate a 5hz sinwave @ .1 amplitude, and output the y-component to a dbl. I tried using the Get Y Value.vi and data value out to a dbl indicator, and i get nothing. What am i doing wrong? BTW, this is in Labview 7.1
0 Kudos
Message 1 of 9
(3,462 Views)
Hi.

I am assuming that what you need is an array with all the y-values that make up the sine waveform.  For that, you need to use the "Get Waveform Components" function, found in the "Waveform" subpalette.

I am attaching a VI in LabVIEW version 7.1 for you to take a look at, with the parameters for the sine wave which you indicated.

Hope this helps.

Good luck!

Alejandro
0 Kudos
Message 2 of 9
(3,445 Views)
Well actually, i need the y compoent just at a specific time. Like 5hz .1 amp, @ .1 seconds, i just want ONE  y value like .03 of what ever it would be at that point.

Here's what im trying to use it for, so you can get a better idea of what i need. Also, im working with VI's that were created by someone else so i can't give detailed specifics.
Im controlling a magnet power supply. It uses a 10v input signal and feedback form the magent is on a 0.00-20.00 scale. I control the signal with a knob through labview and that goes out to a PLC which then goes to the magnet supply. I'm trying to "sweep" the magnet back and forth by .1v. I plan was the add the y value to the knob control signal and THEN send that out to the PLC. So, i need a stream of values to add to the knob signal. Hope that helps. Thx for your help so far.
0 Kudos
Message 3 of 9
(3,433 Views)
Hi.

In that case, using "WDT Get  Y Value.vi" is appropriate, you just need to use the "mode" and "index/seconds" inputs to get the datapoint in the waveform that you want.  In the modified VI I am attaching, I put as example wanting to get the datapoint at time 0.448 seconds.  You could also simply use an index array of the Y array obtained in the previous version of the VI...

Hope this helps.

Alejandro
0 Kudos
Message 4 of 9
(3,427 Views)
hmm.. i'm still having a problem with both of those...i can get an index of the array, but i need to get is about 10-20 times per second and automatically add it and send it to the PLC. I found a function in the help index,  called Sine Wave Point-By-Point but i have the base package and its not available in this version. It seems like that one function will do exactly what i need. It just outputs the y value as a integer and is a function of just time.
0 Kudos
Message 5 of 9
(3,419 Views)
^^ ERR : I mean outputs as a double.
0 Kudos
Message 6 of 9
(3,420 Views)
Look at the pallette: Numeric >> Trigonometric >> Sine. That produces sine(x) for an input x. I think that is in the Base package.

Lynn
0 Kudos
Message 7 of 9
(3,413 Views)
Hi.

It sounds like what you need to do is generate a new array of data ONLY when you change the knob, and send that data to the PLC.  You could also automate the sweep, and not even have a knob.  But if you need it to be interactive, then you do need the knob.

I am attaching a version of the VI in which there is no knob, and it automatically goes through several amplitudes of sine waves.  If you do need it to be interactive, then instead of having that array of amplitudes, each iteration you would read the value from the knob.

Hope this helps.

Alejandro
0 Kudos
Message 8 of 9
(3,409 Views)
OMG johnsold  thats it. Alej, thx alot for your help, but i apparently it was much simpler 🙂 I envy your skill though.
0 Kudos
Message 9 of 9
(3,402 Views)