Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How use CWIMAQ... in Visual C++

HI All,

    I'm looking for example, how use  CWIMAQViewer in Visual C++. I have Visual Studio 2003.  I can generate class for this control with class wizard, but I did not find any help for this control.
    I need Grab image from ieee1394 and display it in CWIMAQViewer in first step 😉

Thank you in advance.

Zdenek
0 Kudos
Message 1 of 7
(4,479 Views)

Hello Zdenek,

The class libraries for IMAQ 1394 and Vision are wrappers into the ActiveX controls. You can find documentation about these controls (ie: CWIMAQViewer) in the VB help for them at "Start » Programs » National Instruments » Vision » Documentation". If you have installed 1394 support for MSVC++, you also should find a number of examples of NI-IMAQ 1394 programming in Microsoft Visual C++ in a folder located at "C:\Program Files\National Instruments\NI-IMAQ for IEEE-1394\Examples\MSVC", including 9 examples that grab images. You will find some Vision examples at "C:\Program Files\National Instruments\Vision\Examples\MSVC". I hope this helps. Take care!

Regards,

Aaron B.
National Instruments
0 Kudos
Message 2 of 7
(4,447 Views)
Hello Aaron,
 
I
0 Kudos
Message 3 of 7
(4,439 Views)
Hello Aaron,
 
I found
0 Kudos
Message 4 of 7
(4,438 Views)
Hello Aaron,
 
I found these
0 Kudos
Message 5 of 7
(4,438 Views)
Hello Aaron
 
I found these examples before I post question on this forum and it's not helfull for me. I can grap image from my ieee1394 camera and display it, in CView window. But I would like use CIMAQViewer control. First problem that class wizard generates only CWIMAQViewer class in Visual Studio 2003 and project cannot be compiled because CWIMAQImage is missing.
 
When I used Visual Studio 6.0, class wizard generated all classes which I need for the project.
 
So I used combination of these two steps. I created wrapper in Visual Studio 6 and copy these files into my project in Visual Studio 2003.
 
a) Is it correct way?
 
b) I'm using ieee1394 IMAQ functions and now I would like display this image in CWIMAQViewer control. Which functions should be used?
     VB help is not friendly for me, and I found only 4 lines about this control in IMAQ User Reference help file.
 
Zdenek
0 Kudos
Message 6 of 7
(4,443 Views)

Hello Zdenek,

The way that you described is perfectly acceptable.  I am not sure offhand why the class wizard failed to create all the necessary classes in 2003, but creating them in VC 6 and then using them in 2003 will also work as well.  With regards to the CWIMAQViewer API, there is a method called Attach, which attaches a CWIMAQImage object to the viewer.  You can attach the image at the beginning of the program.  The viewer will then always display the image stored in that memory location and will update automatically when the image changes.  I hope this helps.  Take care!

Regards,

Aaron B.
National Instruments
0 Kudos
Message 7 of 7
(4,417 Views)