WaitOnSignal Method

NI Vision for Visual Basic

WaitOnSignal Method

Syntax

CWIMAQ.WaitOnSignal Signal, SignalPolarity [, SignalLineNumber = 0] [, Timeout = 120]

Return Type

Long

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

Purpose

Waits for a signal to generate.

Remarks

Call this method to suspend the program execution until the signal you specify is generated. This method returns when the specified signal is asserted.

Parameters

Signal As CWIMAQSignalSources

The signal to wait on.

SignalPolarity As CWIMAQSignalPolarities

The polarity of Signal.

SignalLineNumber As Variant

[Optional] If you set Signal to cwimaqExternalLine or cwimaqRTSILine, SignalLineNumber is the line number of the signal. Otherwise, the method ignores this parameter.

This parameter has a default value of 0.

Timeout As Variant

[Optional] The time, in milliseconds, to wait before timing out.

This parameter has a default value of 120.

Example

' This example requires you to have a button named Acquire on the form.
Private Sub Acquire_Click()
    ' Attach the viewer to the first item of the Images
    ' collection
    CWIMAQViewer1.Attach CWIMAQ1.Images.Item(1)
    ' Make the acquisition one-shot.
    CWIMAQ1.AcquisitionType = cwimaqAcquisitionOneShot
    ' Start the acquisition
    CWIMAQ1.Start
    ' Wait for the acquisition to complete.
    CWIMAQ1.WaitOnSignal cwimaqAcquisitionDone, cwimaqActiveHigh, , 1000
End Sub