Chapter 2 Getting Measurement-Ready Images
© National Instruments Corporation 2-5 IMAQ Vision for Visual Basic User Manual
If you want to acquire multiple frames, set the image count to the number
of frames you want to acquire. This operation is called a sequence. Use a
sequence for applications that process multiple images. The following code
illustrates an asynchronous sequence, where numberOfImages is the
number of images that you want to process:
Private Sub Start_Click()
CWIMAQ1.AcquisitionType = cwimaqAcquisitionOneShot
CWIMAQ1.Images.RemoveAll
CWIMAQ1.Images.Add numberOfImages
CWIMAQ1.Start
End Sub
Continuous AcquisitionUse a continuous acquisition to start an acquisition and continuously
acquire frames into the image buffers, and then explicitly stop the
acquisition. Use the CWIMAQ.Start method to start the acquisition. Use
the CWIMAQ.Stop method to stop the acquisition. If you use a single buffer
for the acquisition, this operation is called a grab. The following code
illustrates a grab:
Private Sub Start_Click()
CWIMAQ1.AcquisitionType=_
cwimaqAcquisitionContinuous
CWIMAQ1.Start
End Sub
Private Sub Stop_Click()
CWIMAQ1.Stop
End Sub
A ring operation uses multiple buffers for the acquisition. Use a ring for
high-speed applications that require processing on every image. The
following code illustrates a ring, where numberOfImages is the number of
images that you want to process:
Private Sub Start_Click()
CWIMAQ1.AcquisitionType =_
cwimaqAcquisitionContinuous
CWIMAQ1.Images.RemoveAll
CWIMAQ1.Images.Add numberOfImages
CWIMAQ1.Start
End Sub