⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testerverification.frm

📁 通过VB, GPIB协议控制测试仪器, 实现测试自动化, 这个行业的人才有些缺乏, 本人愿意分享
💻 FRM
📖 第 1 页 / 共 5 页
字号:
                ErrorStatus = age1960_fetchPFER_Q(vi, _
                                      Integrity, dblResults1, dblResults2, dblResults3)
                If CheckError(ErrorStatus) = True Then Exit Sub
                'PrintInfo (Format_ResultLine(" PFER Integrity" & Str(Integrity)))
                If Integrity <> 0 Then
                    PrintInfo ("Get PFER Value abnormally!")
                    labTestResult.Caption = "Abnormal End"
                    labTestResult.BackColor = &HFF&         'red
                    GoTo LoopEnd
                Else
                    sngLoLimit = 0
                    sngHiLimit = MaxRMSPhaseError
            
                    If dblResults1 >= sngLoLimit And dblResults1 <= sngHiLimit Then
                        itemResult = "PASS"
                    Else
                        itemResult = "FAILxxxxxxxx"
                        bFinalPass = False
                    End If
                    If bCompareTest = True Then
                        PrintInfo (Format_Resultline(" RMS Phase Error", dblResults1, bCompareTest, RMSPhaseErrOffset))
                    Else
                        PrintInfo (Format_Resultline1(" RMS Phase Error =, " & Str(FormatNumber(dblResults1, 2)) & "," & sngLoLimit & "," & sngHiLimit & "," & itemResult))
                    End If
                    
                    sngLoLimit = 0
                    sngHiLimit = MaxPeakPhaseError
            
                    If dblResults2 >= sngLoLimit And dblResults2 <= sngHiLimit Then
                        itemResult = "PASS"
                    Else
                        itemResult = "FAILxxxxxxxx"
                        bFinalPass = False
                    End If
                    If bCompareTest = True Then
                        PrintInfo (Format_Resultline(" Peak Phase Error", dblResults2, bCompareTest, PeakPhaseErrOffset))
                    Else
                        PrintInfo (Format_Resultline1(" RMS Phase Error =, " & Str(FormatNumber(dblResults2, 2)) & "," & sngLoLimit & "," & sngHiLimit & "," & itemResult))
                    End If
                    
                    If giTestChan(iTest) >= 512 And giTestChan(iTest) <= 885 Then
                        sngLoLimit = -1 * MaxFreqErr_DCS
                        sngHiLimit = MaxFreqErr_DCS
               
                    Else
                        sngLoLimit = -1 * MaxFreqErr_EGSM
                        sngHiLimit = MaxFreqErr_EGSM
            
                    End If
                    If dblResults3 >= sngLoLimit And dblResults3 <= sngHiLimit Then
                        itemResult = "PASS"
                    Else
                        itemResult = "FAILxxxxxxxx"
                        bFinalPass = False
                    End If
                    If bCompareTest = True Then
                        PrintInfo (Format_Resultline(" Frequency Error", dblResults3, bCompareTest, FreqErrOffset))
                    Else
                        PrintInfo (Format_Resultline1(" RMS Phase Error =, " & Str(FormatNumber(dblResults3, 2)) & "," & sngLoLimit & "," & sngHiLimit & "," & itemResult))
                    End If
                End If
            End If

            If MeasFcnDone = age1960_ORFS Then
                ErrorStatus = age1960_fetchORFS_Q(vi, _
                                      8, 22, Integrity, dblResults1, _
                                      dblResults2, SwitchSpectrumValue(0), ModSpectrumValue(0), _
                                      ItemsMeasured1, ItemsMeasured2)
                                      'dblResults2, Array1(0), Array2(0), _'
                If CheckError(ErrorStatus) = True Then Exit Sub
                'PrintInfo (Format_ResultLine(" ORFS Integrity" & Str(Integrity)))
                If Integrity <> 0 Then
                    PrintInfo ("Get ORFS Value abnormally!")
                    labTestResult.Caption = "Abnormal End"
                    labTestResult.BackColor = &HFF&         'red
                    GoTo LoopEnd
                Else
                    For i = 0 To ItemsMeasured1 - 1
                        PrintInfo (Format_Resultline(" ORFS Switching offset:" & Str(SwitchSpectrumOffset(i) / 1000) & "KHz", SwitchSpectrumValue(i), bCompareTest, ORFSLevelOffset))
                    Next
                    For i = 0 To ItemsMeasured2 - 1
                        PrintInfo (Format_Resultline(" ORFS Mod offset:" & Str(ModSpectrumOffset(i) / 1000) & "KHz", ModSpectrumValue(i), bCompareTest, ORFSLevelOffset))
                    Next
                End If
            End If

            If MeasFcnDone = age1960_BER Then
                 ErrorStatus = age1960_fetchBER_Q(vi, Integrity, dblResults1, _
                                       dblResults2, dblResults3, dblResults4, _
                                       dblResults5, dblResults6, dblResults7, _
                                       dblResults8, dblResults9)
                If CheckError(ErrorStatus) = True Then Exit Sub
                'PrintInfo ("   BER Integrity" & Str(Integrity))
                If Integrity <> 0 Then
                    PrintInfo ("Get BER measurement Value abnormally!")
                    labTestResult.Caption = "Abnormal End"
                    labTestResult.BackColor = &HFF&         'red
                    GoTo LoopEnd
                Else
                    PrintInfo ("   Typela BER Rate" & Str(FormatNumber(dblResults2, 2)))
                    PrintInfo ("   Typelb BER Rate" & Str(FormatNumber(dblResults5, 2)))
                    PrintInfo ("   TypeII BER Rate" & Str(FormatNumber(dblResults8, 2)))
                    ErrorStatus = age1960_cmd(vi, "INIT:BERR:OFF")
                End If
            End If

        Loop

    Next 'TestChannel

