OPC Server in Python

F

F. GEIGER

Hi all,

I consider writing a control application in Python (realtime stuff would run
on hw, i.e. a PCI card). If I decide to do so, I'd like to provide access to
the control app's data for OPC clients. This means writing an OPC Server
(OPC DA).

Could I do this in Python too? At the core an OPC Server is a COM server,
isn't it? Did anyone in this group do anything like that already? And if so,
are you willing to share your experience?

Right now I'm trying to get more info about OPC, i.e. there are some
additional issues like OPC Groups and OPC Items and Browsing etc.

Any books you would recommend? Other stuff to get me started quickly?

Any hint welcome!

Kind regards
Franz GEIGER
 
V

Ville Vainio

Geiger> Could I do this in Python too? At the core an OPC Server
Geiger> is a COM server, isn't it? Did anyone in this group do
Geiger> anything like that already? And if so, are you willing to
Geiger> share your experience?

I've written an OPC client (in C++), and used a Wintech OPC client
library (proprietary). I kinda regret that I didn't use the OPC COM
interface directly, but I didn't know enough Python at the time (and
didn't have the Python for win32 book). I guess technically OPC uses
DCOM, but it ought to work the same way...

Geiger> Any hint welcome!

OPC is rather unpleasant. Systems that use OPC should rather use
CORBA, which is an open standard. Many people in automation industry
seem to be rather backward in the sense that they consider Windows,
COM and such things "standard" in some perverse fashion.

I would expose the variables that you do in your OPC server in some
more open fashion (CORBA is great w/ Python), and then implement a
small wrapper application that exposes the variables to OPC clients.
 
D

David Fraser

F. GEIGER said:
Hi all,

I consider writing a control application in Python (realtime stuff would run
on hw, i.e. a PCI card). If I decide to do so, I'd like to provide access to
the control app's data for OPC clients. This means writing an OPC Server
(OPC DA).

Could I do this in Python too? At the core an OPC Server is a COM server,
isn't it? Did anyone in this group do anything like that already? And if so,
are you willing to share your experience?

I've tried to write an OPC server in Python, just for testing, I had a
few bugs that I struggled to iron out but in the end I didn't need it so
I never finished it, but it's definitely doable.
The nice thing is you could then write an OPC client in Python to test
it as well...
Right now I'm trying to get more info about OPC, i.e. there are some
additional issues like OPC Groups and OPC Items and Browsing etc.

Any books you would recommend? Other stuff to get me started quickly?

I would recommend looking at Lab43's LightOPC which is a C
implementation of OPC code available under LGPL, you can use it as
examples... Start with a simple server, look at the OPC
groups/items/browsing later...
Any hint welcome!

Kind regards
Franz GEIGER

Would be good to hear how you progress...

David
 
F

F. GEIGER

Ville Vainio said:
OPC is rather unpleasant. Systems that use OPC should rather use
CORBA, which is an open standard. Many people in automation industry
seem to be rather backward in the sense that they consider Windows,
COM and such things "standard" in some perverse fashion.

Thanks for the hint, Ville!

Kind regards
Franz GEIGER
 
F

F. GEIGER

I would recommend looking at Lab43's LightOPC which is a C
implementation of OPC code available under LGPL, you can use it as
examples... Start with a simple server, look at the OPC
groups/items/browsing later...

I've already encountered LightOPC. Now, as its recommended here, I'll have a
look into it. Thanks!
Would be good to hear how you progress...

I'll keep this group informed, but it certainly will take its time until
then...

Many thanks and kind regards
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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top