06-10-2009 10:10 AM
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!
Solved! Go to Solution.
06-10-2009 10:14 AM
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
06-10-2009 10:18 AM
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.
06-11-2009 09:48 AM
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
06-11-2009 09:54 AM
Hi msmartei,
can you show a graph of the result you want?
Mike
06-11-2009 10:13 AM
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'
I added a constant of 5, but you can change that to a numeric control if you want
06-15-2009 06:52 AM
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
09-14-2024 02:53 PM
How would you add a constant like you did on your example given this graph?
09-15-2024 09:53 AM - edited 09-15-2024 09:55 AM
You are asking in a 15 year old thread that is already marked as solved, but to add an offset, just place an "add" after the last multiply and wire a control or constant.
If this is difficult for you, you need to start with the basic learning resources listed at the top of the forum..