'-------------------------------------------------
    ' measure the mobile TX power at the different TX level settings.
        ' Configure the cell band
        ErrorStatus = age1960_TCHBand(vi, age1960_EGSM_BAND)
        If CheckError(ErrorStatus) = True Then Exit Sub
        TimeDelay (500)
        
        ' Set the TCH Channel.
        PrintInfo ("Change to Traffic Channel = 62")
        ErrorStatus = age1960_TCHARFCN(vi, 62, age1960_CURRENT_BAND, VI_TRUE)

        If CheckError(ErrorStatus) = True Then Exit Sub
        
        TimeDelay (500)
    ' measure the mobile TX power at the different TX level settings.
    For TXLevel = 5 To 19
        ' Set the moble to the desired TX level

        ErrorStatus = age1960_MSTXLevel(vi, TXLevel, age1960_CURRENT_BAND, VI_TRUE)
        If CheckError(ErrorStatus) = True Then Exit Sub
        
        TimeDelay (1000)

        ' Range the test set and read the TX Power.
        ErrorStatus = age1960_readTXPower_Q(vi, VI_TRUE, Integrity, dblResults1)

        If CheckError(ErrorStatus) = True Then Exit Sub
        If Integrity <> 0 Then
            PrintInfo ("Get Tx Power Value abnormally!")
            labTestResult.Caption = "Abnormal End"
            labTestResult.BackColor = &HFF&         'red
            GoTo LoopEnd
        Else
            sngLoLimit = TargetTxPower_EGSM(TXLevel) - TxPowerTolerance_EGSM(TXLevel)
            sngHiLimit = TargetTxPower_EGSM(TXLevel) + TxPowerTolerance_EGSM(TXLevel)
            
            If dblResults1 >= sngLoLimit And dblResults1 <= sngHiLimit Then
                itemResult = "PASS"
            Else
                itemResult = "FAILxxxxxxxx"
                bFinalPass = False
            End If
            If bCompareTest = True Then
                PrintInfo (Format_Resultline(" Tx Power @ MS Control level_" & Str(TXLevel), dblResults1, bCompareTest, TxPowerOffset))
            Else
                PrintInfo (Format_Resultline1(" Tx Power @ MS Control level_" & Str(TXLevel) & "  =, " & Str(FormatNumber(dblResults1, 2)) & "," & sngLoLimit & "," & sngHiLimit & "," & itemResult))
            End If
        End If
    Next TXLevel
    
        ' Configure the cell band
        ErrorStatus = age1960_TCHBand(vi, age1960_DCS1800_BAND)
        If CheckError(ErrorStatus) = True Then Exit Sub
        TimeDelay (500)
        
        ' Set the TCH Channel.
        PrintInfo ("Present test channel = 698")
        ErrorStatus = age1960_TCHARFCN(vi, 698, age1960_CURRENT_BAND, VI_TRUE)

        If CheckError(ErrorStatus) = True Then Exit Sub
        
        TimeDelay (500)
    ' measure the mobile TX power at the different TX level settings.
    For TXLevel = 0 To 15
        ' Set the moble to the desired TX level

        ErrorStatus = age1960_MSTXLevel(vi, TXLevel, age1960_CURRENT_BAND, VI_TRUE)
        If CheckError(ErrorStatus) = True Then Exit Sub
        
        TimeDelay (1000)

        ' Range the test set and read the TX Power.
        ErrorStatus = age1960_readTXPower_Q(vi, VI_TRUE, Integrity, dblResults1)

        If CheckError(ErrorStatus) = True Then Exit Sub
        If Integrity <> 0 Then
            PrintInfo ("Get Tx Power Value abnormally!")
            labTestResult.Caption = "Abnormal End"
            labTestResult.BackColor = &HFF&         'red
            GoTo LoopEnd
        Else
            sngLoLimit = TargetTxPower_DCS(TXLevel) - TxPowerTolerance_DCS(TXLevel)
            sngHiLimit = TargetTxPower_DCS(TXLevel) + TxPowerTolerance_DCS(TXLevel)
            
            If dblResults1 >= sngLoLimit And dblResults1 <= sngHiLimit Then
                itemResult = "PASS"
            Else
                itemResult = "FAILxxxxxxxx"
                bFinalPass = False
            End If
            If bCompareTest = True Then
                PrintInfo (Format_Resultline(" Tx Power @ MS Control level_" & Str(TXLevel), dblResults1, bCompareTest, TxPowerOffset))
            Else
                PrintInfo (Format_Resultline1(" Tx Power @ MS Control level_" & Str(TXLevel) & "  =, " & Str(FormatNumber(dblResults1, 2)) & "," & sngLoLimit & "," & sngHiLimit & "," & itemResult))
            End If
            
        End If
    Next TXLevel
    
