Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

4 camera inspection

Good Day!
I am currently working on an inspection system using 4 cameras, LabVIEW 8 and Vision BUilder AI 2.6. The 4 cameras are used to obtain a portion of the product being inspected. 4 scripts are then written in VBAI 2.6 for each of the acquired image. These scripts were then migrated to LabVIEW and then renamed. Using a modified sample VI, they are then incorporated in just a single VI. The inspection is working properly now with each of the four images (portions) of the product being inspected is shown on the front panel.
 
Here are now my questions: 
1. Being migrated from 4 diffrent scripts I have four inspection results. Ideally even if just one of these scripts gives a FAIL decision the product fails the inspection. Is there a way to add the results together so that I will just get one PASS/FAIL decision for all 4 scripts? I've already experimented with some Boolean addition using "local variable" but I can't make it work.
 
2. The image acquired for the inspection is at random and sometimes it takes a very long time before it finally acquires all 4 images. I tried generating a sequential number so that the channel 0, then 1, then 2, and then lastly 3 would be acquired. However, what happened is that it did acquire in sequence but it was shown one after the other on the first  window only of the front panel. Is there a solution to this. By the way i also tried using stacked sequence, the result is similar to the one I mentioned, it used only the first window.
 
3. And lastly, is there a way in which the VI can be made to give out a summary like in VBAI. Meaning the time it took to inspect, the amount of products inspected, how many Passed/Failed and also if possible the percentage.   
 
I know that I may be asking too much but if anyone could help me with these problems, I'd be very grateful.  
 
Joel Tucit
 
P.S.
 
I attached the VIs
0 Kudos
Message 1 of 7
(4,047 Views)
Joel,
 
    As far as your questions;
1. In your VI it looks like all of your inspection results separately report to the front panel in each of the four cases.  You can send out the results of those inspections to the parent case structure by right clicking on each of the indicators on the block diagram and creating a local variable, putting them in the parent structure, wiring them to an AND boolean compound arithmetic (as you did in the parent structure's True case with OR) operator and then to an indicator.  If any of them fail then it will report a fail, but if all succeed then it will report success.
 
2. Looking at your VI, it looks like it should be able to display the four acquired images in the four separate windows.  I can't test it because I don't have the VI's within your innermost case structure, but it appears correct.  This may be the VI that you used as a template, but try running the example program in LabVIEW called LL Scan Multiple Channels.vi.  If that works, look for differences in the image routing in each VI.  If it doesn't work we can look at it from another direction.
 
3. There are no premade VIs that print out a report of all of those metrics together, but it's easy to program each one individually.  For instance, in the Timing palette, you can use Get Date/Time before and after the part of the program you want to time and subtract to get the time it took to run.  For the rest you can use simple programming to set it up.
 
Let me know if I assumed incorrectly as to what you were asking at all, and if you have more questions.
 
-Allison S.
Applications Engineering
-Allison S.
Calibration Services
Product Support Engineer
Message 2 of 7
(4,011 Views)

Allison S.,

Thanks for your suggestions. Regarding number 1,  I already did that but what happened is that for each of the windows even if that particular portion is supposed to PASS it showed FAIL.  I forgot to indicate that I would also want to know what portion of the product caused it to FAIL. Anyway, it is no longer a problem, It was resolved by using property nodes and wiring them to an AND boolean compound arithmetic. Same principle as you've stated only instead of using local variable, property nodes were used.

Regarding number 2, I'll look for it, try it out, then report back what happened. As for number 3, can you suggest any templates or sample VIs that may help me in this? I guess I forgot to say I'm a newbie in LabVIEW and rely mostly on studying examples and tutorials and asking in forums.

Thanks again, and hope people like you won't get tired of helping out.

 

Joel   

 

0 Kudos
Message 3 of 7
(4,003 Views)
Joel,
 
    Well I'm glad to hear that you got the first one figured out, let me know if you have anymore questions on that.  As far as the third, you mentioned several metrics you wanted measured (time it took to inspect, the amount of products inspected, how many Passed/Failed and the percentage).  The last three are fairly simple to get the information -- just count up the number of pass/fails and calculate a percentage.  If you want to write these to a document go to the Functions Palette >> File I/O and use the various file write VI's -- write to spreadsheet file is a good, simple one.
    As far as the time it takes to inspect, that was what I was referring to in my last post.  If you go to the Functions Palette >> Timing, there is a VI in there called Get Date/Time in Seconds.  You can place that VI before and after the part of the code you want to time and connect the wires through.  Then at the part of the program where you place the second one, place a simple mathematical subtract and subtract the first from the second.  The output will be the number of seconds (with millisecond precision) it took for that piece of code to run.
    Let me know if you have more questions, adn I'm happy to help 🙂
 
-Allison S.
Applications Engineering
-Allison S.
Calibration Services
Product Support Engineer
Message 4 of 7
(3,983 Views)
Allison S.,
 
Redarding counting the number of PASS/FAIL results, actually that is what I've been trying to do this past few days but I just can't seem to get it right. Can you tell me how to count the results programmatically? The VI is designed to run continuously with the opening and closing of the feeding chamber, running the inspection then opening the chamber again. The only contact that the human inspector would have is in turning the switch on & off (I wired a switch to the input portion of my DAQ board, it serves mainly just to make the air cylinder open & close the chamber door), and looking at the screen to know if the inspection passed/failed.
Thanks again.
 
 
Joel Tucit

Message Edited by joeltucit on 12-06-2006 02:58 AM

0 Kudos
Message 5 of 7
(3,967 Views)

Joel,

    Well, to count the number of pass/fail results you can set up a numeric indicator that is incremented each time.  Within each case for each of the four images you can have two numeric indicators -- one for "pass" one for "fail".  Then you can make a small two-case case structure where pass ads 1 to "pass" and fail ads 1 to "fail".  Have you already tried this?  If so, what is happening that is not correct?  Let me know if you have more questions, thank you 🙂

-Allison S.

Applications Engineering

-Allison S.
Calibration Services
Product Support Engineer
Message 6 of 7
(3,943 Views)

Allison S.,

I di tried it but it still does not work the way i wanted it to. I;ve uploaded a video of what is happening and also the new VI. Hope you can point out my mistakes. Thanks again.

 

Joel

0 Kudos
Message 7 of 7
(3,920 Views)