LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify Sine Pattern or Wave VI so that an offset can be applied to it.

Solved!
Go to solution

Hello,

Is it possible to modify a the Sine pattern.vi or sine wave.VI so that a voltage offset can be applied to them? 

 

If not, any ideas on how to build a VI that outputs an array with a sinusoidal pattern which can then be written to a channel?

 

Suggestions for other options are definitely welcome.

 

Thanks!

0 Kudos
Message 1 of 7
(3,682 Views)
Solution
Accepted by topic author msmartei

Hi msmartei,

you can use an "add" function on the array output. Connect the array output to one input and a constant with your offset value to the other input.

 

Mike

Message 2 of 7
(3,679 Views)

Look here:
Programming >> Waveform >> Analog Waveform >> Waveform Generation >> Sine Waveform.vi

 

You can specify frequency, amplitude, phase, and offset however you would like.

 

As for how to write to a channel:
Measurement I/O >> DAQmx Data Aquistion

 

Those functions should help you do anything you could possibly want to do with DAQ.

Cory K
0 Kudos
Message 3 of 7
(3,678 Views)

 Thanks. Adding the offset worked to an extent but let me modify my question a little bit. I want to be able to have the sine wave oscillate about non-zero values since im writing the voltage to a device with a range of 0 - 10V. 

 

In other words, i want to shift my sine wave such that the center line is not zero and the minimum value allowed would be zero. 

 

Any suggestions?

 

Thanks,

msmartei

0 Kudos
Message 4 of 7
(3,649 Views)

Hi msmartei,

can you show a graph of the result you want?

 

Mike

0 Kudos
Message 5 of 7
(3,646 Views)

That is simple enough.

Just think of it from a mathmatical point of view. If you have:

y = sin(x)

 

and you want to 'offset' the y-value, then you just:

 

y = sin(x) + 'offset'

 

graph.PNG

 

I added a constant of 5, but you can change that to a numeric control if you want

Cory K
Message 6 of 7
(3,639 Views)

The problem is that my offset is not constant: It depends on the
initial values at the piezos, which could be values as small as zero.
So in a case like this, the sine wave is still centered about zero.

 

With some arithmetic manipulation, i figured it out:

Sine plot= (abs(Vi-Vf)/2) (sin x) + (abs(Vi-Vf)/2) + Vi

This ensures that the sine plot is always between Vi and Vf .

 

Thanks for all the suggestions!

- msmartei

 
0 Kudos
Message 7 of 7
(3,600 Views)