Start Method

NI Vision for Visual Basic

Start Method

Syntax

CWIMAQ.Start

Return Type

Long

This method returns 0 on success, a negative number on an error, and a positive number on a warning.

Purpose

Starts the acquisition asynchronously.

Remarks

Call this method to start a continuous acquisition. Call the Stop method to stop a continuous acquisition. As the image acquisition device acquires images, the CWIMAQ control generates the AcquiredImage event.

Example

' This example requires you to have the following controls on the form:
' 1) A button named Acquire.
' 2) A button named Stop.
' 3) A Textbox named Text1
Private Sub Acquire_Click()
    ' Attach the viewer to the first item of the Images
    ' collection
    CWIMAQViewer1.Attach CWIMAQ1.Images.Item(1)
    ' Make the acquisition continuous.
    CWIMAQ1.AcquisitionType = cwimaqAcquisitionContinuous
    ' Start the acquisition
    CWIMAQ1.Start
End Sub

Private Sub Stop_Click()
    ' Stop the acquisition
    CWIMAQ1.Stop
End Sub

Private Sub CWIMAQ1_AcquiredImage(ImageIndex As Variant)
    ' Display the ImageIndex in the text box.
    Text1 = ImageIndex
End Sub

See Also

Stop

Reset

AcquiredImage

AcquisitionType