Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make sure counts are not missed?

I'm reading counts off a PCIe6320 counter, in buffered mode, using another counter internalOutput as a clock signal, at 5kHz. My input signal is around 1Mhz, and I'm reading the counter inside a while loop, 1000 samples at a time. Also, inside the while loop, I'm writing the 1000 element vector to a TDMS file.

 

How can I make sure that I'm not missing counts? I tried to find a way to give timestamps to the counter readings using the hardware on the PCIe6320 board, but could not figure out anything from the manual.

 

I'm new to LAbView, and DAQmx. Any other performance suggestions would also come in handy!

Download All
0 Kudos
Message 1 of 4
(6,983 Views)

It is possible that performing operations on your data within the same while loop as the actual acquisision of the data is causing you to miss data points.  I would recommend that you implement a Producer/Consumer architecture in your code to separate the data generation from the data processing and file writes.  Here is a tutorial on Producer/Consumer Loops:

 

Application Design Patterns: Producer/Consumer - Developer Zone
https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...

 

Good luck with your application.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 2 of 4
(6,971 Views)

Thanks very much, I will change my app to use the produced consumer pattern

 

At the hardware level, is there a way of timing the data aquisition with this card (PCIe6320)? i.e. , giving each read from the counter, a time tag which is produced from the board itself, and not by labview.

 

 

0 Kudos
Message 3 of 4
(6,959 Views)

Hi tmeTech,

 

DAQ cards can not output timestamp data.  Here is an article that discusses the accuracy of timestamps returned from DAQmx devices:

 

How Accurate is the Timestamp of the Waveform Returned by my NI-DAQmx Device?
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9Q9SAK&l=en-US

 

 

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 4 of 4
(6,935 Views)