cancel
Showing results for 
Search instead for 
Did you mean: 

dt from a waveform doesn't equal Sample rate

SOLVED
griff32
Member
Solved!

dt from a waveform doesn't equal Sample rate

Message contains an attachment

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

12 REPLIES 12
DAD
Member
Member

Re: dt from a waveform doesn't equal Sample rate

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.

griff32
Member

Re: dt from a waveform doesn't equal Sample rate

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.

crossrulz
Knight of NI

Re: dt from a waveform doesn't equal Sample rate

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.



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
griff32
Member

Re: dt from a waveform doesn't equal Sample rate

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?

DAD
Member
Member

Re: dt from a waveform doesn't equal Sample rate

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.

griff32
Member

Re: dt from a waveform doesn't equal Sample rate

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.

griff32
Member

Re: dt from a waveform doesn't equal Sample rate

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?

Cameron-T
Member

Re: dt from a waveform doesn't equal Sample rate

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
griff32
Member

Re: dt from a waveform doesn't equal Sample rate

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