You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old November 15th, 2002, 07:21 PM   #1
rookie1
Member
United States

rookie1 is offline
 
rookie1's Avatar
 
Join Date: Nov 2002
Location: Southern, MI
Posts: 12
Talking Last Rung

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!
  Reply With Quote
Old November 15th, 2002, 07:29 PM   #2
Mike Williams
Member
United States

Mike Williams is offline
 
Mike Williams's Avatar
 
Join Date: Jul 2002
Location: Alabama
Posts: 222
It's the end function, or is it the return? Yea, its the end (I THINK)
__________________
Mike Williams
  Reply With Quote
Old November 15th, 2002, 07:42 PM   #3
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
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!
  Reply With Quote
Old November 15th, 2002, 08:48 PM   #4
rookie1
Member
United States

rookie1 is offline
 
rookie1's Avatar
 
Join Date: Nov 2002
Location: Southern, MI
Posts: 12
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 by rookie1; November 15th, 2002 at 08:51 PM.
  Reply With Quote
Old November 16th, 2002, 06:01 AM   #5
tjhome
Guest
 
Posts: n/a
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...
  Reply With Quote
Old November 16th, 2002, 08:13 AM   #6
Goody
Member
United Kingdom

Goody is offline
 
Goody's Avatar
 
Join Date: Apr 2002
Location: Huddersfield W Yorks UK
Posts: 1,081
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.
  Reply With Quote
Old November 16th, 2002, 09:44 AM   #7
Mike Williams
Member
United States

Mike Williams is offline
 
Mike Williams's Avatar
 
Join Date: Jul 2002
Location: Alabama
Posts: 222
Are you writing this code in stages? Please post the code that you have and the programming gods will come, yes, they will come.
__________________
Mike Williams
  Reply With Quote
Old November 16th, 2002, 09:52 AM   #8
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
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"?
  Reply With Quote
Old November 16th, 2002, 11:22 AM   #9
Allen Nelson
Member
United States

Allen Nelson is offline
 
Join Date: Apr 2002
Location: West Chester, PA
Posts: 1,368
Quote:
Originally posted by Terry Woods
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.
__________________
  Reply With Quote
Old November 16th, 2002, 06:58 PM   #10
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
Here's a Clue...

Bird-Land and Nut-Hut are somewhat synonomous!
  Reply With Quote
Old November 17th, 2002, 04:32 PM   #11
rookie1
Member
United States

rookie1 is offline
 
rookie1's Avatar
 
Join Date: Nov 2002
Location: Southern, MI
Posts: 12



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
  Reply With Quote
Old November 17th, 2002, 05:09 PM   #12
Mike Williams
Member
United States

Mike Williams is offline
 
Mike Williams's Avatar
 
Join Date: Jul 2002
Location: Alabama
Posts: 222
The end should be on the rung alone, like this:
Attached Images
File Type: jpg end.jpg (37.4 KB, 226 views)
__________________
Mike Williams
  Reply With Quote
Old November 17th, 2002, 06:26 PM   #13
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
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.
  Reply With Quote
Old November 18th, 2002, 07:57 AM   #14
randylud
Member
United States

randylud is offline
 
randylud's Avatar
 
Join Date: Oct 2002
Location: Greensboro,NC
Posts: 933
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!
  Reply With Quote
Old November 18th, 2002, 08:28 AM   #15
Allen Nelson
Member
United States

Allen Nelson is offline
 
Join Date: Apr 2002
Location: West Chester, PA
Posts: 1,368
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.
__________________
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
ABSLC Math Overflow in STI file jdbrandt LIVE PLC Questions And Answers 12 May 11th, 2011 12:14 AM
Ladder code doesnt work. Why is it ? giovani LIVE PLC Questions And Answers 20 January 27th, 2005 09:13 AM
SCAN Recursive dandrade LIVE PLC Questions And Answers 2 March 2nd, 2004 10:48 AM
Quickie Problem Waidesworld LIVE PLC Questions And Answers 41 July 11th, 2002 12:50 AM


All times are GMT -5. The time now is 12:31 AM.


.