LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array to Image at Video Rate

Hello,

 

I'm using Labview 2010 with SP1 (32-bit) on Windows 7 (64-bit) with NI-RIO 4.0 and a PCIe-7852R FPGA card. I've written a program for the FPGA card that acquires one line of an image (1024 values) from some custom hardware and puts the line into a target to host DMA FIFO. On the host I have a simple VI that reads all 1024 values from the FIFO. This happens continuously until the user presses a stop button. I'm getting one line, 1024 values, from the FIFO, about every millisecond but will eventually go faster. I would like to collect 1024 lines of 1024 elements per line and display it as an image. Using the obvious straight forward method I would concatenate 1024 arrays from the DMA FIFO and then update an Intensity Graph. Or, I would delete one line in an initialized 1024 by 1024 array, replace it with the line I've just acquired, and update the Intensity Graph after every line. Unfortunately employing either of these methods slows every thing down significantly. I've looked around for information about displaying data at video rate and have only found a couple threads that detail using the IMAQ package, which I have, to display from a camera that is supported by the IMAQ package. Unfortunately I am not using an off the shelf camera. How can I display array data as an image really fast? Any advice would be great.

 

Thanks.

0 Kudos
Message 1 of 5
(2,520 Views)

Hi,

 

I have been looking into this and I think your best bet is to use a preallocated array and replace array subset. I would not recommend concatenating your data because it will dynamically change the size of your array and require reallocation of memory (unnecessary copying of data).

 

You will be limited mainly by the hardware in your host. The faster your RAM and the faster your processor, the faster you will be able to display your data.

 

I hope that helps,

 

0 Kudos
Message 2 of 5
(2,500 Views)

The attached VI (LV2011) does about what you describe (I am using a U16 image as you did not mention what data type you were using).

Writing 1024 lines to the image takes ~65 ms on my dual-core, Windows XP, LV 2011 machine (not top of the line anymore by any stretch of the imagination).

 

ScreenHunter_006.jpg

0 Kudos
Message 3 of 5
(2,495 Views)

Hello X.

 

Thanks for the example program. Any chance you can save it in LV 2010 for me? That would be great and thanks again for putting something together, looks promising.

 

Best,

Ed

0 Kudos
Message 4 of 5
(2,481 Views)

LV 2010 version attached.

0 Kudos
Message 5 of 5
(2,470 Views)