Sample Calibration Program
5-46
TDS5000B Series Service Manual
’ Subroutine to turn off the buttons that will not work during the current
’ calibration step.
Private Sub turnOffButtons()
cmdPlay.Enabled = False
cmdExit.Enabled = False
End Sub
’ Subroutine to handle the Exit button.
’ This button is only available during single step mode or before calibration
’ has started.
Private Sub cmdExit_Click()
End
End Sub
’ Subroutine to handle the Next step.
Private Sub cmdNextStep()
Dim strResult As String
turnOffButtons
setWaveTek
TvcScope.WriteString ”:CALIBRATE:FACTORY CONTINUE”
If tekScopeOPC = False Then
Debug.Print ”factory calibration step did not complete”
Exit Sub
End If
Sleep 1000
strResult = TvcScope.Query(”:CALIBRATE:FACTORY:STEPSTATUS?”)
If Left(strResult, 4) = ”PASS” Then
lstOutput.AddItem ”Passed step ” + reqStepName
calPassedLastStep = True
Sleep 1000
strResult = TvcScope.Query(”CALIBRATE:FACTORY:STEPSTIMULUS?”)
updateSignal (strResult)
Debug.Print strResult
Else
If calPassedLastStep = False Then
calFailed = True
calInitDone = False
Else
Debug.Print ”Will retry last step”
End If
lstOutput.AddItem ”Failed step ” + reqStepName
calPassedLastStep = False
End If
lstOutput.ListIndex = lstOutput.ListCount - 1
turnOnButtons
End Sub
’ Subroutine to handle the Play button.
’ This will place the TDS5000B in factory calibration mode and if single step
’ mode is not active repeatedly do next step until calibration is complete.