Writing an OPC client with Python ?

Larry Bates larry.bates at websafe.com
Fri Mar 3 17:57:32 EST 2006


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



More information about the Python-list mailing list