+ Reply to Thread
Results 1 to 3 of 3

Read error

  1. #1
    Registered User
    Join Date
    10-19-2017
    Location
    italy
    MS-Off Ver
    2010
    Posts
    37

    Read error

    Hi guys. I'm working with a digital multimeter and I'd like to control it with VBA. Now, I can send commands with the code below, but when I read it I get the error attached (in English is "Runtime error. Automation error"). Can someone tell me where I'm wrong?

    Thanks

    [code]
    Sub idn()
    Dim ioMgr As VisaComLib.ResourceManager
    Dim idn
    Dim instrument As VisaComLib.FormattedIO488
    Set ioMgr = New VisaComLib.ResourceManager
    Set instrument = New VisaComLib.FormattedIO488
    ' use instrument specific address for Open() parameter – i.e. GPIB0::22
    Set instrument.IO = ioMgr.Open("TCPIP0::192.168.1.6::5025::SOCKET")
    instrument.WriteString ("*IDN?")
    instrument.WriteString "SYSTem:REMote"
    instrument.WriteString ("READ?")
    idn = instrument.ReadString


    End Sub
    [\code]
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Read error

    What line in your code is triggering the error. If you have no error handler on and didnt disable the halt on errors in VBE it should go higlight a line in your code if you click debug on the error. If you have an error handler you can still get the debug option by setting in VBE to break/halt on all errors. Which line is triggering the issue will greatly help determine why its not working
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  3. #3
    Registered User
    Join Date
    10-19-2017
    Location
    italy
    MS-Off Ver
    2010
    Posts
    37

    Re: Read error

    Sorry, forgot to mention. The error pops up at the Readstring line. I've already tried ReadString() but without luck.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cannot read 1004 error
    By 7Black in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 06-18-2013, 07:32 PM
  2. Disable Read Only Cell Error
    By Steve_Courts in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2011, 06:49 AM
  3. Bad Read-Only Error
    By CaptMac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2008, 08:02 PM
  4. Read Only Error
    By CJ-22 in forum Excel General
    Replies: 3
    Last Post: 04-04-2008, 06:10 PM
  5. stream read error
    By bembaman in forum Excel General
    Replies: 3
    Last Post: 12-23-2005, 01:00 AM
  6. Excel File - Read Only Error
    By ritu in forum Excel General
    Replies: 3
    Last Post: 07-20-2005, 03:05 AM
  7. Memory could not be read error
    By Eddie in forum Excel General
    Replies: 0
    Last Post: 05-24-2005, 09:06 AM
  8. Read-only error saving to network
    By Will B in forum Excel General
    Replies: 0
    Last Post: 05-02-2005, 01:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1