Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle large data while acquisition? BNC 2110

I want to acquire data using  BNC 2110, I am writing a software in VB 6. We will use 3 channels. We are supposed to scan about 10000 points before AcquiredData is triggered. in all we will need to scan 10000 * 1000 * 1000 before data is put into a binary fall. Can anybody let me know, how to hande this large number points
0 Kudos
Message 1 of 8
(8,610 Views)

Hi Vjuno,

Welcome to the forums! I have a couple of questions for you. What DAQ card is the BNC 2110 connected to?

I am unsure of what you mean by scan 10000 points before the acquire data is triggered. Do you mean that you want to have a reference trigger with a number of pre-trigger samples or that you want to monitor 10000 points before actually saving any to disk?

Also, did you mean 10,000*1,000*1,000 = 10,000,000,000 points? Or did you mean 3 channels of 10,000 as in 30,000?

Regards, Mallori M.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 2 of 8
(8,602 Views)

Hello Mallorim,

Thank you for your reply.

I am not sure, but that should be PCI-6150, (1MHz) . By 10,000 I meant CWAI.NSCANS = 10,000 .  So 10,000 points will be scanned before they are plotted on the Graph. And this will be done 1000*1000 = 1000,000 times. And I want to scan all these points before they are finally put into the binary file. How do i Handle such a large number of events. I hope I expressed in  a better way now.

Regards

Juno

0 Kudos
Message 3 of 8
(8,596 Views)
I am sorry, I forgot to tell. Those points are for each channel. So 3*10000*1000*1000 points in all.
0 Kudos
Message 4 of 8
(8,595 Views)
.


Message Edited by vjuno on 04-25-2008 07:44 PM
0 Kudos
Message 5 of 8
(8,594 Views)

Hello Vjuno,

 

In order to acquire 10,000,000,000 points you are going to have to be streaming this data to your hard drive as you go.  To do this you'll need to write the data you read to a file each loop iteration.  In general it is a good practice to make your "samples to read" at least 10% of your sample rate in seconds to avoid overflowing buffers, however, depending on your computer you may be able to go faster.  I made an example program in LabVIEW and was able to read 10,000 points at a time from each of 3 analog inputs at 333MHz and write the values to file without overflowing a buffer.  However, even opening a web browser while the code was running was enough to delay the VI long enough for the buffer to overflow.

 

You can use the DAQmx Configure Input Buffer call to increase the buffer size and account for spikes in CPU usage from other processes, and you should also monitor the "Available Samples Per Channel" property to make sure you aren't steadily gaining samples in your buffer.  Since you want to acquire 10 billion samples at 1MHz this acquisition will take several hours; if you're not able to keep the buffer empty then it will become apparent before the end of your acquisition.  By monitoring the samples in the buffer you can tell if you're pulling the samples out fast enough, if you find that this number is steadily increasing then you should either reduce the sample rate or increase the number of samples to read each time you call the DAQmx Read.

 

In my example program I used a write to TDMS (binary) file and a PCI-6251.

 

I hope this helps, and have a good night.

 

Cheers,

Brooks
0 Kudos
Message 6 of 8
(8,563 Views)
Dear Brooks,
Thanks for taking all this pain and replying to my message. Actually I am new to VB preogramming and Data Acquisition. Although now I do have some idea what you said but I still can not figure out what to di with my data. Is it possible, by some chance, that I can find some exxample program. I have a code previously written. In this program, guy puts all the binarycodes (2 dimensioanl for 3 channels) into one element of a one dimensional array (say logpoint(scannum)). When he has collected all the data, he reads this logpoint as a 2 dimensional array (with dimensions of binarycodes) and puts his data into his file. When I tried to implement this thing into my code .. it just shows the error 'Type mismatch' . Can I resolve this issue somehow. And is it really necessary to put data into a file poin by point or is it simehow possible to stack data (when routine aqcuired event occurs)  and then put that into a binary file. And in the later stages, separate points from different channels, when I want to analyse my data.
 
Thank you in anticipation.
0 Kudos
Message 7 of 8
(8,514 Views)

Hi Vjuno,

The DAQ example programs for VB6 can be found at the locations provided in the Knowledge Base 41P6PDLA: NI-DAQmx Examples for Visual Basic 6.0. I definitely recommend taking a look at these example programs to become familiar with how data acquisition is performed in VB6. The example programs you would most be interested in are the Continuous Acquisition with an Internal Clock (Int Clk).

Regards, Mallori M
Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 8 of 8
(8,495 Views)