Re: Writing an OPC client with Python ?
OPC Python Example: Get OPC data into Python http://www.opclabs.com/products/quickopc/languages-and-tools/python -- https://mail.python.org/mailman/listinfo/python-list
Re: Writing an OPC client with Python ?
About a year ago I dev'ed a host app in Python (2.3 at that time) to control a KUKA KR16 robot. Comm was over OPC. The OPC 2.0 server was inst'ed on the KRC2. What I was needed to do, was to install the appropriate (i.e. delivere together w/ the server) client software and to take Mark Hammonds COM Makepy utility to to create the wrapper. The rest of the story was fun, pure fun, as Python programming always is. So, register the client software, fire up PythonWin, start the COM Makepy utility and wrap that DLL. If you are completely new to this stuff, it might help to look at all that from w/i MSVB 6.0 or something like that. HTH Franz GEIGER "pierlau" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hello, > > I use an OPC server for connection to DC Drive. > I would like to write a small OPC client. > I have the dll OPCDAAuto.dll which contains all class and method but I > wonder if its possible to instance in python the class that are in the dll > ? > > Thanks for your help . > > Pierre > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing an OPC client with Python ?
pierlau napisał(a): >> You can call methods/functions in a .dll using ctypes. >> >> http://starship.python.net/crew/theller/ctypes/ > > I have tried with ctypes. > I acheived to load the library > it works when I use following instructions : > print windll.OPCDAAuto or print cdll.OPCDAAuto > (i see an handle number) > But I can't run the functions? > I there a way to 'see' the inside of the dll > (i.e. to list the methods) ? Look for C header file (*.h) for this library or find docs. -- Jarek Zgoda http://jpa.berlios.de/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing an OPC client with Python ?
pierlau wrote: > Larry Bates a écrit : >> >> pierlau wrote: >> >>> Hello, >>> >>> I use an OPC server for connection to DC Drive. >>> I would like to write a small OPC client. >>> I have the dll OPCDAAuto.dll which contains all class and method but >>> I wonder if its possible to instance in python the class that are in >>> the dll ? >>> >>> Thanks for your help . >>> >>> Pierre >>> >>> >>> >> >> >> You can call methods/functions in a .dll using ctypes. >> >> http://starship.python.net/crew/theller/ctypes/ >> >> -Larry Bates > > I have tried with ctypes. > I acheived to load the library > it works when I use following instructions : > print windll.OPCDAAuto or print cdll.OPCDAAuto > (i see an handle number) > But I can't run the functions? > I there a way to 'see' the inside of the dll > (i.e. to list the methods) ? > There may be but you really need to have the .DLLs API defined for you somewhere. You aren't going to be able to determine the type and geometry of arguments, return values, etc. without some docs on what functions there are in the .DLL and what arguments they take and what gets returned. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list
RE: Writing an OPC client with Python ?
Larry Bates wrote: > pierlau wrote: > > I use an OPC server for connection to DC Drive. > > I would like to write a small OPC client. > > I have the dll OPCDAAuto.dll which contains all class > > and method but I wonder if its possible to instance in > > python the class that are in the dll ? > > You can call methods/functions in a .dll using ctypes. > > http://starship.python.net/crew/theller/ctypes/ If all you want to do is *read* data from the OPC server, there's OPC XML-DA, an XML-based access method for OPC data. It should be possible to access OPC data using a SOAP library. Warning: Some OPC servers don't support the XML-DA protocol.) I haven't seen XML-DA done in Python yet (I've been meaning to write a Python proof-of-concept for a year or more), but implementations in other languages can be found via Google. In case anybody's wondering, OPC is "OLE for Process Control", the alleged 'open' standard for interfacing instruments and controls to HMI, SCADA, and MES systems in industrial environments. Microsoft's sponsorship of the OPC Foundation was a brilliant piece of anti-competitive marketing; all of the control system vendors have now standardized on OPC, and it's essentially impossible to deploy any process monitoring or control computer that doesn't speak OLE (i.e., that doesn't run Windows). (And, yes, I think it's idiotic for companies to build billions of dollars worth of new manufacturing facilities whose information infrastructures depend on a deprecated, single-vendor 'standard' like OLE. And who the heck wants a 'protocol' that isn't specified at the wire level, anyway?) -- Walt "As long as you've lit one candle, you're allowed to curse the darkness." -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing an OPC client with Python ?
Larry Bates a écrit : > > pierlau wrote: > >>Hello, >> >>I use an OPC server for connection to DC Drive. >>I would like to write a small OPC client. >>I have the dll OPCDAAuto.dll which contains all class and method but I >>wonder if its possible to instance in python the class that are in the dll ? >> >>Thanks for your help . >> >>Pierre >> >> >> > > > You can call methods/functions in a .dll using ctypes. > > http://starship.python.net/crew/theller/ctypes/ > > -Larry Bates I have tried with ctypes. I acheived to load the library it works when I use following instructions : print windll.OPCDAAuto or print cdll.OPCDAAuto (i see an handle number) But I can't run the functions? I there a way to 'see' the inside of the dll (i.e. to list the methods) ? -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing an OPC client with Python ?
pierlau wrote: > Hello, > > I use an OPC server for connection to DC Drive. > I would like to write a small OPC client. > I have the dll OPCDAAuto.dll which contains all class and method but I > wonder if its possible to instance in python the class that are in the dll ? > > Thanks for your help . > > Pierre > > > You can call methods/functions in a .dll using ctypes. http://starship.python.net/crew/theller/ctypes/ -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list