LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Appending Square Waves

Solved!
Go to solution

Hello I am trying to create a VI that will generate a waveform from two 1D arrays, one for the amplitude of a section of the waveform and another for the duration of that section. For example if I were to put in [1,2,3] into the amplitude array and [2,5,10] into the duration array I would receive a graph that had an amplitude of 1 for 2 seconds, then amplitude 2 for 5 seconds, then aplitude 3 for 10 seconds. I am using the Append Waveform function to do this.

 

I have a VI that will generate the amplitudes correctly, but the delays do not work, each amplitude is only true for one second a piece, no matter what i put into the delay array. Does anyone have any suggestions on how to force the amplitudes to be active for a given amount of time?

 

I have attached a picture of my code so far.

 

Thank you

0 Kudos
Message 1 of 4
(2,296 Views)

For the build square wave, you need to alter the Sampling Information.  It is a cluster with Fs (sampling frequency) and #s (number of samples).  You need to calculate how many samples to do given your desired sample rate.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,291 Views)
Solution
Accepted by topic author Nexxus

I think this will do what you are looking for.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
0 Kudos
Message 3 of 4
(2,285 Views)

Thanks a lot that looks great.

0 Kudos
Message 4 of 4
(2,281 Views)