fritsbrasmussen Posted July 4, 2013 Posted July 4, 2013 (edited) Trying to access Agilent VISA-COM object(s) with this code: $oRM = ObjCreate("VISA.GlobalRM") ;$oRM = ObjCreate("shell.application") ; OK ;$oRM = ObjCreate("IVIConfigServer.IVIDriverSession") ; OK ;$oRM = ObjCreate("AgilentRM.SRMCls") ;$oRM = ObjCreate("AgM918x.AgM918x") ;$oRM = ObjCreate("AgilentGPIB.GpibSvr") Msgbox(0,"RM", "Obj: " & IsObj($oRM) & " Err: " & @error) $oINSTR = ObjCreate("VISA.BasicFormattedIO") Msgbox(0,"INSTR", "Obj: " & IsObj($oINSTR) & " Err: " & @error) $oINSTR.IO = ObjCreate($oRM.Open("GPIB0::22")) Msgbox(0, "IO", "IO: " & IsObj($oINSTR.IO) & " Err: " & @error) I get IsObj($oRM) = 0 and & @error = 0 IsObj($oINSTR) = 0 and @error = 0 $oINSTR.IO = ObjCreate($oRM.Open("GPIB0::22")) generates this AutoIt error $oINSTR^ERROR Error: Variable must be of type "Object" so apparently oRM and oINSTR are not objects. When I view the Agilent Visa COM object(s) with OLE/COM viewer there is no reference to a Typelib. Could this be the cause, and if so is the any way to circumvent? Thanks for any help Frits B Rasmussen Edited July 4, 2013 by fritsbrasmussen
water Posted July 4, 2013 Posted July 4, 2013 To get detailed information about COM errors I suggest to add a COM error handler. Please check the help file for ObjEvent. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
fritsbrasmussen Posted July 5, 2013 Author Posted July 5, 2013 Thanks MVP,First error reported by errorhandler is: 0x80004002 'No such interface supported'I am afraid this still leaves me in the dark not being an expert on COM objects.I got a Visual C# recipe:using System;using System.Collections.Generic;using System.Linq;using System.Text;using Ivi.Visa.Interop;namespace TG1B1A_VISA_demo{class Program{static void Main(string[] args){// resource manager and message-based session managerResourceManager rMgr = new ResourceManagerClass();FormattedIO488 src = new FormattedIO488Class();FormattedIO488 BERT = new FormattedIO488Class();(end of code excerpt)Can this in any way be translated to AutoIt?RegardsFrits B Rasmussen
water Posted July 5, 2013 Posted July 5, 2013 The help file describes that AutoIt version 3.3.8.1 only supports the IDispatch interface. "AutoIt uses the IDispatch interface for automation. This interface 'exposes' all scriptable methods and properties that the object supports. If it does not exist, you can't use the object in an AutoIt script." A lot of things have changed with the latest beta. But unvortunately I'm not too familiar with COM. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
fritsbrasmussen Posted July 8, 2013 Author Posted July 8, 2013 From VPP-4.3.4 Visa Implementation Specification for COM it appears that IUnknown interface is needed,so this is about as far as I get I suppose.Thanks for your assistance.Frits
water Posted July 8, 2013 Posted July 8, 2013 The latest beta has a new feature to implement interfaces: ObjCreateInterface. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now