LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to define how long to generate a waveform signal?

Hello,
i was looking at the Function Waveform Generation.vi in the examples and i notice that it will generate a signal until the stop button is pressed.  My question is there a way to define how long to run the generated signal so it quits sampling at that point.  Or maybe a way to break up the waveform graph into sections.

thanks,
Louis
0 Kudos
Message 1 of 5
(3,664 Views)

Use the Elapsed Time Express VI from theTiming & Dialog pallette to set the time of your desire to generate the waveform. Connect its 'Time has elapsed' terminal to the conditional terminal of the while loop.

If you want to use this Exp VI as a SubVI, just rt-click it & tell Open Front Panel & proceed as per the instruction it gives.

- Partha ( CLD until Oct 2027 🙂 )
Message 2 of 5
(3,648 Views)
On Nov 2, 4:40 pm, lfoitek <x...@no.email> wrote:
> Hello, i was looking at the Function Waveform Generation.vi in the examples and i notice that it will generate a signal until the stop button is pressed.&nbsp; My question is there a way to define how long to run the generated signal so it quits sampling at that point.&nbsp; Or maybe a way to break up the waveform graph into sections.thanks,Louis
>
> Function Waveform Generation.vi:http://forums.ni.com/attachments/ni/170/282168/1/FunctionWaveform Generation.vi
>
> Function Waveform Generation1.vi:http://forums.ni.com/attachments/ni/170/282168/2/FunctionWaveform Generation1.vi

The Function Waveform Generator.vi runs continuously only because it
is in a while loop. If it was not in a while loop it would only run
for #s, the number of samples set on the front panel.

Howard

Message 3 of 5
(3,556 Views)

Hi Luois,

You can set a timer to generate the waveform for an amount time, as the preview post said a very straight forward way of doing this will be using the “Elapse Express VI” an its “time has elapsed” output in conjunction with an “OR” gate to stop the while loop.

If you don’t want to continuously generate the waveform you can always take a different approach instead of using the “generate waveform function” inside the while loop you can always change the Fs (sampling frequency) and the # of points to generate a periodic waveform with a finite numbers of periods. In this way you can control the size of the waveform.

A very good resource for waveform generation is this article in DevZone: Signal Generation in LabVIEW

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
Message 4 of 5
(3,556 Views)
thank you all for helping figure it out.
0 Kudos
Message 5 of 5
(3,522 Views)