LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If I use IMAQ Create twice with the same image name string, what happens to the

If I use IMAQ Create twice with the same image name string, what happens to the memory previously allocated by IMAQ Create and what happens to the pointer?

Also, is there some hidden documentation somewhere that explains functions in better detail than the Labview help file? The documentation is exceedingly sparse.


global variables make robots angry


0 Kudos
Message 1 of 5
(3,927 Views)
Hey Root,
 
Thanks for contacting NI.  I've done research into your question.  It is never adviseable to name multiple IMAQ create buffers with the same string constant.  It will not throw an error, and the second buffer's pointer will change the memory pointer of the first one.  To demonstrate this, I've made a VI and taken a couple of screenshots.  The first screenshot is of the program with two different IMAQ create buffer names.  Notice you get two different images, as expected. 
 
 
The second screenshot is of the VI with the same name for both buffers. The two images are different, but at the end, the pointer pointing to the first image's location is updated to point to the second image.
 
 
As for documentation.  I find it extremely helpful to press Ctrl+H to bring up the context help in LabVIEW.  From there you can view detailed help about an VI.  You can find more documentation on the IMAQ VI's in the IMAQ helpfile.
 
Hope this helps you out!
 
Take Care,
 


Message Edited by Evan D. on 01-15-2008 10:26 AM
Evan D.
Installer R&D
National Instruments
Download All
0 Kudos
Message 2 of 5
(3,916 Views)
Thank you for your help. It turns out that for ease of programming, I actually want the second declaration to point to the image data in allocated memory that was created by the first declaration, because I am inside a loop and I am effectively 'throwing away' the old image data and acquiring new image data that I plan to write over the old stuff. If I were sane, I would create my image outside of the loop, but unfortunately, I am quite mad. Labview seems to be perfectly happy having a second declaration simply create a pointer that is a replica of the previous pointer without corrupting the data in allocated memory, but I'm not positive that this won't cause some sort of memory problem or other weird thing to happen.
 
What do you think?
 
Thanks again for your help.

global variables make robots angry


0 Kudos
Message 3 of 5
(3,906 Views)
Hey Root,
 
There shouldn't be any issues.  By doing that you're just creating a point that points to a memory allocation.  It just so happens that there already exists another pointer that already does this.  Shouldn't cause you any problems...
 
Take Care,
Evan D.
Installer R&D
National Instruments
0 Kudos
Message 4 of 5
(3,893 Views)
Thank you for your help.

global variables make robots angry


0 Kudos
Message 5 of 5
(3,891 Views)