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

📄 testerverification.frm

📁 通过VB, GPIB协议控制测试仪器, 实现测试自动化, 这个行业的人才有些缺乏, 本人愿意分享
💻 FRM
📖 第 1 页 / 共 5 页
字号:
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   240
      TabIndex        =   31
      Top             =   6600
      Width           =   2535
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "参考测试结果文件"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   6600
      TabIndex        =   10
      Top             =   2640
      Width           =   1440
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "综测仪GPIB/COM地址:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   6600
      TabIndex        =   8
      Top             =   1080
      Width           =   1890
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "综测仪选择"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   6600
      TabIndex        =   6
      Top             =   360
      Width           =   900
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Paging IMSI 设置"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   6600
      TabIndex        =   4
      Top             =   1800
      Width           =   1275
   End
   Begin VB.Label labResultTitle 
      AutoSize        =   -1  'True
      Caption         =   "序号  测试项目                 测试值"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   195
      Left            =   240
      TabIndex        =   2
      Top             =   240
      Width           =   2775
   End
   Begin VB.Menu mnuAbout 
      Caption         =   "须知"
      Begin VB.Menu mnuManual 
         Caption         =   "操作"
      End
      Begin VB.Menu mnuHelp 
         Caption         =   "About"
      End
   End
End
Attribute VB_Name = "Tester"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'Example 6:  Using subsystem functions (Visual Basic)


'***************************************************************************
'* age1960 Instrument Driver EXAMPLE #6 for Visual Basic
' Copyright (c) 1999-2001 Agilent Technologies
'---------------------------------------------------------------------------
' Example Visual Basic program for E1960A GSM mobile test for 8960
' Series 10 E5515 P&P driver.
' Revision: A.03.00

' This program demonstrates how to communicate with the E1960A
' using the Plug&Play driver to test a GSM mobile phone.
'
' Requires a form named age1960Demo
'          a CommandButton named cmdStartTest with visible set to False
'          a CommandButton named cmdExit
'          a CommandButton named cmdOpen

'          a Textbox named txtResult with MultiLine set to True
'                                     and ScrollBars set to 2-Vertical
'           Also add the module age1960.bas from the vxipnp/winXX/include
'           directory. You may also need to UNcomment out the lines at the
'           top of the .bas file if other VISA includes do not specify
'           VI_TRUE etc.
'
' Adjust the constants PATH_LOSS, PATH_LOSS_FREQ, CELL_POWER_HIGH and

' CELL_POWER_LOW for your testing needs.
'***************************************************************************

Option Explicit

Const FILE_FILTE_STR = "Text Excel file (*.csv)|*.csv"
Const MaxEGSMTxPower = 33
Const MaxDCSTxPower = 30
Const MaxPeakPhaseError = 20
Const MaxRMSPhaseError = 5
Const MaxFreqErr_EGSM = 90
Const MaxFreqErr_DCS = 180
Const RxLevelTolerance = 2
Const MaxBitErrorRate = 2.4
Const MaxFrameErrorRate = 0.12

Dim vi As Long
Private Const INST_ADDRESS = 14
Private Const CELL_POWER_HIGH = -50
Private Const CELL_POWER_MEDIUM = -70
Private Const CELL_POWER_LOW = -90
Private Const PATH_LOSS = -15
Private Const PATH_LOSS_FREQ = 896000000#
Private Const CELL_POWER_BER = -102

Dim iTestNo As Integer
Dim giTestChan(0 To 17) As Integer
Dim giTestPCL(0 To 17) As Integer
Dim giPVTTestChan(0 To 3) As Integer
Dim giPVTTestPCL(0 To 3) As Integer
Dim giSACCHTestCellPower(0 To 4) As Integer
Dim giSACCHTestChan(0 To 9) As Integer
Dim giBERTestChan(0 To 5) As Integer
Dim giBERTestPCL(0 To 5) As Integer

Dim ModSpectrumOffset(0 To 32) As Double
Dim ModSpectrumValue(0 To 32) As Double
Dim SwitchSpectrumOffset(0 To 32) As Double
Dim SwitchSpectrumValue(0 To 32) As Double
Dim PVTTimeOffset(0 To 12) As Double
Dim PowerVsTimeValue(0 To 50) As Double

Dim TargetTxPower_EGSM(5 To 19) As Single
Dim TxPowerTolerance_EGSM(5 To 19) As Single
Dim TargetTxPower_DCS(0 To 15) As Single
Dim TxPowerTolerance_DCS(0 To 15) As Single

Dim PVTRange(0 To 23) As Single
Dim ModRange_EGSM(0 To 21) As Single
Dim ModRange_DCS(0 To 21) As Single
Dim SwitchRange(0 To 7) As Single
'Dim SwitchRange_EGSM(0 To 7) As Double
'Dim SwitchRange_DCS(0 To 7) As Double
Dim TxPowerOffset As Single
Dim FreqErrOffset As Single
Dim PeakPhaseErrOffset As Single
Dim RMSPhaseErrOffset As Single
Dim PVTLevelOffset As Single
Dim ORFSLevelOffset As Single
Dim BEROffset As Single
Dim RxLevelOffset As Single
Dim RxQualityOffset As Single

