LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run NI vision VI in While Loop?

Hi,

 

I'm student in mechnical engeering, i have summer project about tensile test of adhesive assembly and i need to calculate automatically the surface of the crack so i choose to do it with NI vision tools,so my question is how can integrate my VI in While Loop to treshold my image and get the surface in real time

i put some example of image that i should process to get the crack surface of the adhesive joint. in purpose to calculate maximal stess before crack.

i have the 2015 labview but i could give the 2014 version

 

thank you in advance

Download All
0 Kudos
Message 1 of 5
(2,932 Views)

From the code, i can see what is going to happen when running the VI. However, i have no idea what you EXPECT IT TO DO.

Could you explain what you expect vs. what is going on? What is the discrepancy?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,890 Views)

Hi,

 

i expect to treshold in real time the image and get the new particle measurement this is why i think to use while loop but when i lunch the VI the problem is when i treshold no thing happen the treshold image is not modified.

 

Please if you know how to do it i will appreciate

 

thank you in advance

0 Kudos
Message 3 of 5
(2,881 Views)

@mediaddad wrote:
[...] the treshold image is not modified.[...]

That is expected as the image terminal is not inside of the loop. So it will update only if you leave the loop, so when you stop the VI.

However, the Particle Measurement array should get updates, so ou might check this.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(2,872 Views)

In addition to Norbert's suggestion that if you want to see the images as the loop runs, your Display terminal needs to be inside the loop, I'd make a few more suggestions:

  • Don't wire in the Default inputs to IMAQ Edge Tool 3 (the Edge Options and Reverse Direction inputs) -- if you are using Defaults, leaving the (redundant) detail out keeps things more compact and capable of being "seen at a grasp".
  • Most LabVIEW Functions "do nothing" if there's an Error In.  Accordingly, you probably don't need a Case around this function wired to the Error Code.  Again, get rid of clutter.
  • You have ROI descriptors as Constants!  Where did these come from?  If they are constant, move them outside the loop to keep the loop "innards" more compact and tidy so you can "see the forest for the trees".  I didn't look if these are the same for all the functions to which they are wired, but if they are, there should only be one of them (to emphasize the "sameness").
  • I see another Constant wired to the IVA Coordinate System Manager.  Where does this come from?  If it is a constant, it also should be moved outside the loop (keeping it clean).
  • Consider encapsulating multiple IMAQ functions into your own sub-VI that you identify as "Find Crack" or "Analyze Threshold" or whatever describes what it does.  Make an Icon for this sub-VI (it can be a box with text inside it, like this:Sub-VI Icon.png(this is a 32x32 pixel Icon I created for the sub-VI that you attached to your post -- it took about a minute using the Icon Editor that comes with LabVIEW that you can run by double-clicking the Icon shown on the Block Diagram or Front Panel).  This allows you to take code that used to take a relatively large screen area (say 1000 x 400 pixels) and reduce it to 32x32, with a label that says What It Does.

Bob Schor

0 Kudos
Message 5 of 5
(2,863 Views)