# Introduction to PLC Ladder Programming

- Link: https://studyelectrical.com/2017/08/introduction-to-plc-ladder-programming.html
- Published: 2017-08-02T05:16:00+00:00
- Author: 

We have already discussed the [introduction to programmable logic controllers](https://studyelectrical.com/2015/10/introduction-to-programmable-logic.html).
Please go through it before reading this. In this article, we will give you a brief
introduction to programming PLC using the ladder diagram.

Programs for microprocessor-based systems have to be loaded into them in Machine
code, that is in a sequence of binary code numbers to represent the program instructions.

We can also use assembly language based on the mnemonics, _e.g. LD is used to indicate
the operation required to load the data that follows the LD, _and a computer program
called an assembler is used to translate the mnemonics into machine code.

Programming can be made even easier by the use of the so-called high-level languages,
e.g. C, BASIC, PASCAL, FORTRAN, COBOL. These use pre-packaged functions, represented
by simple words or symbols descriptive of the function concerned. _For example, 
with C language the symbol & is used for the logic AND operation._

However, the use of these methods to write programs requires some skill in programming
and PLCs are intended to be used by engineers without any great knowledge of programming.
As a consequence, ladder programming was developed.

**Ladder Programming is a means of writing programs which can then be converted 
into machine code by some software for use by the PLC microprocessor**.

This method of writing programs became adopted by most PLC manufacturers, however,
each tended to have developed their own versions and so an international standard
has been adopted for ladder programming and indeed all the methods used for programming
PLCs.

### Ladder diagrams

As an introduction to [ladder diagrams](https://studyelectrical.com/2017/08/what-is-ladder-diagram-and-how-to-draw.html),
consider the simple wiring diagram of an electrical circuit shown below,

![2017 08 02 08h53 37](https://4.bp.blogspot.com/-UVtH6Yy-a8s/WYFG2CXUcfI/AAAAAAAAAx4/
klKiIVHfRZ8T6wk5BkXXFvbx-GDOFSY8QCLcBGAs/s1600/2017-08-02_08h53_37.png)

The diagram shows the circuit for switching on or off an electric motor. We can 
redraw this diagram in a different way, using two vertical lines to represent the
input power rails and stringing the rest of the circuit between them. 

![2017 08 02 08h53 37](https://1.bp.blogspot.com/-A42DbpKM3Do/WYFHtVRj3KI/AAAAAAAAAyA/
vcBCQHLdDpsqp7MlDuEXo8Kw2zX1pxHDgCLcBGAs/s1600/2017-08-02_08h53_37.png)

Both circuits have the switch in series with the motor and supplied with electrical
power when the switch is closed. The circuit shown above is termed a ladder diagram.

In a ladder diagram, the power supply for the circuits is always shown as two vertical
lines with the rest of the circuit as horizontal lines. 

 * The power lines, or rails as they are often termed, are like the vertical sides
   of a ladder with the horizontal circuit lines like the rungs of the ladder. 
 * The horizontal rungs show only the control portion of the circuit, in the case
   shown in the figures above, it is just the switch in series with the motor. 
 * Circuit diagram often shows the relative physical location of the circuit components
   and how they are actually wired. 
 * With ladder diagrams, no attempt is made to show the actual physical locations
   and the emphasis is on clearly showing how the control is exercised.

### Ladder Diagram Example

![2017 08 02 09h08 16](https://4.bp.blogspot.com/-9s7kgonGftk/WYFJho9DMbI/AAAAAAAAAyM/
h1SqKc4izZ0HkVNk7jQhkdRTvKHD6I5NQCLcBGAs/s1600/2017-08-02_09h08_16.png)

This figure shows an example of a ladder diagram for a circuit that is used to start
and stop a motor using push buttons. 

 * In the normal state, push button 1 is open and push button 2 closed. 
 * When button 1 is pressed, the motor circuit is completed and the motor starts.
   Also, the holding contacts wired in parallel with the motor close and remain 
   closed as long as the motor is running. 
 * Thus when the push button 1 is released, the holding contacts maintain the circuit
   and hence the power to the motor.
 * To stop the motor, button 2 is pressed. This disconnects the power to the motor
   and the holding contacts open. 
 * Thus when push button 2 is released, there is still no power to the motor. 

Thus we have a motor which is started by pressing button 1 and stopped by pressing
button 2.

Next: [What is a ladder diagram and How to draw a Ladder Diagram?](https://studyelectrical.com/2017/08/what-is-ladder-diagram-and-how-to-draw.html)

### Related posts:

No related posts.
