def RunTDRTest(): # must call EPLInitTDR procedures to use this call SavedLinkStatus = epl.EPLInitTDR(portHandle) print "\n EPLRunTDR():" # First we must create a TDR Request object and fill it in Request = epl.TDR_RUN_REQUEST() Request.sendPairTx = TRUE Request.reflectPairTx = TRUE Request.use100MbTx = TRUE Request.txPulseTime = 1 Request.detectPosThreshold = TRUE Request.rxDiscrimStartTime = 0 Request.rxDiscrimStopTime = 64 Request.rxThreshold = 0x30 result, rResults = epl.EPLRunTDR(portHandle, Request) # Results a TDR_RUN_RESULTS structure print " Results: " print " thresholdMet, thresholdTime, peakValue, peakTime, adjustedPeakLengthRaw" for n in range(2): print " %3d, %3d, %3d, %3d, %3d" % ( rResults.thresholdMet, rResults.thresholdTime, rResults.peakValue, rResults.peakTime, rResults.adjustedPeakLengthRaw) # destroy the results structure since we don't need it anymore del rResults # must call EPLDeinitTDR procedures to use wrap things up epl.EPLDeinitTDR(portHandle, SavedLinkStatus) return
def LongTDRPulseRunTest(): # must call EPLInitTDR procedures to use this call SavedLinkStatus = epl.EPLInitTDR(portHandle) print "\n EPLLongTDRPulseRun:" result, pResults = epl.EPLLongTDRPulseRun(portHandle, TRUE, TRUE, 0x30, FALSE) # pResults[2] will be lists of TDR_RUN_RESULTS. The list will contain 2 TDR_RUN_RESULTS # The list objects are created in the call and must be deleted when we are done with them. print " result %d" % (result) print "\n Positive Results: " print " [nn] thresholdMet, thresholdTime, peakValue, peakTime, adjustedPeakLengthRaw" for n in range(2): print " [%02d] %4d, %4d, %4d, %4d, %4d" % ( n, pResults[n].thresholdMet, pResults[n].thresholdTime, pResults[n].peakValue, pResults[n].peakTime, pResults[n].adjustedPeakLengthRaw) # Delete the lists now that we are done with them del pResults # must call EPLDeinitTDR procedures to use wrap things up epl.EPLDeinitTDR(portHandle, SavedLinkStatus) return
def InitDeinitTDRTest(): # Init/Deinit procedures must be called for certain other procedures print "\n EPLInitTDR: " SavedLinkStatus = epl.EPLInitTDR(portHandle) print " SavedLinkStatus = %08X " % SavedLinkStatus # Normally you would do work in here... # Must call deinit for each init print "\n EPLDeinitTDR: " epl.EPLDeinitTDR(portHandle, SavedLinkStatus) return
def MeasureTDRBaselineTest(): # must call EPLInitTDR procedures to use this call SavedLinkStatus = epl.EPLInitTDR(portHandle) print "\n EPLShortTDRPulseRun(TRUE):" baseline = epl.EPLMeasureTDRBaseline(portHandle, TRUE) print " TX Baseline: %d " % (baseline) print "\n EPLShortTDRPulseRun(FALSE):" baseline = epl.EPLMeasureTDRBaseline(portHandle, FALSE) print " RX Baseline: %d " % (baseline) # must call EPLDeinitTDR procedures to use wrap things up epl.EPLDeinitTDR(portHandle, SavedLinkStatus) return