'-------------------------------------------------------------------------
    ErrorStatus = age1960_cmd(vi, "INIT:PFER:OFF")
    ErrorStatus = age1960_cmd(vi, "INIT:TXP:OFF")

'Read PVT 12 point time offset values
    
    For iTest = 0 To UBound(giPVTTestChan)
        If giPVTTestChan(iTest) >= 512 And giPVTTestChan(iTest) <= 885 Then
        ' Configure the cell band
            ErrorStatus = age1960_TCHBand(vi, age1960_DCS1800_BAND)
        Else
            ErrorStatus = age1960_TCHBand(vi, age1960_EGSM_BAND)
        End If
        If CheckError(ErrorStatus) = True Then Exit Sub
        TimeDelay (500)
        
        'PrintInfo ("Present test channel = " & Str(gipvttestchan(iTest)))
        ' Set the TCH Channel.
        ErrorStatus = age1960_TCHARFCN(vi, giPVTTestChan(iTest), age1960_CURRENT_BAND, VI_TRUE)

        If CheckError(ErrorStatus) = True Then Exit Sub
        TimeDelay (500)
        
        ' Set the MS TX level.
        ErrorStatus = age1960_MSTXLevel(vi, giPVTTestPCL(iTest), age1960_CURRENT_BAND, VI_TRUE)
        If CheckError(ErrorStatus) = True Then Exit Sub
        
        PrintInfo ("Set Traffic Channel = " & Str(giPVTTestChan(iTest)) & " and MS Power Control Level = " & Str(giPVTTestPCL(iTest)))
        TimeDelay (1000)
        
' Start the desired concurrent measurements


        ' Start concurrent measurements
        MeasFcns(0) = age1960_PVTIME
        'MeasFcns(1) = age1960_PFER
        MeasFcns(1) = age1960_ORFS
        'MeasFcns(3) = age1960_BER
        ErrorStatus = age1960_initMeasFcns(vi, 2, MeasFcns(0))
        If CheckError(ErrorStatus) = True Then Exit Sub

