05-23-2011 02:54 PM
I'm processing stored images, and need to select an inspection based on image attributes like name and size (length in pixels).
Currently I do all of this within a single inspection, but since I'm inspecting several families of products (differentiated my image name), and several sizes for each family, my inspection algorithm is getting very difficult to manage, so I would like to create a Supervisor application that can determine what product family and size I'm looking at, and then run the corresponding inspection, then do some common data and image logging and loop back to the next image.
I've been playing with the Select Inspection capability within VBAI, but since I'm not using hardware or communications to select the inspection, I can't seem to find a workable solution, ideally, I'd like to go through the setup step once, then jump to the state diagram to to the initial image processing (determine product family and size), then jump to "Select Inspection" and run the corresponding inspection. This is where I'm getting stuck, i.e.., how do I trigger the jump to select inspection from the State Diagram? Some of those I've consulted to date say: You can't do that! Anyone beg to differ?
If I can't jump to Select Inspection from State Diagram, then plan B is to use LabView API and do the supervisor in LabView, is this where I need to go?
Thanks,
Eric
Solved! Go to Solution.
05-23-2011 03:12 PM
If you have the Enable Product Select flag turned on, the Product Select state will automatically be run after the Inspect state goes to an End terminal. You can use a Run LabVIEW VI in the Product Select state to do your logic and pass out the next inspection to load. With Vision Builder AI 2010, this path can be treated as the actual path to the inspection (dynamically select inspection to run next) so you don't have to preconfigure a lookup table of inspections to run with values (this was the previous way of doing it and it didn't allow for dynamically loading new inspections that weren't in the preconfigured table). Not sure how well this works with your system, but using the LabVIEW API is another solution that would give you better control as well. You could even have a Run LV VI step specify the inspection to use on one iteration in the Prioduct Select State and the data/image logging inspection to use afterwards, but the overhead of closing inspections and opening new inspections may make having a separate inspection for the common data/image logging not meet your timing requirements/expectations.
Hope this helps,
Brad
05-25-2011 09:06 AM
Brad,
Thanks. Your suggestions make sense, and I'm trying them out; however, my inspection goe to the various end terminals and stops. I can manually switch over to the Select Insepction step, and run it, but all it does is produce the path to the desired inspection. And yes, I do have the "Enable Inspection Selection" flag set.
I share your concerns about the overhead associated with selecting, loading and running selections rather than an all in one inspection, but maintenace of the all in one inspection is becoming very cumbersome. Ideally, I'd like to have a set of in-line sub-routines, that would be dynamically linked to VBAI on startup, but I think that's too much to hope for in a LabView based program.
Eric
05-25-2011 09:22 AM
Brad,
I spoke to soon, it works, but not from the configuration interface. Once I tried in the inspection interface is worked, but as you pointed out it's fairly slow since it unloads the initial inspection before loading and running the target inspection. I will need long runs of the same product family/size to make this cost effective, and then figure out a way to loop whitin the target inspection until I run up against a new product family/size at which time I want to jump back the main routing and the Inspection Selection.
Thanks for your help,
Eric
05-26-2011 09:07 PM
Hi Eric,
I am not to sure if this would be helpful for your application, but I am wondering if clasifying objects would help to distinguish between different product families or sizes. There are a bunch of examples for VBAI that may also be helpful even though you seem to know the program fairly well, one specifically is called Classify Objects Example. The examples can be found on your computer at this location: C:\Program Files\National Instruments\Vision Builder AI 2010\Examples
I hope this helps!
Kim W.
05-27-2011 02:38 PM
Kim,
Thanks. The classification is straight forward in my case, and part of the common processing I have to do for all images on the front end. The issue is the number of distinct product families and sizes, that in turn lead to a large set of parallel paths in the State Diagram, and each path is nearly identical to it's neighbors.
Just to create a new size I have to duplicate a large number of states (VBAI only allows me to copy and paste one state at a time) and then string them all together again. Would have been nice to use the template function, but to create the templates for the individual paths I would typically have to delete all other states, one state at a time, in a copy of the current instance to create the set of the desired states only. In the current version of VBAI, I can also use the import function to add the saved states to an existing inspection, but again, the overhead of creating the "template" by deleting states in a full inspection one-by-one is just too much.
Eric
05-31-2011 10:07 PM
Hi Eric,
It seems that since you have so many different types of inspections with small differences, I think that the best option moving forward would be to do the classification step within LabVIEW and call the LabVIEW VI in VBAI. I know this option was thrown out previously. Is there something specific holding you back from using this method? Any sort of deployment that may prevent this from being effective? I think that LabVIEW will give you a lot more control over your application and should also speed up the execution time of your program.
You mentioned in your previous post that there are very small differences between each of your inspection items. What are those small differences? Is there text or a specific angle of a part, etc that you may be able to use instead of a template to distinguish between the items?
Kim W.
06-01-2011 09:53 AM
Hi Eric,
I just wanted to clarify the wording of my previous comment regarding the speed of execution time. As mentioned by Brad, this was the one thing that he was uncertain about in relation to opening and closing multiple inspections. I am not sure how much extra time running a LabVIEW VI would add to the system, but I believe that it will definitely give you more control over your application and also save you time from creating a set of templates.
Kim W.