Python in Process Control?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cameron Laird

    #16
    Re: Python in Process Control?

    In article <mailman.4176.1 096636511.5135. python-list@python.org >,
    Neil Benn <benn@cenix-bioscience.com> wrote:

    Comment

    • Richard Brodie

      #17
      Re: Python in Process Control?


      "Neil Benn" <benn@cenix-bioscience.com> wrote in message
      news:mailman.41 76.1096636511.5 135.python-list@python.org ...
      [color=blue]
      > IMHO, I think that Python is not a suitable piece of software for
      > industrial control as it has poor support for bytes (a string shouldn't
      > be used to store bytes!)[/color]

      That's largely a matter of attitude I think; many would argue that byte
      strings shouldn't be used to store text.


      Comment

      • Cameron Laird

        #18
        Re: Python in Process Control?

        In article <mailman.4176.1 096636511.5135. python-list@python.org >,
        Neil Benn <benn@cenix-bioscience.com> wrote:

        Comment

        • Dennis Lee Bieber

          #19
          Re: Python in Process Control?

          On Fri, 01 Oct 2004 15:08:11 GMT, claird@lairds.u s (Cameron Laird)
          declaimed the following in comp.lang.pytho n:
          [color=blue]
          > consistency of my observations. EVERY time I do process control,
          > there are days (sometimes--hold your hats; this is no
          > exaggeration--months (!)) of pleading, "No, I really want the
          > documentation where you say what it's supposed to do, and what it
          > really does", then the the getting-the-right-cables interval of[/color]

          Not process control, but my current assignment fits this
          roadblock quite well.

          I'm stuck with writing a requirements document, software design
          document, and then the software, to read a binary stream from device-X.
          The only documentation I have for device-X is that I have a 2400baud
          RS-232 connection. There is no documentation as to parity, word-length,
          stop bits, or handshaking. I'm guessing 8N1 as it is binary data, but
          will have to determine handshaking by trial&error.

          Furthermore, I don't know how many bytes are in the data stream
          per data item. The people who would know if it is fixed or variable
          length, or if it even has a delimiter between data items, stonewall with
          a "you have no need to know that information".

          Scarier thought, device-X is loaded from device-Y which appears
          to be using 5-level (+parity?) paper tape! (I'm sure it isn't a 9-pin
          tape -- looked like 4pin, sprocket, 2pin). Maybe I'm expected to receive
          5-bit data and convert to 8-bit to write as hex...

          Just typical government imposed SNAFU... (and people wonder why
          so many projects go over budget?)

          --[color=blue]
          > =============== =============== =============== =============== == <
          > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
          > wulfraed@dm.net | Bestiaria Support Staff <
          > =============== =============== =============== =============== == <
          > Home Page: <http://www.dm.net/~wulfraed/> <
          > Overflow Page: <http://wlfraed.home.ne tcom.com/> <[/color]

          Comment

          • erik.wilsher@gmail.com

            #20
            Re: Python in Process Control?

            I work with process automation myself, and I belive that writing an OPC
            server is *not* a trivial task, even in python. There are some good
            books available on this subject, the OPC-foundations home page contains
            some good references.

            If you want to get started with client code quickly, you could try the
            QuickOPC ($) library from OPC-labs (www.opclabs.com). Setting up a
            client in python with that library is three lines of code (really!):
            ------
            import win32com.client
            import time
            s = win32com.client .Dispatch('OPCL abs.EasyDA')

            def test(times=1000 0):
            v = s.ReadItem('',' Matrikon.OPC.Si mulation', 'Saw-toothed
            Waves.Real8','' ,0)
            t0 = time.clock()
            for i in range(times):
            v = s.ReadItem('',' Matrikon.OPC.Si mulation', 'Saw-toothed
            Waves.Real8','' ,0)
            print time.clock()-t0

            test(1000)

            Comment

            • Armin Steinhoff

              #21
              Re: Python in Process Control?

              Wolfgang Keller wrote:[color=blue]
              > 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...[/color]

              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



              [color=blue]
              >
              > TIA,
              >
              > best regards,
              >
              > Wolfgang Keller[/color]

              Comment

              • Carlos Ribeiro

                #22
                Re: Python in Process Control?

                On Fri, 01 Oct 2004 09:14:40 -0400, Peter L Hansen <peter@engcorp. com> wrote:[color=blue]
                > Wolfgang Keller wrote:[color=green]
                > > There seem to be some Python bits out there, for example MatPLC and
                > > Lintouch use Python and some commercial products as well (PyDACHS), but
                > > unfortunately there doesn't seem to be a more or less consistent library
                > > for industrial automation or a coordinated effort to build up one.[/color]
                >
                > 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. ;-)[/color]

                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: carribeiro@gmai l.com
                mail: carribeiro@yaho o.com

                Comment

                • Phil Schmidt

                  #23
                  Re: Python in Process Control?

                  Wolfgang Keller <wolfgang.kelle r.nospam@gmx.de > wrote in message

                  <snip>
                  [color=blue]
                  > ...does really noone use Python for industrial control applications?[/color]



                  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.

                  Comment

                  • Andrea Griffini

                    #24
                    Re: Python in Process Control?

                    On Sat, 02 Oct 2004 11:50:25 +0200, Armin Steinhoff
                    <a-steinhoff@web.d e> wrote:
                    [color=blue][color=green]
                    >> ...does really noone use Python for industrial control applications?[/color][/color]

                    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

                    Comment

                    • Wolfgang Keller

                      #25
                      Re: Python in Process Control?

                      Hello,
                      [color=blue]
                      > 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.[/color]

                      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

                      Comment

                      • Armin Steinhoff

                        #26
                        Re: Python in Process Control?

                        Wolfgang Keller wrote:[color=blue]
                        > Am Fri, 01 Oct 2004 09:14:40 -0400 schrieb Peter L Hansen:
                        >
                        >[color=green]
                        >>Wolfgang Keller wrote:
                        >>[color=darkred]
                        >>>There seem to be some Python bits out there, for example MatPLC and
                        >>>Lintouch use Python and some commercial products as well (PyDACHS), but
                        >>>unfortunatel y there doesn't seem to be a more or less consistent library
                        >>>for industrial automation or a coordinated effort to build up one.[/color]
                        >>
                        >>What, in your opinion, would it take to start one?[/color]
                        >
                        >
                        > 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_fa vorite_fieldbus _here>? Same procedure...[/color]

                        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 !
                        [color=blue]
                        > Ah yes, and obviously have Python ported to all those RTOSes and embedded
                        > controllers (PowerPC, StrongArm/XScale, MIPS, SH)...[/color]

                        QNX6 works with these processors :)

                        Regards

                        Armin Steinhoff


                        Comment

                        • Wolfgang Keller

                          #27
                          Re: Python in Process Control?

                          Hello,
                          [color=blue]
                          > What do you need ?[/color]
                          [color=blue]
                          > plain CAN ?
                          > CANopen ?[/color]

                          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.
                          [color=blue]
                          > It's available for QNX6 ![/color]
                          [color=blue][color=green]
                          >> Ah yes, and obviously have Python ported to all those RTOSes and embedded
                          >> controllers (PowerPC, StrongArm/XScale, MIPS, SH)...[/color]
                          >
                          > QNX6 works with these processors :)[/color]

                          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

                          Comment

                          Working...