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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing global references as static

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

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

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

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 5
(2,144 Views)

No I am buffereing the data.

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

how do you buffer the data?  is it cluster with RGB?  Can you upload your VI?

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 4 of 5
(2,137 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 5
(2,134 Views)