TriggerEdge Property

Returns or sets the trigger edge transition for analog trigger operations.

Syntax

Variant = object.TriggerEdge()

object.TriggerEdge = vNewValue

The TriggerEdge property syntax has these parts:

Part Description

object Required. A valid Mathcad Data Acquisition Control object.

vNewValue Required. Variant (Long). Set to 0 for low-to-high transition or 1 for high-to-low transition.

Remarks

The TriggerEdge property is used in conjunction with the TriggerLevel property for analog trigger operations and is ignored for digital triggers.

If an invalid value, such as other than 0 or 1 or non-numeric, is specified for the property it will default back to 0.

Example

Sub GetWaveformOnTrigger()

  Dim McadDAQ As AnalogIO

  Dim lTemp as Long

  'the next statement assumes there is a Mathcad Data Acquisition control called

  ' AnalogIO1 on Form1 of a VisualBasic project

  Set McadDAQ = Form1.AnalogIO1

  'set the channel string to acquire from channel 1

  McadDAQ.ChannelString = "1"

  'set the IOFunction to input

  McadDAQ.IOFunction = 0&

  'set the IOType to waveform

  McadDAQ.IOType = 1&

  'set the number of samples to acquire for all channels

  McadDAQ.NumSamples = 1000%

  'set the sample rate in samples per second

  McadDAQ.Rate = 10000%

  'set trigger related information

  McadDAQ.WaitForTrigger = 1%

  'Set up for low-to-high analog trigger of 2.5 Volts at the PFI0 pin

  McadDAQ.TriggerType = 1%

  McadDAQ.TriggerSource = 0&

  McadDAQ.TriggerEdge = 0&

  McadDAQ.TriggerLevel = 2.5#

  'acquire the data

  McadDAQ.Acquire

  'See if the right number of samples was acquired, zero base assumed

  On Error Resume Next

  lTemp = UBound(McadDAQ.Channels("1").Data) + 1

  If Err.Number = 0 Then

  MsgBox CStr(lTemp) & " samples were acquired"

  Else

  MsgBox "Acquisition Error"

  End If

End Sub