Last Rung

rookie1

Member
Join Date
Nov 2002
Location
Southern, MI
Posts
12
I am currently attempting to teach myself to write programs using automation directs soft32 software. My question is, what function would I use on the last rung on a program in order to get a continous "loop" I.E. I dont want to press the start button again. By the way great site!
 
A PLC Program runs continuously. Top to Bottom then back to the Top and on to the Bottom, again, and again,...

Like the energizer bunny, it keeps going, and going, and going...

You, as the programmer, have to ensure that your code maintains those conditions that should be maintained, and stops those conditions that should be stopped.

Welcome to Bird-Land!
 
Last Rung (END)

In regards to Mike Williams reply

I am using a momentary pushbutton that I latch in the program, won't the end function reset my latch?

P.S. Terry Woods what is "Bird-Land"?
 
Last edited:
NO !!

But seriously. It will stay latched until you tell it
to reset somewhere in the program. If there is no bit reset
condition, the bit will stay latched for many years to come...
 
I think you are missing the point of how a program is scanned. It is not like the old BASIC programs. You do not need something like GOTO at the end.

Think of (in this case) your ladder diagram as being hard wired. The left bus line + voltage and the right bus line being - voltage.

Then look at the conditions to get the + voltage across to the coil on the right hand side.
 
As Goody indicated,
you do have to have a sense of what a real, hard-wired, "REAL TIME" system is and how it works. That is, after all, what a PLC is trying to mimic.

All of the devices in that kind of system are liable to operate at ANY time. There is no top-to-bottom effect in that kind of arrangement unless you have specifically designed it as such.

The key point is, you don't have to "RESET" anything in that system to tell it to "pay attention"... it is always paying attention.

