Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

A question about example code: LL Grab.vi

I am a newbie of machine vision, and I am learning from examples.  
 
Following is the block diagram of the example LL grab.vi
 
 
I don't know why a second IMAQ Create VI is used to create a new image (LLGrab Disp), since using following code:
 
 
 
I can realize same function as the example code.
 
Anyone can tell me the purpose of using image 'LL Grab Disp' here? What's the advantage? Is it necessary?
 
Thanks a lot.
 
Regards,
Derek
 
 
Download All
0 Kudos
Message 1 of 6
(4,036 Views)

Anyone can help me?

Thanks.

0 Kudos
Message 2 of 6
(4,021 Views)
Good afternoon Dejun,
 
It appears that the code works properly without the additional IMAQ Create.VI added in there.  I did not think that it would.  I am looking into why this additional function is necessary and why.  I will post pack as soon as I can find any information out.
 
Respectfully,
0 Kudos
Message 3 of 6
(4,011 Views)
Good morning Dejun,
 
I figured out what was going on with this VI.  When you use the Copy VI, you are supposed to provide it another Image buffer to copy the orginial image into.  Therefore, you are not supposed to use the image buffer that already exists, and is being used in the acquisition.  This happens because the Copy function does not place a lock on the original buffer; so, it is possible for the buffer to be overwritten when you are doing some sort of vision algortihm with the image.  If you provide it with a new image buffer, it will copy the data into this new buffer and the acquisition can overwrite the original buffer.  So, while the VI might be running "properly" now, when you remove the second IMAQ Create, it will lead to problems wh en you have sort of vision application. 
 
I hope this helps!
 
Respectfully,
0 Kudos
Message 4 of 6
(4,000 Views)
Got it, thanks a lot, Jeffrey!
 
Besr,
Dejun
0 Kudos
Message 5 of 6
(3,994 Views)

Hi!

 

1) As far as I understood, "IMAQ Create" creates a pointer to a buffer of zero length. In case of the original buffers, "IMAQ Configure Buffer" resizes this image. How is this with "Copy Acquired Buffer"? Does it do the resizing of the new buffers itsself?

 

2) I am using an old program similar to "LL Grab.vi": in this program, two buffers are allocated (IMAQ Create and IMAQ Configure Buffer are called for both), but then a for-loop with 110 further calls to IMAQ Create result in an array of images, into which "IMAQ Copy Acquired Buffer" writes. How is it possible, that the number of original buffers and that of buffers for the copy function can be different? And how does the "Compy Acquired Buffer" know which original buffer to take a frame from?

 

Thanks, Anna

 

0 Kudos
Message 6 of 6
(3,267 Views)