From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-22-2011 11:21 AM
I need to learn something about the way Labview uses global variables.
Background: I am capturing video frames and I want to process the data from a number of video frames all together . What I wanted to do was create a frame buffer that I simply update every time and then read out the whole buffer to process before clearing the buffer and starting again. So I would want to set the bufer as static. I am not sure how to implement this in Labview so I set the buffer as a global variable - a large 3 dimensional array. I then pass the global to subvi's to process them. this works but is giving me problems with running out of memory. I assume there is a lot of copying of the global buffer occuring . I think ideally I would like to pass the reference to the buffer rather than passing the buffer itself but again I am not sure how to do this. Could someone offer some suggestions about how to keep a buffer going without large amounts of copying occuring.
Also with the processing of the buffer I would think there is copying for each process - whats the best way clear the memory that was used ?
I hope that makes sense. Any help in improving memory usage and using references gratefully recieved.
David
03-22-2011 12:34 PM
Are you buffering IMAQ references? Cause if you do, this has no use. It's a reference (a pointer) to a memory location, and that doesn't need to be buffered
03-22-2011 12:36 PM
No I am buffereing the data.
03-22-2011 12:37 PM - edited 03-22-2011 12:38 PM
how do you buffer the data? is it cluster with RGB? Can you upload your VI?
03-22-2011 12:58 PM
Rather than use LabVIEW globals I would recommend that you use an action engine (functional global). You get the same benefit of a single copy of the data with some additional protections to help eliminate race conditions.