473,467 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Writing an OPC client with Python ?

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

Mar 3 '06 #1
5 4152


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
Mar 3 '06 #2
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) ?

Mar 3 '06 #3
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
Mar 3 '06 #4
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/
Mar 4 '06 #5
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" <pi*****@free.fr> schrieb im Newsbeitrag
news:44***********************@news.free.fr...
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

Mar 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly...
7
by: Ajar | last post by:
I want to write a program which will automatically login to my ISPs website, retrieve data and do some processing. Can this be done? Can you point me to any example python programs which do similar...
0
by: Michael Goettsche | last post by:
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game . I know this game could be written without a server, but the...
7
by: Sidd | last post by:
Hi, I tried finding and example of multithreaded client-serve program in python. Can any one please tell me how to write a multithreaded client-server programn in python such that 1.It can handle...
0
by: Alvin A. Delagon | last post by:
Hello python programmers! I would like to add myself to the ever increasing number of python users. Here's my first question. I've written two SOAP clients using PERL and a PHP. I tried to wirte a...
7
by: Paolo Pantaleo | last post by:
Hi, I need to write a software that allow to see the desktop and hear the microphone capture of a remote PC across a network. I need to do that for a unviresity assignement. The software must ...
1
by: Daniel | last post by:
I want to write a P2P streaming client where ine user broadcasts and many users receive the streaming content and forward like BitTorrent. Can anybody provide pointers for starting in Python. I...
11
by: Krzysztof Retel | last post by:
Hi guys, I am struggling writing fast UDP server. It has to handle around 10000 UDP packets per second. I started building that with non blocking socket and threads. Unfortunately my approach...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.