From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple ROIs With Multiple Clamps

Solved!
Go to solution

Hello, I'm playing around with the various clamp VI's in Labview 2011, and I have 1 working, but I want to have more than 1 (probably 3).

 

I already know about CTRL to make a new ROI, but I have no idea how to send that information into the clamp VI, and then how to have all clamps show up on the same image. In my research I've seen people use group/ungroup ROIs, also for loops to index through ROI's, but I couldn't get those to work with a clamp.

 

I've attached what I have so far. Any advise would be great, thank you.

0 Kudos
Message 1 of 7
(3,859 Views)
Solution
Accepted by topic author markconigliaro

Please find the attached VI, i have slightly modified the same code hope it serve the purpose and let me know if you need any help.

 

Regards

@sk

Message 2 of 7
(3,853 Views)

Hi, I'd love to see it, but unfortunatly I can't open it because I have Labview 11.0 and you have 14. Can you post it again as an earlier version or post a picture? Thank you for helping. 

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

LabVIEW 11 version...

0 Kudos
Message 4 of 7
(3,847 Views)

Thank you, the picture when I opened it (5 ROIs, same picture, distances shown) was exactly what I needed, to the letter, it's perfect.

 

Then I got a few weird problems. In your VI, I tried to change the picture to one of mine, and when I ran the VI, I right clicked and pressed "Clear ROI" and I got a blank white screen. Even when I hovered over the picture display, the mouse cursor was a pointer finger, rather than the crosshair it's supposed to be. Because it wasn't a crosshair, all of the shape controls didn't work. So I saved your test picture and ran the VI, and the picture showed, but once I clicked and dragged, the picture went white until I let go. When I let go, a shape, much bigger then what I dragged out, appeared in the top left corner. The I tried my picture, and the same problem happened.

 

And even weirder, I went back to the VI I attached in the original post, and now the vertical red lines are gone! Now I make a ROI, the shape appears, the display tells me the distance between the lines, but the lines don't appear until I click the stop button.

 

I've attached the picture I was using to test. I restart my computer because maybe it was a memory issue, but nothing changed.

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

I played around with your VI a little more and figured out why it did some of the weird things before. The white screen problem comes when you try and clear the existing ROIs while the VI is running. If you right click and press "Clear ROI" while running, that's when the white screen of death comes. You can clear ROIs no problem when the VI isn't running. Or if you click (without CTRL) to start drawing a new ROI, it'll turn white. You also can't change pictures when no ROI exists. That's what I was doing before, I changed your picture to mine, cleared the ROIs, and then ran the VI, and that's also how I get the white screen. 

 

So now the problem becomes when I run the VI, I can make new ROIs, but can't mass delete all of them (right click and delete works fine for individual ROIs). Also I can't change pictures without having at least one ROI exist on screen.

 

The red lines work in yours, but they're still gone in my original VI posted above, it's pretty annoying because I can't see where the measurements are coming from.

 

Thank you though, I'm definitly on the right track now, I just have to iron out these problems.

0 Kudos
Message 6 of 7
(3,809 Views)

Final update, because it's all figured out now. All I had to do was move the image display into the for loop and the white screen/deleting ROIs problem went away. I also moved the file path into the while loop so I can change pictures while running.

 

I also figured out why the red lines wouldn't appear in my original VI, all I had to do was add a delay in the while loop. I suspect the clamp was updating the lines so fast I couldn't see them, so the wait allows me to actually see it.

 

Thank you very much for the VI, it works perfectly now with some minor changes.

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