agilent 的E5062A 通过GPIB来实现和PC的通信 并将测试数据保存
如题 我是新手 也是刚注册了CSDN 希望各位大虾能给我点帮助我也没什么分非常抱歉
主要是没有头绪 不知道该怎么下手 我的QQ 553458751 Email 528817131@163.com
对了 是要用VB做 --------------------编程问答-------------------- 补充一下
Private Sub cmdStart_Click()
Dim Dmy As Long
Dim rs As New ADODB.Recordset
'Single Trigger Instrument
SCPI.TRIGger.SEQuence.Source = "bus"
SCPI.INITiate(1).CONTinuous = True
'Set the Global Pass or Fail
gAbort = False
If gTuneMode = False Then
gAbort = True
End If
Do
gPF = True
'Get the parameter
SCPI.TRIGger.SEQuence.Single
Dmy = SCPI.IEEE4882.OPC
SCPI.DISPlay.ENABle = False
lstResult.Clear
' Measure Insertion Loss
strOpenString = "SELECT * FROM InsertionLoss where name='" & gName & "'"
Call rs.Open(strOpenString, gConn, adOpenKeyset, adLockOptimistic, adCmdText)
If rs.RecordCount > 0 Then
rs.MoveFirst
Do While Not (rs.EOF)
Call Meas_IL(rs!StartFreq, rs!StopFreq, rs!Min, rs!Max)
rs.MoveNext
Wait (0.1)
Loop
End If
rs.Close
' Measure Rejection
strOpenString = "SELECT * FROM Rejection where name='" & gName & "'"
Call rs.Open(strOpenString, gConn, adOpenKeyset, adLockOptimistic, adCmdText)
If rs.RecordCount > 0 Then
rs.MoveFirst
Do While Not (rs.EOF)
Call Meas_Rejection(rs!StartFreq, rs!StopFreq, rs!Min, rs!Max, rs!Marker)
rs.MoveNext
Wait (0.1)
Loop
End If
rs.Close
SCPI.DISPlay.Update.IMMediate
If gPF = True Then
lblPF.Caption = "PASS"
lblPF.ForeColor = vbGreen
Else
lblPF.Caption = "FAIL"
lblPF.ForeColor = vbRed
End If
Loop Until gAbort = True
End Sub
Private Sub cmdStop_Click()
gAbort = True
End Sub
Private Sub UserForm_Activate()
gAbort = False
lblPF.Caption = " "
End Sub
Public Function Meas_IL(StartFreq As String, StopFreq As String, Min As String, Max As String) As Boolean
Dim result As Variant
'User Search
SCPI.CALCulate(1).Selected.Marker(1).STATe = True
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.STARt = StartFreq * 1000000#
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.STOP = StopFreq * 1000000#
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.STATe = True
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.COUPle = False
SCPI.CALCulate(1).Selected.Marker(1).Function.Type = "MAX"
SCPI.CALCulate(1).Selected.Marker(1).Function.EXECute
result = SCPI.CALCulate(1).Selected.Marker(1).Y
If result(0) > CDbl(Min) And result(0) < (CDbl(Max)) Then
Meas_IL = True
lstResult.AddItem "IL" & " " & Round(result(0), 2) & " " & "P"
Else
Meas_IL = False
gPF = False
lstResult.AddItem "IL" & " " & Round(result(0), 2) & " " & "F"
End If
End Function
Public Function Meas_Rejection(StartFreq As String, StopFreq As String, Min As String, Max As String, Marker As String) As Boolean
Dim RejectResult As Variant
Dim MarkResult As Variant
Dim Rej As Double
'User Search
SCPI.CALCulate(1).Selected.Marker(1).STATe = True
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.STARt = StartFreq * 1000000#
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.STOP = StopFreq * 1000000#
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.STATe = True
SCPI.CALCulate(1).Selected.Marker(1).Function.DOMain.COUPle = False
SCPI.CALCulate(1).Selected.Marker(1).Function.Type = "MAX"
SCPI.CALCulate(1).Selected.Marker(1).Function.EXECute
RejectResult = SCPI.CALCulate(1).Selected.Marker(1).Y
'Get the Marker Result
SCPI.CALCulate(1).Selected.Marker(1).STATe = True
SCPI.CALCulate(1).Selected.Marker(1).X = Marker * 1000000#
MarkResult = SCPI.CALCulate(1).Selected.Marker(1).Y
Rej = RejectResult(0) - MarkResult(0)
If Rej > CDbl(Min) And Rej < (CDbl(Max)) Then
Meas_Rejection = True
lstResult.AddItem "RJ" & " " & Round(Rej, 2) & " " & "P"
Else
Meas_Rejection = False
lstResult.AddItem "RJ" & " " & Round(Rej, 2) & " " & "F"
gPF = False
End If
End Function
这个程序是用来干嘛的
如果可以 能不能帮我注册一下
补充:VB , VBA