Dim sn As String
Dim IDMessage As String
Dim MSSampleNo As String

Dim bFinalPass As Boolean

Dim RefMSSampleNo As String
Dim RefValue(1 To 500) As String
Dim bLoadRefFile As Boolean
'Dim sTestResults As String

Dim bCompareTest As Boolean
Dim bStopAtError As Boolean
Dim bRepeatTest As Boolean



Private Sub chkCompareTest_Click()
If chkCompareTest.Value = 0 Then
    labResultTitle.Caption = "序号  测试项目 =,              测试值,   下限,   上限,   结果"
Else
    labResultTitle.Caption = "序号  测试项目 =,              测试值,   参考值,   误差,   误差范围    结果"
End If
End Sub

Private Sub cmdExit_Click()
'------------------------------------------------
' Close the session and exit the program

'------------------------------------------------

    Call age1960_close(vi)  ' don't need the error status this time, if the
                            ' session has not been opened this would return
                            ' an error, but we don't care since we are terminating
    End

End Sub

Private Sub Preset_8960()
'------------------------------------------------
' Open the session and preset the test set
'------------------------------------------------

    
    Dim ErrorStatus As Long
    Dim DriverRevision As String * 50
    Dim InstRevision As String * 50
    Dim errorMessage As String * 256
    Dim ReturnString As String * 80
    Dim message As String
    ' Clear the text in the results window

 
    ' Open the session with instrument at address 14
    ' with instrument full reset and *IDN? query
    ErrorStatus = age1960_init("GPIB0::" & Trim(Str(INST_ADDRESS)), VI_TRUE, VI_TRUE, vi)
    If VI_SUCCESS > ErrorStatus Then

        If vi <> VI_NULL Then
            Call age1960_error_message(vi, ErrorStatus, errorMessage)
            message = "Unable to open " & "GPIB0::" & Trim(Str(INST_ADDRESS)) & vbCr
            message = message + "age1960_init() returned message: " & errorMessage

            MsgBox message
            Exit Sub
        Else
            message = "Unable to open " & "GPIB0::" & Trim(Str(INST_ADDRESS)) & vbCr
            message = message + "age1960_init() returned code: " & Str(ErrorStatus)

            MsgBox message
            Exit Sub
        End If
    End If
    
    ' Clear any error that are in the error query buffer
    ErrorStatus = age1960_cmd(vi, "*CLS")
    If CheckError(ErrorStatus) = True Then Exit Sub
        

    ' Enable instrument error detection
    ErrorStatus = age1960_errorQueryDetect(vi, 1)
    If CheckError(ErrorStatus) = True Then Exit Sub

    ' Set a 10s timeout for the driver
    ErrorStatus = age1960_timeOut(vi, 20000)

    If CheckError(ErrorStatus) = True Then Exit Sub

    ' Read the driver and instrument revision
    ErrorStatus = age1960_revision_query(vi, DriverRevision, InstRevision)
    If CheckError(ErrorStatus) = True Then Exit Sub
    
    PrintInfo ("Driver Revision =, " & StrEnd(DriverRevision))

    PrintInfo ("Instrument Revision =, " & StrEnd(InstRevision))
    
    ' read the ID information
    ErrorStatus = age1960_cmdString_Q(vi, "*IDN?", Len(ReturnString), ReturnString)

    If CheckError(ErrorStatus) = True Then Exit Sub
    PrintInfo (StrEnd(ReturnString))
    
    IDMessage = StringReplace(StrEnd(ReturnString), ",", ";")
    sn = Left(IDMessage, FindCharR(";", IDMessage) - 1)
    sn = Right(sn, 10)
    ' Turn on the start test key and turn off the open session key
    cmdStartTest.Visible = True
    'cmdOpen.Visible = False

    
End Sub

Private Sub cmdStartTest_Click()
'------------------------------------------------
' Perform a demo test with the test set
'------------------------------------------------
    
    Dim ErrorStatus As Long
'    Dim Array1(0 To 3000) As Double ' start the arrays a 0 to be equivalent to
'    Dim Array2(0 To 50) As Double ' the C example
    Dim i As Integer
    Dim j As Integer
    Dim ReturnString As String * 256
    Dim TestChannel As Long
    Dim TXLevel As Long
    Dim iTest As Integer

    Dim Integrity As Long
    Dim MeasFcns(0 To 7) As Integer
    Dim MeasFcnDone As Integer
    Dim dblResults1 As Double
    Dim dblResults2 As Double
    Dim dblResults3 As Double
    Dim dblResults4 As Double
    Dim dblResults5 As Double
    Dim dblResults6 As Double

⌨️ 快捷键说明

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