Writing an OPC client with Python ?

P

pierlau

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
 
L

Larry Bates

pierlau said:
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
 
P

pierlau

Larry Bates a écrit :
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) ?
 
L

Larry Bates

pierlau said:
Larry Bates a écrit :

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
 
J

Jarek Zgoda

pierlau napisa³(a):
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.
 
F

F. GEIGER

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top