TDR/TDT Measurement

Overview

This sample program demonstrates how to perform TDR/TDT setup.

Sample Program in Excel VBA (VISA-COM)

 

Global variables

    Dim rm As VisaComLib.ResourceManager

    Dim ENATDR As VisaComLib.FormattedIO488

    Dim NumDmy As Integer

 

TDR-TDT Measurement

Sub TDRTDTMeasure()

    On Error GoTo errorhandler

    Set rm = New VisaComLib.ResourceManager

    Set ENATDR = New VisaComLib.FormattedIO488

   

    ' TDR address is not necessary to change.

    Set ENATDR.IO = rm.Open("TCPIP0::localhost::inst0::INSTR")

    ENATDR.IO.Timeout = 50000

    

    ' Clear Excel Sheet Cells

    Range("F5:F5").ClearContents

         

    With ENATDR

        'Preset the ENA

        .WriteString ":SYST:PRES"

        'TDR Trigger Hold

        .WriteString ":TRIG:MODE HOLD"

      

        ' Set DUT Topology to Differential 2-Port

        .WriteString ":CALC:DEV DIF2"

        .WriteString "*OPC?"

         NumDmy = .ReadNumber

        ' Execute Deskew (Deskew & Loss)

        MsgBox "[Deskew] Disconnect the cables from DUT to make open condition.", vbOKOnly

        .WriteString ":SENS:CORR:EXT:AUTO:STAN OPEN"

        .WriteString ":SENS:CORR:EXT:AUTO:PORT1 ON"

        .WriteString ":SENS:CORR:EXT:AUTO:PORT2 ON"

        .WriteString ":SENS:CORR:EXT:AUTO:PORT3 ON"

        .WriteString ":SENS:CORR:EXT:AUTO:PORT4 ON"

        .WriteString ":SENS:CORR:EXT:AUTO:IMM"

        .WriteString "*OPC?"

         NumDmy = .ReadNumber

        ' Execute Thru Measurement: Connect a Thru between Port 1 and Port 3

        MsgBox "Connect a Thru between Port 1 and Port 3.", vbOKOnly

        .WriteString ":SENS:CORR:COLL:DLC:THRU TH13"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        ' Execute Thru Measurement: Connect a Thru between Port 2 and Port 4

        MsgBox "Connect a Thru between Port 2 and Port 4.", vbOKOnly

        .WriteString ":SENS:CORR:COLL:DLC:THRU TH24"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        

        ' Measure Load: Connect a Load to Port 1

        MsgBox "Connect a Load to Port 1.", vbOKOnly

        .WriteString ":SENS:CORR:COLL:DLC:LOAD 1"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        ' Measure Load: Connect a Load to Port 2

        MsgBox "Connect a Load to Port 2.", vbOKOnly

        .WriteString ":SENS:CORR:COLL:DLC:LOAD 2"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        ' Measure Load: Connect a Load to Port 3

        MsgBox "Connect a Load to Port 3.", vbOKOnly

        .WriteString ":SENS:CORR:COLL:DLC:LOAD 3"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        ' Measure Load: Connect a Load to Port 4

        MsgBox "Connect a Load to Port 4.", vbOKOnly

        .WriteString ":SENS:CORR:COLL:DLC:LOAD 4"

         ' Save the result of loss compensation

        .WriteString ":SENS:CORR:COLL:DLC:SAVE"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

   

        'Measure DUT Length

        MsgBox "Connect the DUT to the cables.", vbOKOnly

        .WriteString ":SENS:DLEN:AUTO:IMM"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        'Set Rise Time

        .WriteString ":CALC:TRAC1:TIME:STEP:RTIM:DATA 35E-12"

        .WriteString ":CALC:TRAC3:TIME:STEP:RTIM:DATA 35E-12"

        .WriteString ":CALC:TRAC5:TIME:STEP:RTIM:DATA 35E-12"

        .WriteString ":CALC:TRAC7:TIME:STEP:RTIM:DATA 35E-12"

        'Set Definition

        .WriteString ":CALC:TRAC1:TIME:STEP:RTIM:THR T1_9"

        .WriteString ":CALC:TRAC3:TIME:STEP:RTIM:THR T1_9"

        .WriteString ":CALC:TRAC5:TIME:STEP:RTIM:THR T1_9"

        .WriteString ":CALC:TRAC7:TIME:STEP:RTIM:THR T1_9"

        .WriteString ":TRIG:SING"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

        

        'Set Auto Scale for all traces

        .WriteString ":DISP:ATR:SCAL:AUTO"

        .WriteString "*OPC?"

        NumDmy = .ReadNumber

 

         'Read Rise Time

        .WriteString ":CALC:TRAC3:TTIM:STAT ON"       

        .WriteString ":CALC:TRAC3:TTIM:THR T1_9"

        .WriteString ":CALC:TRAC3:TTIM:DATA?"

        Cells(5, 6) = .ReadNumber

             

        MsgBox "TDT/TDT Measurement Setup is completed.", vbOKOnly

    End With

    ENATDR.IO.Close

    Exit Sub

 

errorhandler:

    MsgBox Err.Description, vbExclamation, "Error Occurred", Err.HelpFile, Err.HelpContext

    

End Sub