Writing an OPC client with Python ?

Walter S. Leipold leipold at ace-net.com
Fri Mar 3 16:03:21 EST 2006


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."



More information about the Python-list mailing list