Action Property

NI Vision for Visual Basic

Action Property

Syntax

CWIMAQPulse.Action

Data Type

CWIMAQPulseActions

You can use the following constants with this data type:

  • cwimaqSingle—A single pulse.
  • cwimaqSingleRearm—A single pulse generated for each occurrence of the signal source.
  • cwimaqTrain—A pulse train.

Purpose

Action of the pulse.

Remarks

Action describes if the pulse is a single pulse, a pulse train, or a pulse that is rearmed after each assertion.

Example

Private Sub Run_Click()
    Dim pulse1 As CWIMAQPulse
    Dim signal1 As CWIMAQSignal
    ' Add a signal
    Set signal1 = CWIMAQ1.Signals.Add
    
    ' Set the signal object to generate a pulse
    ' on external line 0.
    signal1.Action = cwimaqGeneratePulse
    signal1.Line = cwimaqExternal
    signal1.LineNumber = 0
    
    ' Add a pulse.
    Set pulse1 = CWIMAQ1.Pulses.Add
    
    ' Set the pulse to have a width of 1 second
    ' after the initial delay of 1 seconds.
    ' The pulse is generated immediately after
    ' RTSI 3 is asserted.
    pulse1.Action = cwimaqSingle
    pulse1.Delay = 1#
    pulse1.Width = 1#
    pulse1.SignalSource = cwimaqRTSILine
    pulse1.SignalLineNumber = 3
    pulse1.SignalPolarity = cwimaqActiveHigh
    pulse1.Units = cwimaqPulseUnitSeconds

    ' Set this pulse1 as the pulse1 that the signal1
    ' object generates
    Set signal1.pulse = pulse1
End Sub