LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dt from a waveform doesn't equal Sample rate

Solved!
Go to solution

I have written the attached VI to take data from two different channels, 1 being a loadcell, and the other being a encoder. I have my timing synced using the Load cell input. The question I have is that at different sampling rates for the program, my dt in my waveform data doesn't change.

 

 

As I understand it the dt of the waveform should coincide with the sampling rate. Am I missing something?

 

 

Thanks in advance for your help

0 Kudos
Message 1 of 13
(3,932 Views)

The dt should be the inverse of the sample rate.  If you're starting the VI then trying to change the sample rate and see dt change, that won't happen.  But you should see different values for dt if you set different sample rates before running the VI.

0 Kudos
Message 2 of 13
(3,908 Views)

Thanks for the response. Yes I have tried stopping the VI changing the Sample rate and then re-starting the VI. This is why I am puzzled as to why my dt stays the same. I am sure it is a coding problem, but I just don't see it.

0 Kudos
Message 3 of 13
(3,894 Views)

Just because you are changing the control value does not mean that the DAQ is sampling at a different rate.  You have to stop the tasks, set their sampling rate, and start back up in order to change how the DAQ is behaving.  The dt is truely what the DAQ is sampling at.


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 4 of 13
(3,886 Views)

crossrulz,

 

Here is what I am doing. I set the sample rate to 1000hz. Run the VI. Stop the VI. Change the Sample rate to 50hz. Run the VI. There is no change in dt. Am I missing something?

0 Kudos
Message 5 of 13
(3,881 Views)

I'm not sure what to tell you.  I made minor modifications to your VI in the setup for the acquisitions.  Since I don't have the same transducers I modified it to just acquire a voltage on the analog input and count edges for the counter task.  The value of dt changes when I change the sample rate between executions of the program.  I ran it on a USB-6212.

0 Kudos
Message 6 of 13
(3,856 Views)

Thanks for trying DAD, I think I may re-post the code in the DAQ forum, as this maybe a hardware issue with the way I am trying to sync the sample clocks. Right now I am still at a loss as to how my dt doesn't change.

0 Kudos
Message 7 of 13
(3,829 Views)

Just to add to my investigation of this issue, I added a sample clock property node just after the DAQmx Timing.vi on the "Master Clock" my analog input channel. This is where my issue starts. I read the sampleClk.rate here and it constantly stays at 1612.9 no matter what I input to the timing VI as a rate.

 

I do stop the VI and change the sample rate and then re-execute the VI to see of it changes.

 

 

Any idea why I can't seem to control the Sample rate with the Timing VI?

0 Kudos
Message 8 of 13
(3,803 Views)

What devices are you using? I am trying to recreate what you are experiencing and want to make it as close to what you are doing as possible.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 9 of 13
(3,782 Views)

I am using a Compact Daq with a 9237 strain module and a 9244 digital module. Thanks for you help

0 Kudos
Message 10 of 13
(3,777 Views)