Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulate Acquisition does not include new image file created after first call

For example, I have 5 images in a folder.

I call Simulate Acquisition.

It cycles through all 5 images.

Now If I include 1 more image it does not include this image in the "cycle". I need to reload this step by clicking Main\path\browse button and select any image in the folder and then it cycles through all 6 images.

 

Is there anyway to automatically include new images added to the folder after the step has been created?

 

Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 1 of 12
(3,679 Views)

Hi test man,

 

Are you using Vision Builder for Automated Inspection (VBAI)? If not what program are you using?

 

In VBAI I am not aware of a way to automatically include new images that are added to a folder while running an inspection. You can update the images the way you mentioned or you can close and reopen your inspection and the simulated images should repopulate. I believe this is because the “Simulate Acquisition” step is not made for an automated functionality but made for testing purposes.

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 2 of 12
(3,668 Views)

You could always use a Run LabVIEW step to do this. Having the Simulate Acquisition step enumerate all the image files in the folder each time it runs just in case new files were added since the step  was initialized could greatly reduce the performance if the folder has lots of images. Good suggestion though, we would need another option in addition to cache and cycle through folder that specifies if the step should look for new files each time. When this option is selected, cache and cycle through folder don't apply (it would be assumed you don't want to cache images and you want to cylce through folder). Not sure if this will happen, but something to think about....thanks.

0 Kudos
Message 3 of 12
(3,664 Views)

Yes, I am using VBAI.

I am receiving my images using another software/HW interface which converts LVDS signal to jpg, place that in to a folder and then I need to analyze that using VBAI. Since I will only have few images in that folder performance shouldn't be an issue. I am also planning on deleting older images.

I have to look in to run LabVIEW step to get new image in the folder.

Can you point me how to do this using LabVIEW step?

Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 4 of 12
(3,661 Views)

Here's a sample inspection and VI to illustrate how you could do this. I used an image variable and passed this into the Run LV step so the VI could read the file and update the image variable and then I used the Select Image step to get the image variable into the VBAI script so you can process it. I also added a delete option in the VI so you can delete the previous image when you read the next available image. Make sure to go to the Setup State and initialize the path variable to where your image files will live (to access the Setup State, go to View>>View Complete Inspection and select on the Setup option on the left hand side. I initialized it to c:\Image Folder

 

Hope this helps,

Brad

0 Kudos
Message 5 of 12
(3,658 Views)

Thank you very much for the example. I tried the Vi you attached but it couldn't load IMAQ Cast Image subvi. IMAQ Read File and IMAQ GetFileInfo loaded OK.

Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 6 of 12
(3,654 Views)

Sounds like you don't have Vision Development Module installed with LabVIEW support. You can try this modified version of the VI and let me know how it works for you:

0 Kudos
Message 7 of 12
(3,649 Views)

Thanks again. It looks like this is not going to work for me because I don't have NI Vision license. I get error -1074396157 when castimage VI is called. 

I do have full featured VBAI license. Is there any work around to only make it work with VBAI?

Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 8 of 12
(3,645 Views)

Are you calling this in debug mode (i.e. in the Run LV step, did you check the debug option)? If so, stop using debug mode and then the VI will run in the VBAI process and VBAI's license will allow that VI to be called without license errors. Another possible solution is to just take out that Cast VI/Call Library Node and if your images are 8-bit it will just work. If you're images aren't 8-bit, you could use a vision assistant step to cast the image to RGB, 10-bit before reading from file so when you do read from file, the image will be the right type (you would need to add a Select Image in the Setup State and select the image variable, and then use a Vision Assistant step in the Setup State to cast the image the right type). Doing this in the Setup state will only do this once so you don't take the performance hit of constantly setting the image type.

 

Sorry this is harder than it should be, but hopefully this will work.

 

Hope this helps,

Brad

0 Kudos
Message 9 of 12
(3,640 Views)

Thanks again for your help and suggestions. I got it to work with following method. It is not the best way but surely the easiest way.

 

I keep overwriting same file everytime I grab new image from my HW. This way vision builder loads different image contents from same file name when I call Simulate Acquisition step. This way I only have one file in the image folder which changes everytime I grab new image from my HW.

 


Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 10 of 12
(3,634 Views)