PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I skip the samples in the DAQ read buffer

Hello,

     

     I am using PXI-8106 microcontroller with PXI-6289 DAQs on PXI 1042 chassis. I am acquiring continuously from the DAQ , say 5Khz. I have a timed loop which reads the data acquired every 0.1 seconds (500 samples per read). I would like to know if for some reason the loop finishes late, is there any way that I can skip the next samples so that my acquisition and analysis are always synchronised.

 

Thanks,

kartik 

0 Kudos
Message 1 of 4
(2,754 Views)

My first suggestion would be to use a  real time system to ensure that the issue never even occurs.  If that is not possible you will have to figure out how long the loop takes to run, maybe with two get system time VI's, one at the beggening and one at the end of your loop, from these you can take the time that your loop took to execute.  If this time is over 0.1 seconds you can just dismiss the data that you have already read in with a case structure.

 

Perhaps a producer consumer style architecture could help you as wel, ensuring that your analysis does not bog down your data acquisition loop and letting your computer use its multicoring more efficiently.

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 2 of 4
(2,736 Views)

Hello Doug,

   Thanks for the information. I have a question regarding the "DAQmx Read" property node. Can I use this node to specify the position at which I would like to read from the buffer?  Can I use "Relative to" property node to specify the position?

 

Thanks,

kartik 

0 Kudos
Message 3 of 4
(2,722 Views)

Kartik,

 

You are correct, this will specify the position in the buffer at which to read from.  There is a lot more information available in the LabVIEW help about it as well as how to use it.  Just so you're aware the context help feature of labVIEW is immensely useful for answering questions like this and can be turned on by going to Help»Show Context Help and hovering over the property node.

 

relative to.png

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 4 of 4
(2,712 Views)