06-21-2012 02:45 PM
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?
06-22-2012 03:50 PM
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.
06-25-2012 09:18 AM
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.
06-25-2012 09:39 AM
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?
06-25-2012 11:32 AM
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,
06-25-2012 01:28 PM
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.
06-25-2012 02:13 PM
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:
06-25-2012 03:09 PM
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?
06-25-2012 04:16 PM
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,
06-26-2012 02:38 PM
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.