Newsgroups: comp.robotics
Path: brunix!cat.cis.Brown.EDU!agate!howland.reston.ans.net!math.ohio-state.edu!usc!elroy.jpl.nasa.gov!decwrl!enews.sgi.com!wdl1!mail!cps207!dombrows
From: dombrows@lds.loral.com (Brian Dombrowski, 5424)
Subject: Re: Mini PLC language
Message-ID: <1994Jul26.175538.29527@lds.loral.com>
Sender: news@lds.loral.com
Reply-To: dombrows@lds.loral.com
Organization: Loral Data Systems
References: <18@rubidog.demon.co.uk>
Date: Tue, 26 Jul 1994 17:55:38 GMT
Lines: 63

In article 18@rubidog.demon.co.uk, markh@rubidog.demon.co.uk (Mark Hodsman) writes:
> 
> I might be out on my own on this one, but....
> 
> Having spent some time programming with Basic ,assembler,C and Pascal I have
> yet to find a better method of implementing control code than those so called
> 'ladder logic' or PLC languages found on the industrial machines. 
> 
Yuk!  I did ladder logic programming on PLC-2's and PLC-5's at my first job
out of college.  Being taught structured software techinques in school it was
very frustrating to work with ladder programs which have zero structure.
They are one convoluted mess with no modularity and trying to trace logic can
send you flipping back and forth through many pages of listings.  Ladder logic
was invented to mimic the old relay control systems.  This way techinically
obsolete shop electricians could still understand what a ladder program
was supposed to do.

I spent some time thinking on a more sane replacement for ladder programs.
IMO a state machine based language would be better.  Each control function
could have its own state machine.  This scheme would allow state machines to
reside as separate modules providing a more structured programming language.
I think the PLC-5 has something like this called 'sequential logic control'.
But I remember finding anoying limitations with it that prevented us from
using it.  It's been a while since I haven't done ladder programming for 
the last three years.


> I have used various flavours, Allen Bradley coming out best. 
> Whilst being mostly low level stuff, it is quite straightforward to implement
> complex electrical circuits.
> (More intuitive than assembler)
> Some PLC languages are hybrid, and allow you to enter the logic and then if you
> need something fancy ie floating point operations, allow you to drop in to 'C'
> or Pascal etc.
> 
> I wonder if a 'mini' implementation of a ladder-logic programming language
> could be realised?
>

This would be fairly easy to do.  Parallel contacts are OR'ed and serial
contacts are AND'ed.  Intermediate logic values could be stored on a
stack until the final value of the output needs to be computed.  This would
be an interesting project but after it was done I would never use it ;)

 
> BTW The Allen Bradley 5 series PLC uses a 68020 and a Z80 handles network
> communications, so presumably there's quite a bit of heavy-duty processing
> going on to keep the scan times of say, 500 rungs of logic with a few
> milliseconds.
> 
> I would appreciate anybodys thoughts on the above.
> 
> If anyone would like to look at some printouts of a typical ladder-logic
> program I would be glad to email them some info.
> 
> --
> Mark H                         +44 724 762130
> Ya pays yer money ya takes yer chances
> 




