Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

cwimaq start

I use the C++ dialog editor to insert a CWIMAQ ActiveX object in my application. I set the Acquisition type to 'continuous'. Do I need to call
cwimaqObject.Start() in my code to begin a grab acquistion or does the dialog editor take care of that?
What CWIMAQ function should I use to grab the image for processing, cwimaqObject.GetLastValidImage()?
0 Kudos
Message 1 of 6
(3,892 Views)
Hello.

Indeed, the .Start() method is what you need to call to actually start the acquisition from the camera. The images will then be coming into your computer.

If you call the .Images property, you will get an array of the image objects that are attached to this acquisition. Additionally, you could call the .ExtractImages method to extract the image for processing.

I hope this helps!
Regards,
Colin C.
Applications Engineering
Colin Christofferson
Community Web Marketing
Blog
0 Kudos
Message 2 of 6
(3,892 Views)
Thanks!

So if I use the Dialog editor to specify an Image Count equal to 5 on the acquisition property sheet for the CWIMAQ object it will create a buffer for 5 images?

Will the following code get the last image available in memory? Or is there a more efficient way...

long pos = cwimaqObject.GetLastValidImage();
CWIMAQImages imageBuffer;
imageBuffer = cwimaqObject.GetImages();
C_CWIMAQImage m_image = imageBuffer.Item(COleVariant(pos));
0 Kudos
Message 3 of 6
(3,892 Views)
Hello again.

I would reccomend taking a look at the VB examples, which should clarify the correct syntax for your application (which is essentially what we call a sequence).

The examples should be found in
National Instruments\NI-IMAQ\Sample\VB

Good luck!!
Regards,
Colin C.
Applications Engineering
Colin Christofferson
Community Web Marketing
Blog
0 Kudos
Message 4 of 6
(3,892 Views)
That may help. I'm using C++ though.
0 Kudos
Message 5 of 6
(3,892 Views)
In the same locations there should be some MSVC examples as well!
Colin Christofferson
Community Web Marketing
Blog
0 Kudos
Message 6 of 6
(3,892 Views)