LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the fastest way to record and write image data?

Hello,

I am new to labview and am using the IMAQ software package to record and write data from a CCD camera to the hard drive. The end goal is a program that records and saves as much data as possible as quickly as possible, for experiments lasting on the scale of days. I have been experimenting with the snap, grab, and sequence methods of recording. To save the image data I was told by NI customer support that TDMS streaming would be the fastest method. I have also been experimenting with the TDMS VIs, however I have found the IMAQ Write File 2 VI to be faster in practice. Am I doing something wrong with the TDMS file structure? Is there a more efficient way to convert IMAQ image data to a dataform that can be written as TDMS? I am posting two of my programs to provide a clearer example of what I am trying to do. The first takes a snap of the image and appends it to a TDMS file. The second is the fastest I have found so far and uses Grab to record the images and the IMAQ Write File VI to save them. 

Thanks

0 Kudos
Message 1 of 3
(4,100 Views)

Hi

 

For me it is no surprise that the second VI is faster then the first one, the reason is you can not compare this two VI with each other.

In the first VI you work with TDMS files, in the second with png files. That would be much faster, because TDMS files need a lot of diskspace.

Second point, why do you open, write and close for eacht iteration of the for loop a TDMS file in your first VI? That need really a lot of resources, so it coudn´t be fats as well.

 

Save your converted pictures in one array, an after the acquisition you can save it in one TDMS file. When you need for each picture a TDMS file you have to know that this need some time to do this.

So now for the architecture of your first VI, please look to the LL Sequence.vifrom the examples (C:\Program Files\National Instruments\LabVIEW 8.6\examples\IMAQ\IMAQ Low Level.llb\LL Sequence.vi), there you can see how an acquisition of a number of images have been to do.

 

When you like it really fast, you make a producer/consumer architecture (see examples in LabVIEW for that).

So in the first whileloop you acquire the images, write into a queue and in the second, parallel whileloop you read the queue and save the images. (see attachment)

 

Hope that helps

 

Kind regards

 

Beat

NI Germany

Download All
0 Kudos
Message 2 of 3
(4,058 Views)

Thanks for the advice Pixar. I tried to follow it and came up with the attached application. It seems to be working well and running quite quickly, however not I cant find a way to organize the structure the way I want. I would like to be able to start and stop the recording/writing with a button so I could start the program, let it collect data indefinitely, then come back and stop it and analyze the data. Im not sure how to accomplish this with the speedy sequence structure because it seems to require that I know the number of frames to generate before I start the experiment. Does anyone know of a way to do this with sequence, or another suitable structure? Speed is the main requirement of the program, its recording data from a line scan camera that can in theory record19k frames per second. 

 

Thanks, 

Charlie

 

 

0 Kudos
Message 3 of 3
(3,970 Views)