LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the final value of a waveform to zero

I'm generating a finite square wave using the function generator VI, I need to set the final value of the generated waveform to zero, as opposed to the +/- wave amplitude as generated by the VI.  What is the easiest method of accomplishing this ?
0 Kudos
Message 1 of 3
(2,581 Views)

Hi Contemporarln,

I have attached an example piece of code which I have written which has the basic functionality that you specified.

The code within the while loop is my basic square wave generator.

The flat squence structure to the left of the while loop simply resets the initial value of the amplitude generated- so that if run multiple times the waveform will not run at the final value of zero.

The code which sets the final value of the waveform and plots it is that outside and to the left of the while loop.

It works by extracting the y-values of the waveform; using them to build a new array of y-values by adding the zero element at the end. This new array of y-values is then wired into the "build waveform" VI along with the old waveform to create the new waveform with the final amplitude of zero. The new waveform is wired into a property node which updates the value on the graph.

Hope this is helpful

Emma R

NIUK & Ireland

 

 

Message 2 of 3
(2,557 Views)
Thanks Emma, that helps a lot.
0 Kudos
Message 3 of 3
(2,544 Views)