TriggerLevel Property |
Returns or sets the analog trigger level.
Variant = object.TriggerLevel()
object.TriggerLevel = vNewValue
The TriggerLevel property syntax has these parts:
object Required. A valid Mathcad Data Acquisition Control object.
vNewValue Required. Variant (Double). The analog trigger level in volts.
The TriggerLevel property is used to specify the level of the analog trigger.
If an invalid value, such as non-numeric, is specified for the property it will default to 0 volts.
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