Is there any way to read lab device memory via VBA

115 Views Asked by At

I am using Agilent 34410A DMM for bunch of measuriments. I want to get the measurement data in the device via Excel VBA on ethernet port.

I can control device but whenever read I get timeout.

Where am I wrong.

Sub digread()
    Dim IOaddress As String
    Dim ReplyString As String
    Dim a As Variant
    
    'These variable are neccessary to initialize the VISA COM.
    'Dim ioMgr As KeysightRMLib.SRMCls
  '  Dim ioMgr As .FmtdIOCls
    Dim ioMgr As VisaComLib.ResourceManager
    Dim Instrument As VisaComLib.FormattedIO488

    ' The following command line provides the program with the VISA name of the
    ' interface that it will be communication with.
    ' It is currently set to use GPIB to communicate
    'Ioaddress = "GPIB0::5::INSTR"

    ' Use the following line for LAN communication (Connect "34410A", "TCPIP1::192.168.1.37::inst0::INSTR", "34410 Digital Multimeters / 2.35")

      IOaddress = "TCPIP0::192.168.1.37::5025::SOCKET"
' "TCPIP1::192.168.1.37::5025::SOCKET", "34410 Digital Multimeters / 2.35")

    ' use the following line instead for USB communication
    ' IOaddress = "USB0::2391::1799::US00000002"

    ' Initialize the VISA COM communication
Set ioMgr = New VisaComLib.ResourceManager
    Set Instrument = New VisaComLib.FormattedIO488
    Set Instrument.IO = ioMgr.Open(IOaddress, NO_LOCK, 2000)
    'Instrument.IO.Timeout = 3000

    Instrument.WriteString ("READ?\n")
a = Instrument.ReadString()    ' here timeout occours 

0

There are 0 best solutions below