Python in Process Control?

A

Armin Steinhoff

Wolfgang said:
Hello,

is it that my know-how to use Google is insufficient or...

...does really noone use Python for industrial control applications?

At least I didn't manage to find any publicly available modules for such
things as OPC/fieldbus communication etc...

I believe you are talking about the OPC version based 0n COM / DCOM ...
but there is in the meantime a SOAP based version called OPC XML defined.

SOAP and XML support are available for Python ... who will implement
OPC XML for Python ??

Best Regards

Armin Steinhoff

http://www.steinhoff-automation.com
 
C

Carlos Ribeiro

What, in your opinion, would it take to start one? I'm able to
offer the use of a server to host a web site, and would be happy
to register a domain name or something, but those are the easy
bits. Some kind of core group to get it off the group is likely
more important than a name, though sometimes threads in this
group might lead one to suspect otherwise. ;-)

I did work on software development for remote monitoring devices in
the mid 90's, using C and ASM. I worked with serial communication, and
in *all* cases, I had to implement some "brad-new" proprietary
protocol, or emulate a twenty-year-old one that was poorly documented,
if documented at all. I sincerely don't understand why is this market
so reluctant to progress. All parties involved are *so* reluctant to
share information as to make real progress impossible. It may be
because of their business model, where they expect to make some money
out of "services" -- customization, selling drivers and development
kits -- but even so, the industry as a whole seems to be stuck in the
past.

I now have a related interest that would probably benefit HUGELY from
this effort, and in fact, could help to "bootstrap" it: residential
automation. Yes, I know that the protocols are different, and the
needs are different, but the situation is pretty much the same as for
both fields: too much closed solutions, bad documentation, and people
still stuck at ten-years old technology. A good forum could bolster
the discussion, and the development, of new technology for residential
automation, which has the kind of mass appeal that can make things
scale up better.


--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: (e-mail address removed)
mail: (e-mail address removed)
 
P

Phil Schmidt

...does really noone use Python for industrial control applications?



This isn't quite industrial control, but the principle is similar:

I used Python, along with Mark Hammond's win32 extensions and
pyserial, plus a Dearborn Group VSIC2 interface to create a GM (as in
General Motors) Class 2 bus tool. It was (for me) a general-purpose
tool, allowing me to get real-time bus traces, as well as simulate
portions of vehicle communications for testing, extract diagnostic
codes, log bus traces to disk, and etc. The program used an event loop
on a virtual internal bus, which allowed me to quickly and easily
create new tool applets (Tkinter gui's) and just plug them into that
virtual bus. I had a couple dozen applets that I created and used.

I started the project unsure if Python was up to the task, but I was
pleasantly surprised in the end. I polled the serial port to look for
messages from the VSIC2 box, and I was able to poll it at about 9000
scans per second in trace mode, and about 5000 scans per second with
all of my tools running, all on a circa-2002 Dell laptop. On a
10.4Kbaud vehicle bus, this was more than adequate performance.

Bottom line: Depending on the specific needs I think Python could
handle some process control tasks.
 
A

Andrea Griffini

I implemented the control software for an automated
tangential sewing machine in python (it's a 4 axis
control). The low-level part for axis control runs
on custom hardware, but all the high-level part
including path computation with dynamics constraint
has been coded for a PC in pure python that happened
to be fast enough. The program uses a serial port
and a parallel port to communicate with the low-level
part of the NC, and the user interface has been
coded to work fullscreen using pygame.

It was just a prototype I coded that way basically to
test python, but I was surprised with the results
that seem to me more than adequate. In my case I had
just soft realtime constraint (the low-level part is
able to stop and restart gracefully in the event of
buffering underflow in the axis control data feed)
but I didn't observe any real problem (the axis are
controlled with dt = 1ms).

Andrea
 
D

David Fraser

Peter said:
SourceForge is, from my perspective, an incredibly unreliable
and awkward beast, and I'd be loathe to host anything on it
at this point. I _might_ host an actual project on it, but
I certainly wouldn't consider it for what I'm actually picturing
in this discussion, which is some sort of "Python in Automation"
"portal" or whatever they're called these days... something
along the lines of a combination of a wiki, maybe an RSS feed
(if someone will explain what the benefit is), a mailing
list, and maybe some sort of Vaults-style way for people to
provide links to their own projects (some of which, doubtless
would be SourceForge-hosted).

The simplest thing that could possibly work (tm) of course,
is a wiki and a mailing list, and I can have that up in
a few minutes if desired...

OK fine, whatever you like...

Anyway would anyone else be interested in starting a simple project, say
a Python OPC client library? (I know its just DCOM, but one could make
it more Pythonic)

David
 
W

Wolfgang Keller

Am Fri, 01 Oct 2004 09:14:40 -0400 schrieb Peter L Hansen:
What, in your opinion, would it take to start one?

Work? >:->

A SIG would already be more than nothing, then start to set up a site with
a few links to things that are already available (whether free or
commercial), then start to collect things which are open-source and/or
free, then start to improve them and complete what's missing andsoon...

I have a dream :): A Python library for industrial automation that is as
complete and well-documented as, for example, twisted for TCP/IP
communication.

You need an OPC server/client? - Import a module, instantiate a class and
there you go.

You need to talk <insert_your_favorite_fieldbus_here>? Same procedure...

Ah yes, and obviously have Python ported to all those RTOSes and embedded
controllers (PowerPC, StrongArm/XScale, MIPS, SH)...

RRRRRIIIIINNNNNNGGGGGGG - Uh, what?! Already time to get up and go to the
office? - Please NO! >:->

