Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6251 real time data acquisition!

Hi Neil!
I am trying to acquire data in real time usign PCI 6251. My code is attached. I'll be grateful if anyone can help me to modify my code or give some suggestions how to make the acquisiton in real time e.g using double buffer etc.
I tried to attach the vi but did not work. I tried to get help from NI customer service but so far all in vain. However you can see this vi at the follwing url. Actually I got this code from Kevin , I guess he is application Engineer with NI and modified it according to my need. You can just have a look on this code and let me know how can I make it work in real time. Basically I want data acquisition in real time using PCI 6251.
I'll appreciate your help.
code can be found at
the file is
M-series 3 synced clocks_modified.vi (173 kb)
 at page 3.

Thanks
AM
0 Kudos
Message 1 of 2
(2,704 Views)
AM,

Thank you for creating a new thread.  When you say you would like real-time data acquisition I am not completely sure what you mean.  Are you saying that the updates on the screen are not close enough to real-time or are you moving the VI to a target running a real-time OS?  I assume you are just wanting the acquisition to display on the screen closer to real-time.  There are several ways to shorten the time between the actual acquisition and when the data is displayed on the screen.  The easiest is to decrease the number of analog samples you read on each iteration of the loop.  However, you must read enough samples to remove the samples from the AI buffer fast enough to prevent a buffer overflow.  Basically when data is acquired from a DAQ board it takes the following path.

1.  ADC (where it is actually acquired)
2.  Onboard FIFO on the DAQ board
3.  DMA Channel across bus
4.  Computer memory
5.  DAQmx Read reads from Computer memory into LabVIEW memory where it is displayed.

Up to step 4 the process is mainly controlled by the hardware without much OS interaction.  However, from step 4 on it is controlled by software.  Since Windows is not a real-time environment, you will not be able to achieve actual real-time performance.  However, you by reducing the wait time and the number of samples you read per loop interation you may be able to get closer to real-time performance.  Currently if you run the VI with default settings you are acquiring 10000 samples each iteration.  This can take a very long time if you are running at a slow rate of acquisition.  The loop cannot iterate until all 10,000 samples are acquired and moved into LabVIEW memory or a timeout occurs.

Hopefully this will give you some pointers on how you might be able to improve the application.

Let me know if you have any additional questions.

Regards,

Neil S.
Applications Engineer
National Instruments



0 Kudos
Message 2 of 2
(2,687 Views)