Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

NI VBAI working with Vector's vTestStudio

Hello there,

 

I am trying to configure Vector's vTestStudio to work with NI VBAI. As C# code can be used in vTestStudio, in my opinion it shouldn't be an issue to send a command to the Vision builder and afterwards to obtain the result via Data logging. The idea is not to use files for storing the results but directly using the Vision's feedback in the test environment.

 

So I wonder if such implementation have already been done and how - what I found is that for this purposes a .dll file has to be used (I found this one in the examples - NationalInstruments.VBAI.2008.dll). I need a hint how to establish the communication between the two applications and how to reach the Vision functions via C# or CAPL code.

 

Thanks in advance!

0 Kudos
Message 1 of 9
(3,512 Views)

Just to add what I observe when trying to build the Test Unit - this error appears:

 

"Error Could not load 'C:\Users\MIZ1SF4\Downloads\KB_vTESTstudio_ReUsableTCs\vTESTstudioProject\NationalInstruments.VBAI.2008.dll' due to the following reasons:

Error Could not load file or assembly 'NationalInstruments.Vision.Common, Version=13.1.35.100, Culture=neutral, PublicKeyToken=18cbae0f9955702a' or one of its dependencies. The system cannot find the file specified."

0 Kudos
Message 2 of 9
(3,487 Views)

Make sure you have VBAI installed with API support for C/dotNET. This will install other DLLs that go in your System folder as well as a dotNET example to illustrate how to call the API from a dotNET application. Make sure to install VBAI 2015 since VBAI 2018 no longer installs support for dotNET. We hope to open source the dotNET layer so customers can use as is, but that hasn't been done yet.

0 Kudos
Message 3 of 9
(3,458 Views)

Hello Brad,

Thank you for your answer. The VBAI that I installed is VBAI 2015 and currently it's with evaluation license (don't know if this is important in this case).

 

The dotNET example that I found after the installation was in this folder:

    ...\National Instruments\Vision Builder AI 2015\Examples\API Examples\dotNET Examples

 

In that folder there was the dll, that I mentioned in my previous post - NationalInstruments.VBAI.2008.dll namely.

 

Do I need something additionally to install and how to ensure that there is an API supporting dotNET?

0 Kudos
Message 4 of 9
(3,446 Views)

1. Does the example work on the machine where you installed VBAI?

2. Are you trying to create your own application and install/run on another machine? If this is the case, the other machine still needs VBAI installed. There is a run-time license you can purchase that will have all the VBAI dependencies installed to run VBAI inspections, but you won't be able to develop new inspections on the machine with this runt-time license version installed. Once this is installed, I would expect your application would work.

Here's more information on the run time license:

http://www.ni.com/en-us/shop/electronic-test-instrumentation/application-software-for-electronic-tes...

 

Hope this helps,

Brad

0 Kudos
Message 5 of 9
(3,426 Views)

Hi,

 

1. Does the example work on the machine where you installed VBAI?

 - Yes, the example is working on the machine where the VBAI is installed.

 

2. Are you trying to create your own application and install/run on another machine?

 - I am trying to setup a new project in Vector's vTestStudio. For this purpose on the same machine I have installed CANoe and vTestStudio. What I am trying to do is to integrate the C# code and the corresponding dll from the example into this newly created project in order to evaluate the possibility for communication between the VBAI and the vTestStudio. For the moment I have only success with the building of the project but not with the execution (see the attached picture). I am not pretty sure that all the needed files have been included correctly.

 

Regarding the license - Run-time is not sufficient as inspections have to be created/modified. Development-Lizenz für Vision Builder AI will be needed instead.

 

0 Kudos
Message 6 of 9
(3,416 Views)

So it sounds like you are trying to use the dotAPI on the same machine where the MSVC example that uses it works fine. Is this correct?

 

The error in your screenshot seems to indicate the bitness of the DLL may not be compatible. Is vTestStudio 64-bit? I tried recompiling the DLL with "Any CPU" set just to see if that resolves the issue since the error comment mentions this, but we do not support 64-bit applications with the dotNET API because some of the dependencies (i.e. Vision Development Module) don't have dotNET 64-bit support.

0 Kudos
Message 7 of 9
(3,398 Views)

So it sounds like you are trying to use the dotAPI on the same machine where the MSVC example that uses it works fine. Is this correct? - Yes, this is correct.

 

It seems this is the blocking point for the moment - the vTESTStudio for Windows10 has only 64 bit version so on my machine it will not work. I will try on another computer with 32 bit version

0 Kudos
Message 8 of 9
(3,381 Views)

As there was no success with the DLL file, I am trying now another approach - to communicate over TCP IP. For this purpose I configured a running server from the menu Tools\Communication device manager...

 

I am stuck now on the IP configuration - what shall be the IP address and the port of the device I want to communicate with, and what is the IP of the server, that is configured within the NI VBAI - the only setting that could be set is the port.

 

0 Kudos
Message 9 of 9
(3,273 Views)