Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision builder migrating to labview... Many VI

Solved!
Go to solution

Hi,

 I am using the latest version of labview and NI vision builder. By using the Vision builder am getting the X and Y coordinates of the object in that area. I need to export this to labview. I tried by going to "migrate to labview" . Then I created a new folder, then I gave the name. When I click OK. It creates many VI's. I need this in single VI. When I open the "main.VI" i could only see "pass, start" ; when i check the block diagram.I couldn't find the programe that i needed for it.

 

Hope you have understood my question.

Can you please help me.

Thanks in Advance

0 Kudos
Message 1 of 25
(6,695 Views)

AKanna wrote:

 By using the Vision builder am getting the X and Y coordinates of the object in that area. I need to export this to labview. 


Hi AKanna,

what are the functions you are using in the vision builder to get the co-ordinates. Why can't you directly use those functions in labview itself.

---
Silver_Shaper | CLD
0 Kudos
Message 2 of 25
(6,692 Views)

All the stuff which you can do in the Vision builder you can also program in the LABVIEW. The advantage is ease of programming and development time. That's why we use Vision Builder.

 

First am acquiring image, image processing, ROI, Calibration, Geometric pattern matching.

 

Hope I have replied your question. 

0 Kudos
Message 3 of 25
(6,689 Views)

Have you tried the Vision Builder AI API? The API is easier to use than the generated code, and allows to drive VBAI from LabVIEW (open an inspection, run it, retrieve results...).

Examples are located here:

<National Instrumens>\Vision Builder AI\Examples\LabVIEW Examples.

 

Christophe

0 Kudos
Message 4 of 25
(6,686 Views)
Solution
Accepted by topic author AKanna

Another option, which could be used in conjunction with the API solution Christophe mentioned is to make your X/Y values shared variables that you update in your VBAI inspection and then read in your LV code. Here's a tutorial on using shared variables to communicate results to LV from VBAI:

http://digital.ni.com/public.nsf/allkb/D492139A746F91A8862576E80051BBCE

 

Here's a video of how to use the API that Christophe was mentioning:

http://zone.ni.com/wv/app/doc/p/id/wv-2424

 

Here's a video of using shared variables (demo shows using RT targets, but the same idea would work locally):

http://zone.ni.com/wv/app/doc/p/id/wv-2423

Message 5 of 25
(6,679 Views)

That's Great. Thanks.

When i share the variable(xx and yy) from Vision builder to labview vi( for example lets say aaa.vi). And when i run this aaa.vi, will it automatically run the vision builder also in parallel or we have to run labview VI and vision builder seperately. 

0 Kudos
Message 6 of 25
(6,673 Views)

If you use the API, you can control a Vision Builder AI engine that runs an inspection in parallel to other LV code and get the result of interest either using shared variables or using the API to get measurements. If you don't use the API, you will need to manually launch VBAI yourself and get the inspection going and then read the shared variables in LV, but you will not be able to directly control when VBAI runs each iteration using this method, only the API gives you this kind of control. Check out the API examples for LV located in your VBAI folder under examples.

 

Hope this helps,

Brad

0 Kudos
Message 7 of 25
(6,667 Views)

Thanks a lot.

 

Can your please tell me about API.

 

How abt this idea? if i press run countinoulsy in AI and run button in Labview. WIll this sort out this problem or will i face anyother problem?

0 Kudos
Message 8 of 25
(6,606 Views)

If your VBAI inspection updates the shared variables and your LV inspection reads the values from those shared variables, it should work fine. It's important to note that shared variables are not synchronous, so there's no guarantee that when an inspection iteration is done in VBAI, you will get notified right away before another update happens on the VBAI side. You can try buffering the variable value, but if you want to have better synchronization and control when VBAI runs, you should use the VBAI API in LabVIEW to do this instead of running the VBAI executable. Using the VBAI API will allow you to run one iteration at a time, get your results/images/etc. and then this ensures everything is synchronized.

   

Hope this helps,

Brad 

0 Kudos
Message 9 of 25
(6,604 Views)

Thanks for your reply. I would like to use VBAI API. Can you please tell me wehere is it(api) and how to use it(api). Thanks in advance.

0 Kudos
Message 10 of 25
(6,599 Views)