LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform data length not correct

Solved!
Go to solution

Dear All,

 

I need to develop an application that logs snippets of signal/waveform.
Meaning, for every y period of time, log signal/waveform during an x period of time.

For this end, I have developed an app that goes through the following steps:

  • Simulate and log a sine waveform with a specific dt, t0 and Number of Samples.
  • Compute and Monitor timing to detect multiples of period y.
  • When period y, start logging waveform. Stop when k*y+x period is achieved.
  • repeat until period Number of Samples*dt is achieved.

The problem is that when I check the TDMS Log file, I can clearly see that lengths of the channels (original signal, snippet signal) are not what I was expecting.

Though the Y components of the signals are correct, the waveforms logged yielded channels with lots of additional values..

 

Can you please explain why is that? and Should I log the Y component instead?

The VI is attached.

 

Thanks!

0 Kudos
Message 1 of 3
(2,652 Views)

Correction:

 

Even the Y components do not have the right length. Apparently it's a a programming problem from my side..

0 Kudos
Message 2 of 3
(2,618 Views)
Solution
Accepted by topic author REaymane

Why do you have an input for both Sample Frequency (Fs) and sample time (dt)?  dt = 1/Fs.  Do not give the user a chance to mess that up.  You can get the dt from the waveform coming from the Sine Wave function.

 

Your snipetted waveform calculation just seems weird.  You could just use Array Subset to truncate your data instead of the FOR loop.

 

You can also wire up the waveform to the top of the Build Waveform and then only update the items you need to (it works a lot like Bundle By Name).


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
Message 3 of 3
(2,607 Views)