02-05-2014 11:51 AM
I'm trying to build some labview vi's in LabVIEW 2012, to be compatible with Vision Builder AI 2011. I want to include some shared variables. I have the library file containing a string shared variable and a labview VI with just a string control into the shared variable. This is to read text from the vision build inspection. Both the library and the vi is saved under version 2010 but when I try to make a LLB file, the versions change to 2012 again. Do you have any inpute into why this could be?
02-05-2014 12:36 PM
You need to use the LV project to create a source distribution that includes all the dependencies (including vi.lib). Then close out LV 2012 to make sure you don't accidentally get any cross linking. Open the main VI of your built LLB with LV 2012 and then go to File>>Save for Previous. If there are any licensed VIs from vi.lib included, those may not save for previous, but I think this is what you should try to do.
I'm not sure exactly what you are trying to do, but if you want to use shared variables, VBAI (2010 or later) can update a shared variable with it's results (or read the variable if you want to pass data to VBAI), and then any version of LV can read/write that shared variable because shared variables are not LV version specific so you don't have to have the same version of LV to read/write shared variables. If this is all you want to do, you could just keep your LV code in LV 2012 and read/write the variable that is used by VBAI 2011. You can also use the VBAI API to control the inspection from any version of LV 2010 or higher regardless of the version of VBAI. You can see an example here:
C:\Program Files (x86)\National Instruments\Vision Builder AI XXXX\API Examples\LabVIEW Examples
Let us know if this still does not address your question and provide more details if this doesn't help.
02-05-2014 01:53 PM
Thanks for the quick responce. That is exactly what I want to do. I don't have the LabVIEW Examples in the API Examples folder though all i have is CVI and dotNET.
02-05-2014 01:58 PM
When you install VBAI, you have option to install LabVIEW API. This option is off by default if you don't have LV installed. Try running the VBAI installer again and make sure the LabVIEW API is selected to get the shipping example for how to use the API in LabVIEW.
02-05-2014 09:49 PM
If all you want to do is read and write VBAI Variable from LabVIEW, you can share system variables in VBAI (from the Variable Manager). They will be deployed and you can read and write them from LabVIEW.
Conversely, you can create shared variables in a LabVIEW project, and access them in VBAI. To do that, create Network Variables in VBAI and bind them to the shared variables from LabVIEW.
You can use the Variable Step in VBAI to write those variable. The ones that are read only are accessible from any step that use previous result.
This solution works well if you're OK with reading/writing the variables asynchronously from LabVIEW/VBAI.
If you need a tighter synchronization between VBAI and LabVIEW, then use the VBAI LabVIEW API as Brad suggested. This API was designed to automate VBAI from LabVIEW (silently launch a VBAI engine, open an inspection, run it (synchronously or asynchronously) and retrieve step results and images.
Hope this helps.
02-06-2014 06:42 AM
I would like to use API but when I go to launch LabVIEW API Example (Local).vi, I get a find control name pop out for IVB Interface0- VBAI Version.ctl, Get Inspection, Get Inspection Results, Run Inspection Once, Open Interface, Close Connection, VBAIIterface.ctl. When I reinstalled the LabVIEW API Support I noticed another section for the Developer Toolkit, but this will not allow me to download it as I have LabVIEW 2012 instead of 2010. Not sure if that has something to do with it or not...
02-06-2014 06:45 AM
Oh hang on, I found the API.llb file.
02-06-2014 07:02 AM
I'm going to need the Developer Toolkit but I get a LabVIEW 2010 Not Detected error...
02-06-2014 08:15 AM
The SDK is for developers that want to create their own steps that show up as a custom step in VBAI. This doesn't sound like what you want. The fact that you're getting popups about missing items when trying to open the API example sounds like things aren't installed correctly for the API. It sounds like you have the API.llb installed, but other parts may not be there maybe?? Not sure what went wrong with your installation, but I would focus on getting the API installed correctly and not worry about the SDK. The API works with LV 2010 or higher and only requires the Vision Development Module if you want to do additional image processing in LabVIEW. The SDK requires a specific version of LabVIEW and Vision Development Module.
Hope this helps,