LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Preallocating buffers for data acquisition

Does anyone have an example VI for acquiring data at high rates on a LabVIEW RT system. I want to acquire 20 seconds of data at 100kHz using a 6071E card, so I'm thinking that I have to pre-allocate a 2MB buffer for each channel, is this right? And can I get 8 channels at a time (the card is rated at 1.25 Mega samples/sec
0 Kudos
Message 1 of 5
(2,912 Views)
The card definitely won't have a problem acquiring 8 channels at 100kHz, and there are already plenty of high-speed DAQ examples under \LabVIEW\examples\DAQ\anlogin\. All these examples work on LabVIEW RT systems equipped with DAQ.

You'll need to run a buffered example that uses AI Read. Depending on how much memory your target has and how many channels are acquiring data, you might be able to get away with calling AI Read once. Look at the finite buffered examples.

However, if memory is a problem, you'll need to call AI Read multiple times in a loop from a smaller buffer until your acquisition is complete (see continuous buffered examples). The difficulty with this approach is that you need to put your data somewhere (besides memory) so you can continue
retrieving more data.

For the second approach, there are a couple of options: 1) Store incoming data on disk, writing 512-byte chunks at a time or 2) Write the data to another machine across the network. Take a look at the RT FIFO examples on the web if you go this route.
0 Kudos
Message 2 of 5
(2,912 Views)
Thanks Bob, I thought that there must be some examples somewhere. I'm using an 8146RT, so there is no disk, but I should have enough memory (128MB).
0 Kudos
Message 3 of 5
(2,912 Views)
I should add that although the 8146RT does not have a hard disk, it does have persistent storage in the form of Flash RAM. You may use LabVIEW's File I/O functions to store data to Flash RAM just as you would a hard disk.
0 Kudos
Message 4 of 5
(2,912 Views)
I'll have to look into this. I had assumed that the Flash RAM was used to hold the Real Time OS and Application .exe, with ordinary RAM used for run-time operations.
0 Kudos
Message 5 of 5
(2,912 Views)