Attribute VB_Name = "MainStart"
Sub Main()
    Dim bRe As Boolean
    Dim Result As Integer
    
    nCurDev = 0
    nSampleRate = 17
    nSampleDepth = 2048
    dbThresholdA = 1.5
    dbThresholdB = 1.5
    nHTrigPos = 50
    nTrigAEnable = 0
    nTrigBEnable = 0
    nLogic = 0
    
    TrigA.nEdgeSignal = 0
    TrigA.nEdgeSlope = 0
    TrigA.Equ_Dat = 1000
    TrigA.Equ_Sh = 1
    TrigA.Equ_So = 2
    TrigA.Intr_Equ = 0
    TrigA.Intr_Time = 0
    TrigA.Intr_Range = 0
    TrigA.Range_Max = 15
    TrigA.Range_Min = 0
    TrigA.Range_Sh = 1
    TrigA.Range_Mo = 0
    TrigA.Time_Max = 10
    TrigA.Time_Min = 1
    TrigA.Time_Mo = 0
    

    TrigB.nEdgeSignal = 1
    TrigB.nEdgeSlope = 0
    TrigB.Equ_Dat = 15
    TrigB.Equ_Sh = 1
    TrigB.Equ_So = 2
    TrigB.Intr_Equ = 0
    TrigB.Intr_Time = 0
    TrigB.Intr_Range = 0
    TrigB.Range_Max = 15
    TrigB.Range_Min = 0
    TrigB.Range_Sh = 1
    TrigB.Range_Mo = 0
    TrigB.Time_Max = 10
    TrigB.Time_Min = 1
    TrigB.Time_Mo = 0
    
    bRe = DevConnect(nCurDev)
    If bRe Then
        InitDevice (nCurDev)
        Result = Set_Sample_Rate(nCurDev, nSampleRate)
        Result = Set_SampleDepth(nCurDev, nSampleDepth)
        Result = Set_PWMV(nCurDev, dbThresholdA, dbThresholdB)
        Result = Set_Pre_Tri(nCurDev, nHTrigPos)
        Result = Set_Trig_En(nCurDev, nTrigAEnable, nTrigBEnable)
        Result = Set_Tri_Logic(nCurDev, nLogic)
        Result = Set_Trig_Parameter(nCurDev, 0, TrigA)
        Result = Set_Trig_Parameter(nCurDev, 1, TrigB)

    Else
        MsgBox ("No device was found!")
    End If
    
    
    MainForm.Show
    
End Sub
