LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with offset sine wave generation

I am trying to generate a sine wave which oscillates +/- 5 around 10V.
In other words, a sine wave which oscillates between +15V and +5V at
a freq. of 1 Hz.

I could generate a sine wave of 5V but couldn't get it to offset
around 10V.

I tried to add a waveform to the sine wave but I didn't know how to
generate a 10V DC waveform.

Also, what is the difference between a generated waveform and a
generated signal????

Many thanks for any help..........Joe
0 Kudos
Message 1 of 6
(7,737 Views)
Joe,

This should be relatively simple. Let me point out something first--you did not state what hardware you are using. Most DAQ cards from National Instruments can only output a maximum of 10V, so you can't output a sine wave of the amplitude you wish.

I'm going to make an assumption regarding your question on how to make a sine wave with an offset. I know how to do it in labview, which is how I'll describe it. If you open the file /examples/daaq/anlogout/anlogout.llb/Function Generator.vi, you can see a control for "offset" and amplitude. In your case, you'd have an amplitude of 5 and an offset of 10 volts (although you really can't do this if your DAQ card can't go above 10V).

Take a look at that VI. It should help.

Mark
0 Kudos
Message 2 of 6
(7,737 Views)
Thanks for the reply Mark.

I'm sorry I wasn't clear here.

I am trying to simulate a signal internally because I am trying to
write a VI to run my fixture, but I don't have the fixture yet to
provide this signal. Since I don't have the signal to work with, I
thought I would simulate it instead. I would then write me VI to run
the fixture acting like this simulated waveform is coming from my
fixture, when in fact it is being generated by LV. When I get the
fixture, I would switch the simulated waveform for the real thing.

I hope that makes sense.

Joe.


markwysong wrote in message news:<5065000000050000006A690000-1012609683000@exchange.ni.com>...
> Joe,
>
> This should be relatively simple. Let me point out something
> first--you did
not state what hardware you are using. Most DAQ cards
> from National Instruments can only output a maximum of 10V, so you
> can't output a sine wave of the amplitude you wish.
>
> I'm going to make an assumption regarding your question on how to make
> a sine wave with an offset. I know how to do it in labview, which is
> how I'll describe it. If you open the file
> dir>/examples/daaq/anlogout/anlogout.llb/Function Generator.vi, you
> can see a control for "offset" and amplitude. In your case, you'd
> have an amplitude of 5 and an offset of 10 volts (although you really
> can't do this if your DAQ card can't go above 10V).
>
> Take a look at that VI. It should help.
>
> Mark
0 Kudos
Message 3 of 6
(7,737 Views)
I have attached a VI that illustrates a couple techniques you could use to create the DC offset. If you use the Sine Waveform.vi, there is an "offset" input where you can specify the value 10. Using the Sine Pattern.vi, I simply fed the output into an addition block and added 10 to it. The addition block is smart enough to add 10 to each element of the array.

The basic difference between a generated waveform and generated signal is the output data type. One outputs a waveform data type while the other is a simple array of numbers.

Matt Kisler
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(7,737 Views)
I have somewhat the same problem. While using the LabVIEW 7.0 express vi "simulate signal" for testing my code, I get the type "Dynamic Data". I wish to use this as a waveform, but haven't found out how to do it yet. Note that this type is different from the output of the "sine pattern" vi.
0 Kudos
Message 5 of 6
(7,737 Views)
Joe;

To offset a signal, all you need to do is to add a constant. In your case, only add 10 to your signal. Your signal should look like:

f(x) = 5sin(x) + 10

An offset is just a vertical shift: f(x) + c, where c is the vertical shift.

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 6 of 6
(7,737 Views)