PLC programs

brad beck

Member
Join Date
Aug 2002
Posts
1
where can i find programs to practice programming? i.e. written conditions to be met that allow me to design and write a program to accomplish the end results.
 
Here's one to try. The first link is to a thread that got pretty long with several tangents, but there is a system description. There is a bit more detail in the second link. If you read some of the threads from around the same time, there may be more references to it.

Here's the first link. The system description is post number 19 in the thread.
http://www.plcs.net/dcforum/DCForumID1/2020.html

In this link, the system description is in the original thread.
http://www.plcs.net/dcforum/DCForumID1/2055.html
 
brad beck said:
where can i find programs to practice programming? i.e. written conditions to be met that allow me to design and write a program to accomplish the end results.

An excellent question! I may be somewhat biased (sorry Phil!), but the fit is too close to pass it up:

<b><u>Student RSLogix Programming Exercises</u></b>

<blockquote>
<a href="http://TheLearningPit.com/lp/doc/nrl/intro-rl.html">
<b>Relay Logic .... Introductory Exercise</b></a>

<a href="http://TheLearningPit.com/lp/doc/dl/dl-rl.html">
<b>Door Simulation .... applying Relay Logic</b></a>

<a href="http://TheLearningPit.com/lp/doc/sl/sl-rl.html">
<b>Silo Simulator .... applying Relay Logic to a Process</b></a>

<a href="http://TheLearningPit.com/lp/doc/ntmr/intro-tmr.html">
<b>PLC Timers .... Introductory Exercise</b></a>

<a href="http://TheLearningPit.com/lp/doc/tl/tl-ton.html">
<b>Traffic Control .... applying Cascading TON Timers</b></a>

<a href="http://TheLearningPit.com/lp/doc/ncmp/intro-cmp.html">
<b>Word Compare .... Introductory Exercise</b></a>

<a href="http://TheLearningPit.com/lp/doc/tl/tl-cmp.html">
<b>Traffic Control .... applying Word Compare Instructions</b></a>

<a href="http://TheLearningPit.com/lp/doc/nctr/intro-ctr.html">
<b>PLC Counters .... Introductory Exercise</b></a>

<a href="http://TheLearningPit.com/lp/doc/bl/bl-ctr.html">
<b>Batch Mixing .... applying PLC Counter Instructions</b></a>

<a href="http://TheLearningPit.com/lp/doc/bl/bl-adv.html">
<b>Advanced Batch Mixing Exercise</b></a>
</blockquote>
 
I suggest you start with something that you know the functions of - say a washing machine or clothes dryer, or even a toaster. You can get switches and relays from your local Radio Shack to test input and output status, start simple, and add functions such as different time settings as you figure out the basics.
 
Tom, a challenge for you!

Try writing a ladder program to operate the filling station displayed below. Now simulate it's operation using the switches and lights you purchased from Radio Shack. I'm betting your program will work first time through.

Next load the same program into LogixPro and test it out. I'm now betting that unless you put a lot of thought into it, the program will likely fail to function correctly. Is this because there is a fault with LogixPro, or is it rather a fault with the Radio Shack based trainer which you so often promote?

With real process equipment, there is often a synchronous relationship between outputs being energized, and inputs responding. This just can't be readily simulated with a bunch of lights and switches that are being manipulated manually in an asynchronous fashion.

I'm not saying that wiring up an actual PLC with switches and lights is not worthwhile, but if someone wants to learn how to program a PLC, then simulators will provide them with far more realism and challenge. Add some structured student exercises into the equation and the "what do I try next" questions also fade into history. Nothing will replace real equipment, but simulators come closeest.

silo.gif
 
I'm willing to bet that Tom has no trouble with this, with either real controls or simulated ones.

The trick to gtting this one right is to have a self-adjexting pre-act.

A Pre-act, for those who don't know, is the amount of time/volume/weight that you shut the valve/pump off BEFORE you reach setpint, so that, "when the dust settles" (sometimes literally), you have hit the setpoint on the mark.

In a simulated environment, with all events happening instantaneously, the preact will be zero. In the real world, where there is material in transit between the valve and the sensor, and/or a delay between the time you start closing the valve, and the time that the valve is actually closed, the preact will be what it is.

Some folks make the preact a constant, and depend on Maintenance to adjust the constant as conditions change (the valve closes more slowly, the flow through the pipe slows, etc).

I prefer to make the pre-act self-adjusting. Here's how:

Close the valve on Amount >= Setpoint - Preact.
After a "settle time", capture the Actual amount of material transferred, and subtact it from Setpoint to get your Error.

