Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

C# support

Is there any documentation, support, discussion, or sample code for programming Machine Vision applications in C#? References to Visual Basic documentation are only minimally helpful, since the function calls are different. Figuring this stuff out from the VB documentation is time consuming and not always possible. Thanks for any help offered.
 
0 Kudos
Message 1 of 13
(8,712 Views)
Hi bitsmith,

Thank you for using National Instruments software.  As right now, we do no have direct C# documentation.  This is a known issue, but no known timeline as to when it will happen.  I would definitely make a suggestion request here:

http://digital.ni.com/applications/psc.nsf/default?OpenForm&temp1=&node=

Justin Louie
0 Kudos
Message 2 of 13
(8,705 Views)
Are you having difficulties with a specific entry point in the C# API? What are you trying to achieve with your application. Maybe I can compile a quick C# example that would demonstrate any functionality that is causing you problems...

Regards,

JohannS
0 Kudos
Message 3 of 13
(8,690 Views)
I could really use a small C# sample program.  I have managed to open an image file and display it, but I would like to be able to Snap an image with my 1394 camera and display it and I would also like to be able to define a region on the image so that I can use it for pattern recognition, as in the Visual Basic example "Pattern Matching".  I am using VS 2005 and Vision 8.2, both purchased in July 2007.
0 Kudos
Message 4 of 13
(8,660 Views)
I have attached a small working C# program using Vision software.
 
I am using the generic (dx) drivers and it works for my 1394 camera.  In addition to getting an image from a camera, it demonstrates displaying "live" images, getting images from files, defining a region of interest, and pattern matching.  There are some brief instructions to get you started at the top of the main source file.
 
Let me know if this helps or if it just causes more problems.
0 Kudos
Message 5 of 13
(8,632 Views)
hi

i downloaded the example and tried to get it run

i have Visual Studio 2008 + Vision 8.5 Trial version (the 30 days thing)

now i set all the references but i get the following error:

        CWIMAQdx.Error Status;
        CWIMAQdx.Session Sid;


the CWIMAQdx cannot be found


does the trial version support the CWIMAQdx?

would be nice to know

thanks

greets kumi
0 Kudos
Message 6 of 13
(8,015 Views)
The sample was written with Visual C# 2005 and a different version of NI's software.  I cannot help you with this problem, it is more of a system level issue, not a problem with the application.
0 Kudos
Message 7 of 13
(7,993 Views)
hi, how can i disable the use of generic driver? because i get an error with this
0 Kudos
Message 8 of 13
(7,887 Views)
Dear kumi,

You can change which driver is associated with your FireWire camera from the Measurement & Automation Explorer (MAX). To do this, navigate to you camera from the configuration tree on the left, then right-click on your camera name. You should be able to select which driver is associated with your camera from there.

You should check and make sure that you installed VS support when you installed the Vision Development Module. I don't believe it is a default option for the install, so you would have to check it yourself from the installation options. When you have VS support checked, the Vision Development Module installer should install the CWIMAQdx DLL, which would allow you to use the IMAQdx driver to acquire from your camera in VS.

Best Regards,

~Nate
0 Kudos
Message 9 of 13
(7,851 Views)

Hi,

I'm having error while on:

w = CWIMAQVision1.Extract2(CWIMAQViewer1.Image, CWIMAQViewer2.Image, RoiRectangle, 0, 0);  // error is "COMException was unhandle. Incompatible image type."

0 Kudos
Message 10 of 13
(6,889 Views)