12-09-2011 02:18 PM
I have an inspection that searches for bright objects (holes) in a product, and typically it does not find any (good), but when it does I need to know the locations of each hole, to determine xy-boundaries of the region of holes, i.e., the mins and maxes of the xy-coordinates of each hole. To do this, I'd like to use a caclulator step and interate through all the holes found.....but I don't believe the calculator can handle a variable number of holes..or can it?
Thanks,
Eric
Solved! Go to Solution.
12-09-2011 02:39 PM
Hi Eric,
The calculator step does not support arrays. We got numerous requests about better array support in VBAI and we're going to address it.
In the meantime, you can iterate through the results of a step that produces arrays by building a slightly more complex state diagram. Index Measurements Example.vbai and Classify Objects Example.vbai for examples on how to do that.
Hope this helps.
Best regards,
Christophe
12-09-2011 02:48 PM
It can if you put it in a loop with the index step indexing through each detected object and getting the center X, Y for hole[i], passing these results to caluclator, incrementing i, and using index step to get coordinates for next hole, and leave this state when no holes left.
Hope that helps,
Brad
12-09-2011 02:52 PM
Christophe/Brad,
Thanks, that did the trick.
Eric