LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using folder for VBAI

Hi guys,

 

Does anyone know if it's possible to acquire images in Vision Builder from a folder rather than actually selecting the file.

I m asking because the Images in the folder I m going to use are going to change, and I wonder if rather than changing everytime manually the images from the "acquire Image" step I ccould more simply acquire a folder and then which ever image is in this folder, the isnpection will run through anyway.

 

Or where is the source of the analysed Image in LabView from an inspection migrated from VBAI (my whole project is rather on LabView than VBAI, but the inspection I am using on LabView to analyse the Image is from VBAI)

 

Thanks for your help

 

Xavier Baines

0 Kudos
Message 1 of 10
(2,782 Views)

You could do it with a Run LabVIEW step as shown in the attached example...Just press the top run button in VBAI 2012 to see how the Run LabVIEW step can cycle through a folder of images.

 

We hope to add this feature in the next release of VBAI (later this year).

 

Hope this helps and thanks for the suggestion.

Brad

0 Kudos
Message 2 of 10
(2,773 Views)

Dear Brad,

 

This seems great, but the reason I ask, is that when I migrate the inspection to LabView, I can't figure out on the VI where the image is selected. I can't find it's origin, otherwise I would have just changed it right away to a folder and cycle through this folder even if the images are changed.

 

Can you convert an inspection to LabView? because otherwise using a simple "acquiring image" step in VBAI and converting it to a VI, maybe you could help me locate the origin of the source of the image in LabView and from there insert the previous coding you posted, and from there I should be able to run the VI acquiring the images from the folder I would like.

 

Best regards and thanks for your help Brad

0 Kudos
Message 3 of 10
(2,769 Views)

The reason I was hesitant to help with how to disect the generated code is because it's complicated. What are you trying to do? If you are just doing image processing, you could use Vision Assistant with a simple VI (similar to the one I posted to cycle trhough a folder of images with files that change). Are you actually doing more complex I/O, or communication in your VBAI inspection? If so, another option is to use the LabVIEW API to launch a local VBAI Engine, open the inspection, and you can set a shared image variable from LV before you run each iteration of your inspection. One big advatage to using the API is that if you need to change your inspection, you do it in VBAI with the normal inspection, and your LV code will use the updated inspection the next time you open it (make sure to close ther inspection from VBAI before trying to use it in LV with the API). If you need to make changes and you have migrated your inspection to LabVIEW, you will need to migrate again, and this could result in having to rewrite your customizations to reintegrate it back into your LabVIEW application.

 

If none of these sound appealing and you really want to use the generated LabVIEW code, I would recommend you put the Simulate Acquisition step in it's own state, so it's easy to replace the generated code for that state with a simple VI (similar to what I sent you), that outputs the next dynamic image from a folder and puts it in the shift register with the image and the subsequent states will use that image for their processing.

 

Hope this helps,

Brad

0 Kudos
Message 4 of 10
(2,764 Views)
Dear Brad, I have already thought about using Vision Assistant, but isn t it the same, you have to acquire one particular image, and once you have migrated it to labview, it will only treat this image?
Ideally, I am trying to do all this so that I don t have to use VBAI anymore actually.
I ll have a look at labview API tomorrow then.
Basically, I have my LabView VI, acquiring images from my Camera, and I am using it to save images to a folder, and I then wanted to use the migrated inspection from VBAI to LabView to load these saved images and process them and extrapollate the results under a spreadsheet form.
I can upload my VI tomorrow, although there are drivers included in it that you probably won t have, but these are just to acquire image, focus function... So not really crucial to understand the VI.
Do you know when the function of selecting a folder rather than a file in VBAI will be available as you were previously mentioning?

Thanks for your help
0 Kudos
Message 5 of 10
(2,762 Views)

So it sounds like using the Express VI for Vision Assistant (which makes it easy to modify your algorithm by double clickin on the VI), and the Express VI for Vision Acquisition (which allows you to do a Snap and pass in the image path, and you can use a VI similar to what I sent to get the latest image path for a dynamic folder), would work well for you. Check out the Express VIs on the last row/column of the vision palette. Using VBAI for what you want to do is way overly complicated.

 

Hope this helps,

Brad 

0 Kudos
Message 6 of 10
(2,759 Views)
Dear Brad,
I don t have access to all that right now as I am home, but I shall look tomorrow, and let you know.
Thanks very much for your help on this, and with a bit of luck getting where I wanted to 🙂
0 Kudos
Message 7 of 10
(2,757 Views)
Dear Brad, I have tried the file you have previously sent me. Unfortunatly, the VI, is not openable ad it is LV2012, and VBAI requires LV2011. After having re written the VI, under LV2011(because there was a problem to just save it under a different version). Anyhow, once the VI rewritten with LV 2011, I tried to use the VBAI file for opening folder, but when it acquires a path, of a VI, it says one of the VI or SubVI is broken. My VI is running very well though. Would you have any suggestions on how to solve this issue?
0 Kudos
Message 8 of 10
(2,741 Views)

Maybe I wasn't clear. Use a simple VI like the attached to just scan for new images in the folder and use Vision Assistant Express VI to process the images.

0 Kudos
Message 9 of 10
(2,732 Views)
Ah ok
0 Kudos
Message 10 of 10
(2,726 Views)