Take some fraction of your Error (I often use 40% if undershooting, 60% if overshotting (since it's usually preferable to undershoot than overshoot)), and subtract it from the current preact to get the new preact.

Since this can cause the preact to hunt, I'll sometimes not do the preact calculation if the Error is below a certain amount, or (to prevent mechanical errors which may give a one-time hugh Error) limit the amount that the preact can change by on a single dose.

It usually takes a new system about 3-5 doses for the preact to settle into the correct range, when going from a simulated environment (preact=0) to a real one.
 
Allen,

I totally agree with you that Tom is far too knowledgeable to get caught by this exercise, but I can assure that more than 95% of all students do.

This simulation has been around since 1991 and thousands of students have experienced the frustration of flooding the plant with product. It can take them hours to finally realize that the logic of "fill the box" .. "wait till level is true" .. "then close solenoid and start the conveyor" just will not work. The plant just keeps getting fuller and fuller! Try this lab on a newbee and you'll see what I mean.

Your point about pre-act is a good one. Although it's not the issue which stumps students with this lab, it would add a bit more realism if added to this simulation. Adding delays etc to a simulation is no more difficult than it is to do in ladder logic, so compensating for pre-act can be readily accomplished.

In both the batch and compressor simulations, you will see a form of this in action. Turn on the heater for the batch, and the temperature of the liquid rises at a rate relative to the volume. Turn the heater off, and the liquid temperature starts to drop at a rate that is comparative to normal heat loss from an open tank. Use more air from the compressor and pressure build slows down. Use too much, and pressure drops. Fairly true to form I'd say.

Simulators can be made to react in any fashion you want. Just like PLC programming, there isn't much that can't be done if you just put your mind to it. I like your idea of the pre-act in the silo. Hope you don't mind if I use it. Thanks for the idea!

Edit!!!!!! Forgot that this is a relay instruction lab only. No Timers Allowed! Maybe a second version; more complex and with pre-act, to be tackled once timers/counters have been introduced.
 
Last edited:
Bill and Allen:

I don't know if your confidence is mis-placed or not, but I appreciate the compliment.

I agree that simulators can do some things that hardwired "fake" systems can't. However, I like to see rookies play with hardware because it also offers insights that a simulator can't. My experience breaking in rookies is that they get hung up on the computer (and the PLC) as the end and not as the beginning. They don't appreciate that wiring up switches and relay and lights are important - look back on how many questions we see of the type "Where does the 24 VDC for my light come from." There is also a visceral thrill to seeing relays click on and off and motors turn on and so forth that a simulator can't duplicate.

One of the things that separates us "old timers" from rookies is the sure and certain knowledge that Mother Nature is a nasty old hag waiting for any opportunity to screw us up. She is in close partnership with my old aquaintance Murphy!]

I think an ideal world is to write the program, run the simulator, and wire up a system to simulate the simulator. I think the more hands-on experience with real things that have smoke just waiting to get out, the better.
 
Hi folks,

what I experienced is that rookies often forget (sometimes willingly because of the work involved) to think the problem over.

Most so-called old-timers have the advantage of having experienced the time when writing a PLC program had to begin on paper. I'm talking about the "good old time" when programming was not done on a PC, but on a dedicated programming device, not in a graphical way, but as a list of textual instructions. I remember programming the Philips PC20 PLC's in those days: the only way to store a program was on audio tape. At that time this brand had almost no means of editing. If I made a mistake, I almost had to start all over.

In those days I learned to prepare a program on paper, using methods like flowcharts, state diagrams and grafcet. Nowadays I teach rookies (mostly unemployed people) to program PLC's. And I know for shure it's not only my 20 odd years of experience which make me faster to get a program in working condition! I mostly have to bang their heads into the wall (figurative of course!) to let them see the advantages of preparation. In this matter I still use the advise of my old mentor: 80% preparation, 20% entering instructions.

Kind regards,

Jean Pierre Vandecandelaere
 
with the silo exercise, i made it real life. press the run button and a counter counts up to twenty-five boxes. then the timer fires and gives the operator time to change skids, then the operation starts again,automatically. after x# of skids, a 2nd counter shuts the operation off and we all go to break!

with the batch mixing exercise, i hope to simulate a starch mixing process, simular to what we have in the shop.
 

Similar Topics

Hey guys, I've a requirement that a two different PLC program should work in same system depending upon user input. Consider Program A is used...
Replies
11
Views
1,929
Scenario: 1. An employer has a machine that isn't up to code/standards: hydrogen gas torch systems without safety shutoff valves, industrial...
Replies
54
Views
8,958
Hi all, Searching the site, this is the newest/closest to my question thread I found on safety PLCs, editing the safety task, etc...
Replies
10
Views
3,900
is there a way to open a compact logix plc program and then compare that to the program that is actually running in the plc Thanks
Replies
1
Views
1,077
Hi there, I am new to PLC as I am studying it in my Mechatronic college course. I came across this question that I can't get my head around to...
Replies
2
Views
2,261
Back
Top Bottom