Beginners Question

SysApp

Member
Join Date
Oct 2002
Posts
1
I am new to programming PLCs and have a basic question to get me started. I am used to programming LabView or Visual Basic but I am having a hard time getting my mind into Ladder Logic gear. I am programming a SLC 5/3.

I am controlling several air cylinders and I am not sure of the best or correct way to go about it. The valves are dual solenoid so I have an output to extend and an output to retract. There are hall effect sensors on each end.

I need to turn on the extend output until the fully extended switch closes. I then need to turn on the retract output until the fully retracted switch closes. I am not sure of the best way to do this since each rung is read several times before the first operation is complete. I was able to accomplish it by turning bits on and off to force program flow, but I think this can get messy if I do this throughout the program.

I have several cylinders that I have to operate in sequence. For example I have to extend cyl A then extend cyl B then turn on a vacuum pump then retract cyl B then retract cyl A then etc... How do I order the steps?

Thanks in advance for any advice, examples, or links.

SysApp
 
I am not sure of the best way to do this since each rung is read several times before the first operation is complete.

You need to unlearn some VB techniques and learn some new PLC programming techniques. In VB, you might have several different lines setting a variable's value. In a PLC, you generally only want one line (rung) of ladder logic per output point.

The PLC will solve every line of logic, storing the ON/OFF state of the outputs in its memory. After solving the last line of logic, the states of the outputs are sent from PLC memory to the output modules. Then the PLC reads the states of the inputs and starts solving the program rungs all over again.

So if you have logic controlling an output in the first rung of your program, and more logic controlling the same output on the last rung of your program, the result of the first rung will be overwritten by the result of the last rung, and the state of the real-world output will always be determined by the last rung.

Break your sequence down into steps, and determine what conditions cause a transition from one step to the next. For example, the sequence you described might be:

Step 1. Extend cylinder A
Transition from Step 1 to Step 2 when cylinder A trips its 'extended' sensor.

Step 2. Extend cylinder B
Transition from Step 2 to Step 3 when cylinder B trips its 'extended'
sensor.

Step 3. Turn on vacuum.
Transition from Step 3 to Step 4 when the vacuum does what it's supposed to do.

Step 4. Retract cylinder B.
Transition from Step 4 to Step 5 when cylinder B trips it 'retracted' sensor.

Step 5. Retract cylinder A.
Transition from Step 5 to Step 6 when cylinder A trips its 'retracted' sensor.

Step 6. Wait for the command to jump to Step 1.
Transition from Step 6 to Step 1 on command.

That's your basic sequence. You'll need to figure out how to handle a sequence that gets interrupted at any point, so that you can return the system to a known state before restarting the sequence.

There have been some threads here in the past about methods of programming sequential operations. Try searching through the archives.
 
One note on controlling cylinders. You may want to keep the output on even if you reach the end of travel sensor. If it ends up sitting there a while, it could drift. If you keep the output on until the opposite solenoid fires, it won't.
 
There are lots of ways to program a sequencer. I recommend staying away from the AB SQI/SQO instructions. Not that they can't do exactly what you are trying to do, and very neatly, but they can be difficult to understand when you are first learning ladder.

I was able to accomplish it by turning bits on and off to force program flow, but I think this can get messy if I do this throughout the program.

It can get REALLY messy (I'm completely re-writing the ENTIRE PLC program for one customer because the original programmer made it so messy that no one can follow the logic) , but it doesn't have to.

The big thing, as Steve said, is to make the distinction between where the sequencer is at (and what makes it advance), and what the sequencer is doing (i.e., what outputs, timers, etc. are being driven on that step).

For some ideas, here are some links to some tips on creating a sequencer.

http://www.plcs.net/dcforum/DCForumID1/2402.html
http://www.plcs.net/dcforum/DCForumID1/2688.html
 

Similar Topics

Hello, We are using Factory Talk View Studio software on our laptop and the application type is Machine Edition. When we open the software we get...
Replies
1
Views
5,058
Hi all, I am completely new to PLC's and their programming, having started a new course at college. Part of the course is to write a simple...
Replies
4
Views
2,090
hi, we have machine with s7 200 plc and a micromaster drive link to port 1.i like to make some changes to plc program not related to the...
Replies
2
Views
1,858
Any recommendations for controllers to setup a lab for 10 students
Replies
13
Views
1,465
I want some feedback about the quality of the following course. Is it worth paying for...
Replies
13
Views
2,957
Back
Top Bottom