'-------------------------------------------------
' Fetch the results when they become available

        ' Wait for measurement to complete then fetch the results

        ' Measured results are not printed in this example
        Do
            ErrorStatus = age1960_waitForInitDone_Q(vi, 10, MeasFcnDone)
            If CheckError(ErrorStatus) = True Then Exit Sub

            If MeasFcnDone = age1960_NONEINIT Then Exit Do

            If MeasFcnDone = age1960_PVTIME Then
                ErrorStatus = age1960_fetchPowerVsTime_Q(vi, _
                                      50, Integrity, dblResults1, _
                                      dblResults2, PowerVsTimeValue(0), ItemsMeasured1)

               If CheckError(ErrorStatus) = True Then Exit Sub
                'PrintInfo (Format_ResultLine(" Power vs Time Integrity" & Str(Integrity)))
               If Integrity <> 0 Then
                    PrintInfo ("Get Power vs Time Value abnormally!")
                    labTestResult.Caption = "Abnormal End"
                    labTestResult.BackColor = &HFF&         'red
                    GoTo LoopEnd
                Else
'                   PrintInfo ("   Power vs Time Tx Power" & Str(dblResults2))
'                    If dblResults1 <> 0 Then
'                        bFinalPass = False
'                    End If
'                    PrintInfo (Format_Resultline(" Power vs Time Mask Status", IIf(dblResults1, "FAIL", "PASS"), bCompareTest, dblResults1))
                                        sngLoLimit = 0
                    sngHiLimit = 0
            
                    If dblResults1 >= sngLoLimit And dblResults1 <= sngHiLimit Then
                        itemResult = "PASS"
                    Else
                        itemResult = "FAILxxxxxxxx"
                        bFinalPass = False
                    End If
                    If bCompareTest = True Then
                        PrintInfo (Format_Resultline(" Power vs Time Mask Status ", dblResults1, bCompareTest, 0))
                    Else
                        PrintInfo (Format_Resultline1(" Power vs Time Mask Status =, " & dblResults1 & "," & sngLoLimit & "," & sngHiLimit & "," & itemResult))
                    End If

                    For i = 0 To ItemsMeasured1 - 1
                        If PowerVsTimeValue(i) >= PVTRange(2 * i) And PowerVsTimeValue(i) <= PVTRange(2 * i + 1) Then
                            itemResult = "PASS"
                        Else
                            itemResult = "FAILxxxxxxxx"
                            bFinalPass = False
                        End If
                        If bCompareTest = False Then
                            PrintInfo (Format_Resultline1(" PVT Time Offset:" & Str(PVTTimeOffset(i) * 1000000) & "uS =, " & Str(FormatNumber(PowerVsTimeValue(i), 2))) & "," & PVTRange(2 * i) & "," & PVTRange(2 * i + 1) & "," & itemResult)
                        Else
                            If PowerVsTimeValue(i) > -3 Then
                                tempOffset = PVTLevelOffset
                            ElseIf PowerVsTimeValue(i) > -30 Then
                                tempOffset = 2
                            Else
                                tempOffset = CSng(txtORFSLevelOffsetLow.Text) '5
                            End If
                            
                            PrintInfo (Format_Resultline(" PVT Time Offset:" & Str(PVTTimeOffset(i) * 1000000) & "uS", PowerVsTimeValue(i), bCompareTest, tempOffset))
                        End If
                    Next
                End If
            End If

'            If MeasFcnDone = age1960_PFER Then
'                ErrorStatus = age1960_fetchPFER_Q(vi, _
'                                      Integrity, dblResults1, dblResults2, dblResults3)
'                If CheckError(ErrorStatus) = True Then Exit Sub
'                PrintInfo ("   PFER Integrity = " & Str(Integrity))
'                PrintInfo ("   RMS Phase Error = " & Str(dblResults1))
'                PrintInfo ("   Peak Phase Error = " & Str(dblResults2))
'                PrintInfo ("   Frequency Error = " & Str(dblResults3))

'            End If

            If MeasFcnDone = age1960_ORFS Then
                ErrorStatus = age1960_fetchORFS_Q(vi, _
                                      8, 22, Integrity, dblResults1, _
                                      dblResults2, SwitchSpectrumValue(0), ModSpectrumValue(0), _
                                      ItemsMeasured1, ItemsMeasured2)
                                      'dblResults2, Array1(0), Array2(0), _'
                If CheckError(ErrorStatus) = True Then Exit Sub
                'PrintInfo (For

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -