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]
Bookmarks