AnsweredAssumed Answered

About Program E4419B

Question asked by Robin_Lu on Jun 30, 2009
Latest reply on Jul 2, 2009 by odanzy
Now I am programming E4419B to get the Power data outputed by ESG.But I got a error message "VI_ERROR_TMO:A Timeout occured ".Could you help me check the code?Thanks!

Option Explicit
Dim PM As VisaComLib.FormattedIO488

Private Sub Cmd1_Click()
Dim dblData As Double
Dim strReply As String

PM.WriteString "CONF1 -20,3,(@1)"
PM.WriteString "INIT1"
PM.WriteString "UNIT1:POW DBM"
PM.WriteString "FORM ASC"
PM.WriteString "FETC1?"

strReply = PM.ReadString <-----Run timeout here
dblData = strReply
MsgBox "Power:" & dblData

End Sub

Private Sub Form_Load()
    Dim mgr As AgilentRMLib.SRMCls
    Dim ioAddress As String
    On Error GoTo ioError

    ioAddress = txtAddress.Text
    ioAddress = InputBox("Enter the IO address of the PowerMeter", "Set IO address", ioAddress)

    If Len(ioAddress) > 6 Then
        txtAddress.Text = ioAddress
        Set mgr = New AgilentRMLib.SRMCls
        Set PM = New VisaComLib.FormattedIO488
        Set PM.IO = mgr.Open(ioAddress)
    End If

    Exit Sub
    MsgBox "Set IO error:" & vbCrLf & Err.Description
End Sub