PLTS General Program


This Visual Basic program does the following:

Option Explicit

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub btnPLTS_Click()

    

    Dim bPass As Integer, i As Integer

    Dim Err As String

    Dim plotName As String

    Dim zero As String

    Dim one As String

    Dim mean As String

    Dim amplitude As String

    Dim heightMv As String

    Dim heightDb As String

    Dim width As String

    Dim openingFactor As String

    Dim signalToNoise As String

    Dim dutyCycleDist As String

    Dim dutyCycleDistPercentage As String

    Dim riseTime As String

    Dim fallTime As String

    Dim jitterPP As String

    Dim jitterRms As String

    

    btnPLTS.Enabled = False

    StateLabel.Caption = "running..."

    ResultLabel.Caption = ""

    Dim filePath_dut As String, filePath_s4p As String, filePath_mask As String

    

    'filePath_s4p = "I:/source/api/samples/vb/Tx0_Rx0.S4P"

    'filePath_mask = "I:/source/api/samples/vb/TDD21.xml"

    'Create a CPLTSApplicationClass object

    Dim pltsapp As Object

    Dim pltsDoc As Object

    Dim pltsView1 As Object

    

    bPass = 1

    

    Set pltsapp = CreateObject("PLTS.Application") 'step 1

    pltsapp.ShowWindow 3  'step 2

    pltsapp.LoadUserPreferences "Default.prf" 'step 3

    

    'Open or import an existing file

    'pltsapp.OpenFile filePath_dut, EYE_DIFF, pltsDoc, pltsView1

    

    pltsapp.LoadBitPattern "PRBS", 3, 70, "2^7-1", 1100

    

    pltsapp.ImportFile filePath_s4p, EYE_DIFF, pltsDoc, pltsView1, 4, "1|1|<<<<<<|2|3|>>>>>>|3|2|<<<<<<|4|4|>>>>>>|", "1|2P|2|2P|0|UC|0|UC|", "Default 4-Port SOLT Configuration", -1, -1, -1

    pltsapp.GetLastError Err

    

    Sleep 1000

    

    pltsView1.DrawPlot "TDD21"

    

    For i = 1 To 100

        Sleep 50

        StateLabel.Caption = "running... " & i

        DoEvents

    Next i

    

    pltsView1.LoadLimitGroup filePath_mask, bPass

    If bPass = 0 Then

        ResultLabel.Caption = "FAILED"

    Else

        ResultLabel.Caption = "PASS"

    End If

    

    plotName = "TDD21"

    pltsView1.GetEyeMeasureResult plotName, zero, one, mean, amplitude, heightMv, heightDb, width, openingFactor, signalToNoise, dutyCycleDist, dutyCycleDistPercentage, riseTime, fallTime, jitterPP, jitterRms

    List1.List(0) = "zero =" & zero

    List1.List(1) = "one =" & one

    List1.List(2) = "mean =" & mean

    List1.List(3) = "amplitude =" & amplitude

    List1.List(4) = "heightMv =" & heightMv

    List1.List(5) = "heightDb =" & heightDb

    List1.List(6) = "width =" & width

    List1.List(7) = "openingFactor =" & openingFactor

    List1.List(8) = "signalToNoise =" & signalToNoise

    List1.List(9) = "dutyCycleDist =" & dutyCycleDist

    List1.List(10) = "dutyCycleDistPercentage =" & dutyCycleDistPercentage

    List1.List(11) = "riseTime =" & riseTime

    List1.List(12) = "fallTime =" & fallTime

    List1.List(13) = "jitterPP =" & jitterPP

    List1.List(14) = "jitterRms =" & jitterRms

    Set pltsView1 = Nothing

    Set pltsDoc = Nothing

    pltsapp.Exit

    Set pltsapp = Nothing

    

    StateLabel.Caption = "finished"

    

    btnPLTS.Enabled = True

    

End Sub