03-26-2012 04:28 AM
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
Solved! Go to Solution.
03-26-2012 07:41 AM
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.
03-26-2012 09:15 AM
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.
03-26-2012 10:22 AM
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
03-26-2012 12:02 PM - last edited on 11-13-2024 02:43 PM by Content Cleaner
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:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LjnSAE&l=en-US
Here's a video of how to use the API that Christophe was mentioning:
03-27-2012 08:03 AM
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.
03-27-2012 09:06 AM
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
04-27-2012 09:50 AM
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?
04-27-2012 10:22 AM - edited 04-27-2012 10:26 AM
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
04-27-2012 11:17 AM
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.