It might be the case that your hard-wired system performs a sequence of steps and then stops... however, (assuming you don't have a switched hot-rail) that left-rail is always hot and always looking for a way to get to the right-rail.

Accidently tripping a limit-switch, which would normally be tripped only in the middle of the sequence, might very well cause a partial sequence starting at that point in the process. That might, or might not, cause a catastrophic crash in the machine. (This would NEVER happen in a well designed PLC Program!)

In a PLC, conditions are examined in a particular sequence. The exact sequence depends on what you are trying to do. In a hard-wired system, you can stick any device damned near anywhere on the schematic. It will work as expected. HOWEVER, you should NOT expect to create a PLC Program to look like that schematic.

Schematics of hard-wired systems represent REAL-TIME control.
PLC's are NOT REAL-TIME controllers! They can be pretty fast, but because of the sequential examination of code and the scanning scheme, they are NOT REAL-TIME! You can think of them as "conditional sequencers". And... these sequencers never stop trying.

Because these sequencers never stop trying, there is NO "END PROGRAM" as in "Stop Program". There is, however, "END OF PROGRAM" (Usually identified as "END").

PLC's have a certain maximum amount of memory allocated for the program. Your particular program might, or might not, use all of that memory.

In most PLC's, the Program "scanner" will read and execute the program until the scanner runs into "END" ("END OF PROGRAM"). If your PLC has 32K of memory available for your program but you only use 8K, then the Program-Scan will be shorter (1/4 of max program scan-time). The program then goes on to do other house-keeping chores before it returns to execute the program again.

In SOME PLC's, if you don't have an "END", the compiler gives you a fault. In other PLC's, if you don't have an "END", then the program will compile but the program-scan will read ALL 32K before moving on to the house-keeping chores. This, of course, makes your program scan-time 4 times longer than it needs to be.

So, "END" is NOT "END PROGRAM" as you might see in a BASIC or "C" program, but rather, "END OF PROGRAM" code at which point, the PLC moves on to the next task... and so on, and so on... like being stuck in a GO-TO LOOP.


TANGENT:

Anyone care to explain "Bird-Land"?
 
Terry Woods said:
TANGENT:

Anyone care to explain "Bird-Land"?

I've been trying to figure that one out.

The Manhattan jazz club named for Charlie Parker? (Personally, I perfer the Weather Report version of the song about the place over the Manhattan Transfer version). Probably not.

Or maybe an oblique reference to chickens running around with their heads cut off? Some programs feel like that sometimes.

Or how about that perpetual motion "bobbing duck" toy, that goes through the same sequence over and over and over.... (Hey - at least it ties "bird" and "PLC scan logic" together.)

Or perhaps you wrote it when under the inspriration of MGD (and now don't remember youself what it means - but are confident you will again when taking more Brain Stimulator).

I give up.
 



x3 x4 c0
1 l----l l-----l\l----(out)
l c0 l
l---l l---l
l x5
2 l---l l--------------(cnt)
l x0 (ct0)
l---l l--------------(cta0)
1
1 ct0 y0
3 l---l l--------------(out)
l c0 l
l---l\l---l
1
1 x1 y1
4 l---l l--------------(out)
l l
l l
l l----(tmr)
l (t0)
l (k5)
l
l t0 y2
5 l---l l--------------(out)
l
l
l x5
6 l---l l--------------(?) (end) or (jmp) ???



x0 counter input
x1 parts feeder activate (manually pushed by operator)
x3 start button
x4 stop button
x5 feed limit\counter reset
cnt-variable to set at interface
tmr- 1/2 second on delay
This is my first attempt at writing a program, I have ordered Phils book. So please be gentle boys :) .

I'd also like to thank those of you who took time to respond to my simple question. beerchug
 
Why does everyone (a lot, anyway) plead with us to be "gentle"?

Are we really such cold-hearted, uncaring, ba$tards?

Do any of us say "Get away, boy! Yer bothering me!" ??

We, the regulars at PLCSNET (or PLCTALK.NET), have a reputation for being GOOD at what we are doing. We have helped MANY new kids get into this game (a game I sometimes call "Bird-Land").

Yes, it's also true that we have a reputation of being HARD. We might have a little fun now and then on one of our renowned TANGENTS, but when it comes to PLC's, we are serious, and we demand as much seriousness as is required in any field that can literally KILL YOU AND THOSE THAT WORK ON PLC CONTROLLED MACHINES!

So, what's the deal?

Rookie1,
I'll look at your code later.
 
Agreement

Terry! You are so right about being proud of what we do and also requiring others to be dedicated to our craft. It takes a lot of effort and sometimes sweat to be good at this or any particular trade or profession. It has been my experience that those who really want to learn, will. Those who are not really that committed to their career, will fail and move on to something else. The replies here should require input and effort from the requestor. This should never become a free consulting forum.
Randy L.

p.s. With a little kindness thrown in!
 
PLC, not VB

Rookie:

I think you are still thinking of a PLC like a VB program. It ain't.

It looks like you thinking that you need to "end" the program once you've reached the count limit.

That's not how a PLC thinks. The PLC will execute ALL of your rungs in about 5 msec. All it is looking for is an instruction ("END") that tells it that the program is over (PLCs are really stupid little darlings), so that it can go and power any outputs you've told it ot, recheck the state of the inputs, before executing the WHOLE program ALL OVER AGAIN.

As Mike implied, you don't condition your END statements.

But you DO need to tell the PLC what to do when X5 is met.

Reset the counter is one thing- you have that.

Stop the conveyor? If so, you'll need X5 on your C0 rung, acting like the stop PB.

What else?

Write out a detailed sequence of events. Do that before you write another line of code.

<hr>
Bird-land = a collection of loons, turkeys, and do-dos (hopefully rare, if not extinct). Maybe some vultures, lurking. And some new pidgeons.
 

Similar Topics

I've upgraded an older RSLogix project from v19 to v32. It seems v32 is a little more picky about the old code. I have 1 error that states "MCR...
Replies
3
Views
1,766
Maybe a dumb question, but this is my first project using the RS5000, so bear with me - I probably missing the obvious. In my program I'm using...
Replies
4
Views
3,316
Is there a simple way (VBA or macro language) to acknowledge ONLY the most recent alarm? I upgraded recently all the way from RSVIEW 32 7.60 to...
Replies
4
Views
644
This may be a long shot, but would anyone have paperwork on the Nedap 3.5 KW Driver ( Ballast) UV lamp ballast Modbus can communicate with the...
Replies
0
Views
344
When E300 powered off, the ethernet device tag data stayed at last know state, for example, fault bit is still Off, ready bit is still ON, status...
Replies
8
Views
961
Back
Top Bottom