Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Losing smart camera connection when using web server on NI1762 smart camera

 

Hi

I am using 2 smart cameras ( old NI1762 and the new NI1772) with Vision builder 2011 . 

I am trying to find a way to retrieve data and image to a Visual Basic 6 application. i could not find an elegant way to do it , so instead , i am sending TCP command to the smart camera as an input and the smart camera send me back a TCP command a as an output. by this way i could communicate with the smart camera . For transferring images I could not use the TCP step , so I turned on the smart camera web server to get the image by a browser Object . But the problem is that everything is going well with the TCP, but when I turned on the web server and try to communicate with it, sometimes I loose the connection with the smart camera. That is happened with the 1762 smart camera. But when I use the NI1772 it rarely happed.

Please help me. is there any other elegant way to communicate with the smart camera , and if a TCP and web server is a solution , Why the NI1762 web server is not stable ? Why i am losing the connection when browsing to the inspection page???

Thanx

0 Kudos
Message 1 of 5
(3,471 Views)

Hi M. Younis,

Do you experience this same behavior when you are using the interface provided in Measurement & Automation Explorer?  Is this something that if only recently happening?  It's not clear from your previous post if you are using the IMAQdx driver or if you are trying to get the data some other way.  Can you give us some insight on how the camera behaves using Measurement & Automation Explorer and confirm that you are using the IMAQdx driver from Visual Basic?

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

Hi

 

I do not experience this behavior when I am using the interface provided in Measurement & Automation Explorer.

I am using a smart camera with Vision Builder 2011, I am using IMAQ via vision builder and I am not using IMAQdx.

I just want to know how I can run the smart camera job (on the camera via vision builder) and retrieve the inspected image and the results to my visual basic 6 application.

I thought that there is an API that I can call from my application , but I could not find so I am using TCP I/O to communicate with the camera , as will I am browsing the image via the smart camera web server .

Is there any other stable and elegant way to communicate with the smart camera from a visual basic 6 application?

 

Thanks for help

0 Kudos
Message 3 of 5
(3,454 Views)

Hi M. Younis,

You have a few options that should work for what you are trying to do.  The most straight forward would be to have the smart camera transfer the image to a location using an FTP protocol and then reading that file in using Visual Basic.  You can find information about doing this at our KnowledgeBase 5TO9SU44: Transferring Vision Builder AI Inspection To or From a CVS, EVS, or Smart Ca....  You should be able to set the camera up to save the file on your host computer and then just pull the image from the file path.

 

We have examples of using the Vison Builder AI as part of a C program, but nothing specifically for Visual Basic.  You will want to confirm that you included those examples and that support as part of the installation when you installed the Vision Builder software.

0 Kudos
Message 4 of 5
(3,447 Views)

Previous versions of Vision Builder had a COM library that you could use from Visual Basic 6 or other environments and talk over the network to a Smart Camera running Vision Builder AI and control its execution just how you are requesting. In more recent versions, this has been replaced by a native .NET and LabVIEW-native API that is much more fully featured. Unfortunately, I do not think the older COM mechanism is still available/supported (but I certainly could be wrong...).

 

However, one avenue you may wish to persue would be to call into the .NET interface from Visual Basic 6. Microsoft designed .NET to allow COM interoperibility in both directions (.NET can call into COM libraries and COM libraries can call into .NET). Take a look at the following document from Microsoft:

http://msdn.microsoft.com/en-us/library/zsfww439(v=vs.85).aspx

 

You could then look at any of the .NET (C#) examples to get an idea of the API:

C:\Program Files (x86)\National Instruments\Vision Builder AI 2011\API Examples\dotNET Examples

 

Eric

0 Kudos
Message 5 of 5
(3,443 Views)