Best regards,

Wolfgang Keller
 
F

F. GEIGER

I'm in the process of writing a Waterjet Control in Python (progress is
slow, 'cause I do it in my spare time). Again and again I am considering to
go the open source route with it. Until now I didn't dare to do so, because
still I cannot see how I could earn my living with open source software.
That's probably the reason, why I again and again postponed to ask here,
whether anyone would be interested in such a thing and helping to work on
such a thing resp.

As I intend to build an OPC server into "my product" (but have no idea how
to do that), I was triggered by this thread, as you guess. Perhaps this is
the right time to at least show interest in

- using an OPC server written in Python,
- helping out in working on it (well, I am an application programmer, so I
don't know if writing an OPC server would be beyond my capabilities),
- and to contribute application code for standard process control modules,
if such modules are planned (for now my app is written in wx/Python, can
load programs and check 'em for proper syntax; a dummy nc-processor
processes is and displays the jet movements in an PyOpenGL window).

The last point is probably also not an easy one, because each and every app
is different from the other. So what could standard app modules be?

Anyway, on interest I'll write up what I have so far (architecture, hardware
I
plan to use, screenshots) and load it up to my server.

Kind regards
Franz GEIGER
 
C

Carlos Ribeiro

I'm in the process of writing a Waterjet Control in Python (progress is
slow, 'cause I do it in my spare time). Again and again I am considering to
go the open source route with it. Until now I didn't dare to do so, because
still I cannot see how I could earn my living with open source software.
That's probably the reason, why I again and again postponed to ask here,
whether anyone would be interested in such a thing and helping to work on
such a thing resp.

I can't help you with detailed technical aspects. As I said at the
very beginning of this thread, my coding experience with industrial
applications was limited to data communication modules. (I also wrote
bootstrap code for 386 boards, but that's another story that I really
don't like to remember :). But I can share my own ideas with regard
to open source coding.

For years, I've also been bugged by this same very feeling. Will I
always be able to make a living by means of open source software? At
least for me, the answer is - Yes. The reason is that I never have
lost a business opportunity because someone else just copied my code
from other place; and believe, this is rather easy to happen, no
matter how careful you are. On the other hand, I now realize that lots
of folks could have hired my services if they had the opportunity to
test some code of mine.

In other words: if you are a small company, or a individual, open
source is almost always the best route. You have very little to lose.
You already stand a very small chance to break into stablished
markets. If nobody uses you idea, even for free, you have a clear sign
that the idea wasn't that good to start with. If many people start to
use it, then you have something to make good use of. It gives you
bigger opportunities, and it helps to leverage you knowledge better.
By sharing ideas, your product gets better and bigger much faster.
It's value added, that you can leverage yourself, in the form of
services. Even better, some people may find different uses for your
product or software -- things that you would never think about
yourself -- and you may end up making even more money out of it.

The situation where open source does not make sense (or less sense ?),
is the opposite: you're a stablished company, has a big payroll, and
has invested big bucks on development. In this case you have to find a
stable source of revenue. Open source doesn't guarantee that to you,
unless you can convince big shops to sign a support contract. But for
individuals, I can't see a way to lose anything by doing it.

(btw, a good reason to use the GPL is that it stops greedy companies
from using your software for closed-source development. that's an
issue, 'will someone else make money out of my idea?'. GPL and
Creative Commons licensing addresses that issue)

--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: (e-mail address removed)
mail: (e-mail address removed)
 
W

Wolfgang Keller

Hello,
I believe you are talking about the OPC version based 0n COM / DCOM ...
but there is in the meantime a SOAP based version called OPC XML defined.

You mean XML-DA, I guess?

Indeed, the standardisation of SOAP as a protocol for process control makes
Python an even more interesting candidate for such applications. Because
with Python, implementing SOAP clients and server should be ridiculously
more efficient concerning development effort compared to most lower-level
languages and ridiculously more efficient concerning runtime resource
requirements compared to Java.

Regards,

Wolfgang Keller
 
A

Armin Steinhoff

Wolfgang said:
Am Fri, 01 Oct 2004 09:14:40 -0400 schrieb Peter L Hansen:




Work? >:->

A SIG would already be more than nothing, then start to set up a site with
a few links to things that are already available (whether free or
commercial), then start to collect things which are open-source and/or
free, then start to improve them and complete what's missing andsoon...

I have a dream :): A Python library for industrial automation that is as
complete and well-documented as, for example, twisted for TCP/IP
communication.

You need an OPC server/client? - Import a module, instantiate a class and
there you go.

You need to talk <insert_your_favorite_fieldbus_here>? Same procedure...

What do you need ?

Profibus-DP ? a GSD based Configurator for Profibus-DP?
Interbus G4 ?
plain CAN ?
CANopen ?
EtherCAT (in development) ?

It's available for QNX6 !
Ah yes, and obviously have Python ported to all those RTOSes and embedded
controllers (PowerPC, StrongArm/XScale, MIPS, SH)...

QNX6 works with these processors :)

Regards

Armin Steinhoff

http://www.steinhoff-automation.com
 
W

Wolfgang Keller

Hello,
What do you need ?
plain CAN ?
CANopen ?

That's already useful.

MVB and WTB are THE standards in the world were I live. :)

FIP and LON are commonly used as well. Modbus sometimes.
It's available for QNX6 !

QNX6 works with these processors :)

Ah, while you're at it, how about making PyQNX stackless? Could be quite
usefull for communication and statemachines, I guess. :)

*duck*

Regards,

Wolfgang Keller
 

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
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top