Ladder

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello to everyone,
I'm new in Ladder programming. I want to compare if the value of a
register is equal to 4. If this is true go to label 1, else go to
label 2.
How can i check if a register has the value that i want?
Thanks!


Re: Ladder

Quoted text here. Click to load it

Every ladder programming environment that I have seen has function blocks
for doing things like EQU (equals), LSE (less than or equal), GTE (greater
than or equal). Just select the right function block and fill in the
parameter spaces.

--
********************************************************************
We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder
Quoted text here. Click to load it

In C

  if (reg == 4) {
      /* this is label 1 */
  }
  else {
      /* this is label 2 */
  }
  /* this comes next */

In Pascal

  IF reg = 4 THEN BEGIN
     (* this is label 1 *) END (* no semi before ELSE *)
  ELSE BEGIN
     (* this is label 2 *) END;
  (* this comes next *)

I never heard of Ladder.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt
 <http://www.securityfocus.com/columnists/423
We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder

Quoted text here. Click to load it


  http://en.wikipedia.org/wiki/Ladder_logic
  http://www.allaboutcircuits.com/vol_4/chpt_6/1.html

FWIW, for my masters degree I wrote a ladder diagram
editor/compiler that generated C:

  http://www.visi.com/~grante/ladder.pdf

The place I had worked always drew their ladder diagrams
rotated 90 degrees (the "rungs" were vertical instead of
horizontal) so that's how I did my examples.
  
--
Grant Edwards                   grante             Yow! A shapely CATHOLIC
                                  at               SCHOOLGIRL is FIDGETING
We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder
Quoted text here. Click to load it


Something that did the opposite might be nicer :o)  Then you could write all
your PLC code in C.


--
Regards,
Richard.

We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder

Quoted text here. Click to load it

Except I don't do PLC code.

At the time I was involved in going the other direction: we had
piles of ladder diagrams that needed to be implemented in a
procedure language. The language wasn't C, but the ladder
diagram compiler can generate source code for pretty much any
lanuage with infix boolean operators that can be explicitly
grouped using parens or brackets of some sort.

The ladder diagrams had originally been implemented using
relays and/or diode-matrixes.

--
Grant Edwards                   grante             Yow! My mind is a potato
                                  at               field ...
We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder
Quoted text here. Click to load it

Isn't there some awful Pascal-like thing called "Structured Text"
that people use for PLCs and map onto ladder logic?

pete
--
snipped-for-privacy@fenelon.com "how many clever men have called the sun a fool?"

Re: Ladder
Quoted text here. Click to load it

I think I remember reading about some ISO or ANSI standardized
"structured text" representation that some PLC manufacturers
support.  IIRC, some of the PLC vendors had editors in which
you could even switch back and forth between a ladder diagram
view and a structured text view of a program (or something like
that).

Since the project I worked on which used ladder diagrams didn't
have anything to do with PLCs, I never really looked into it.

--
Grant Edwards                   grante             Yow! MMM-MM!!  So THIS is
                                  at               BIO-NEBULATION!
We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder
On Thu, 24 May 2007 20:01:37 -0000, the renowned Grant Edwards

Quoted text here. Click to load it

See: IEC 61131-3


Best regards,
Spehro Pefhany
--
"it's the network..."                          "The Journey is the reward"
snipped-for-privacy@interlog.com             Info for manufacturers: http://www.trexon.com
We've slightly trimmed the long signature. Click to see the full one.
Re: Ladder

Quoted text here. Click to load it
 grouped using parens or brackets of some sort.
Quoted text here. Click to load it

I've been out of the control automation world for some time now,
but I was impressed with the Step-7 software on Siemens' controllers.

The combined multiple program paradigms and in some cases could
switch back and forth views, IIRC.

for a lot of stuff about automation in general, start at www.control.com

You can probably find a Step7 manual on line if you dig from here
http://www.automation.siemens.com

They even have PC-based control (they're not the only ones).

Rufus



Re: Ladder
Quoted text here. Click to load it

Well, except for the 'map onto'.  Structured tesxt is just another
language.  In prectice it is marginally more portable than the other
standard PLC languages.  At least cut and paste seems to work between
PLC IDEs.  

So far I've found one PLC that lets me import from/export to a text file
(and thus to a decent editor).

I still haven't figured out a way to get Mitsubishi PLCs to accept
functions or variable declarations.  Variables must be entered in their
database interface and I cannot determine how to enter functions at all.
And yes, functions are part of stndard ST.  I've had to resort to
manually inlining.

Robert

--

Site Timeline