Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ timing

I am having a problem with the sampling rate of my daq program.  The hardware setup is a pressure transducer with 10 ms response time outputing 1 - 6 V.  The output is connected to the ai0 of my multifunction daq board (ni daqpad-6016, up to 200 kS/s).  In the program I have a while loop setup with daq assistant acquiring data using 1 sample on demand, and no trigger settings.  The output of the daq goes to a "convert dynamic data into array" follow by the build array function, the other input of the "build array" function is from the "elapsed time" function.  The output from the "build array" function goes to another "build array" function with the other input connected to the shift register on the left and the output of this "build array" function to the shift register on the right.  The array is initialized to 0 by array constant on the left register.  In the loop, I also have the wait function inside the loop set to 10 ms such that every second would yield approximately 100 samples.  Outside of the loop is a "write to spreadsheet" function.
 
The problem that I'm experiencing is that the timing info on the spreadsheet is every 100 ms instead of 10 ms. 
 
I have attempted serveral troubleshooting schemes that failed. 
1)  I have eliminated the graph and some scaling functions in the loop, failed
2)  I have changed the wait function input constant to 1 ms,  failed
3)  I have changed the wait function input constant to 200 ms, this worked to sample the data at 200 ms interval but not what i need
4)  I have changed the daq assistant to acquire 100 samples at 100 samples / second and replaced the while loop with a sequencial loop and that worked because the spreadsheet reads out 100 samples in approxmately 1 sec. 
 
Computer spec:
I have a dell with pen 4 and 512 mb of ram.
 
Greatly appreciated if anyone can help
 
 
0 Kudos
Message 1 of 2
(3,023 Views)
BDCat,
 
Thank you for contacting National Instruments.
 
Instead of using the "Elapsed Time" Express VI (which tells when a specified time has passed), I recommend using the "Tick Count (ms)" function to give the tick count from the processor. You can put this in your loop and use a shift register to subtract the current tick count from the last tick count in the loop.
 
Keep in mind that to take one sample each iteration of the loop is software-timed data acquisition, which is non-deterministic because it is not running on a real-time operating system. To ensure that samples are exactly 10ms apart, use hardware-timed data acquisition.
 
Try using one of the DAQmx examples from the example finder such as Acq&Graph Voltage-Int Clk.vi.
--
Michael P
National Instruments
0 Kudos
Message 2 of 2
(3,000 Views)