LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

input and ouput out of sync by 16 samples

I am generating a continuous ouput at 1khz at the maximum sample rate of my DAQ NI6363.  I want to read one period at the input but if i capture 2k sample at 2Mhz contunuously I dont get a ful perod and my input measurement results in a "running waveform".  if i instead capture 2016 samples continuously i get a 'standing wave' measurement like i want.  Now that seems fine but the 16 sample offset worries me.  for instance, if i change frequency i will have to find the new offset.  is there a way to get the input and output to sync continuously? 

0 Kudos
Message 1 of 6
(2,260 Views)

You could implement some math to then change the number of samples being read each loop based on the frequency. The DAQmx Read VI has an input for number of samples to read so that is the one you would want to adjust. 

Rob B
FlexRIO Product Manager
0 Kudos
Message 2 of 6
(2,205 Views)

I believe that is what i changed to get them to sync ie i am reading 2016 samples as opposed to the proper 2000 samples expected.  I guess this is a bug in the DAQmx, so your advice is to write a math routine to correct for the error in daqmx timing?  how can i be sure that it is always constant?  without understanding more of the source of the bug I don't know how I can account for it.  what i have seen is that for 1ms of read i need 16 samples (+8us), and for 2 ms i need 32 samples. 

0 Kudos
Message 3 of 6
(2,188 Views)

I don't believe it's a bug in DAQmx, can you post screenshots of your code?

Rob B
FlexRIO Product Manager
0 Kudos
Message 4 of 6
(2,185 Views)

something i just found:

when i request a sample rate on daqmx write above 1MHz the actually rate from daqmx timing.sampleclk.rate is different!?!?! why?

0 Kudos
Message 5 of 6
(2,172 Views)

ok i guess i solved the issue (kinda).  the output clock is divided by a 16 bit integer.  so samples get rounded off unless i use a integer sample rate.  in my case the highest integer rate is 1.25Mhz.  so far this seems to have gotten around the problem.  whats a few hundred killohertz among friends. Thanks for the assistance

0 Kudos
Message 6 of 6
(2,170 Views)