Sie sind auf Seite 1von 10

1 Lab 1: PLC Basics and Introduction to LogixPro

1.1 What is a PLC?

A Programmable Logic Controller (PLC) is a digital electronic device that uses a programmable
memory to store instructions and to implement logic, timing, sequencing, arithmetic, and count-
ing to control industrial processes.

Figure 1: Allen-Bradley MicroLogix Series PLC

PLCs were originally designed to replace hard-wired relay and timer logic circuits. PLCs
present several advantages when compared to relays. PLCs use solid state electronics which
means that they have no moving mechanical parts, allowing them to achieve faster response
times and higher reliability. PLCs also provide a flexible platform for the development and
debugging of automation tasks. Automation tasks can be programmed and modified without
having to rewire the circuitry. Additionally, once a program is completed, verified, and tested,
it can be deployed to other PLCs. PLCs are also designed to withstand harsh environments
(e.g., high temperatures, humidity, dust, etc.) which makes them a suitable device to be used
in industrial environments.

1.2 PLC Components

In general, most PLCs consists of the following basic components (See Figure 2):

1. Power Supply: Supplies DC power to PLC and other modules. This power supply is
typically also used to power the sensors used in automation tasks.

2. Processor (CPU): Consists of a microprocessor for implementing the control logic, as well
as the communication among the modules. Logic is usually entered into the processor
using ladder logic programming. The processor accepts input data from sensors, executes

4
Figure 2: PLC Components

the programmed instructions, and sends the appropriate output commands to control
devices.

3. Input Module: Forms the interface by which sensors (Field devices) are connected to the
controller.

4. Output Module: Forms the interface by which actuators are connected to the controller.
PLCs employ an optical isolator shich uses light to electrically protect the PLCs internal
circuitry from the loads at the input/output teminals.

5. Programming Device: A PC is normally used to program PLCs (handheld units are also
common). PLCs typically use proprietary software that can be used to edit, document,
store, and troubleshoot programs (using ladder logic programming). PC to PLC commu-
nication is usually done via serial/parallel, USB, or Ethernet communication.

1.3 What is a Relay?

In order to understand how PLCs work and how they are programmed, it is important to
first understand the basic operation of relays. A relay is an electromechanical switch which
uses a control electrical signal to activate/deactivate a secondary electrical circuit load. The
construction of a relay typically consists of two main components: (a) a relay coil and (b) a set
of movable contacts (see Figure 3).

5
Figure 3: Relay Diagram

The basic operation of a relay can be simplified as shown in Figure 4. A typical relay consists
of a Normally-Closed (N.C.), a Normally-Closed (N.O.), and a Common (COM) terminal on
one end and a coil (with its two power terminals) on the other end. The COM terminal can be
connected to the N.C. or the N.O. terminal depending on the state of the relay coil. The relay
is designed in such a way that the movable contact armature is pressed by a spring against the
N.C. relay terminal. In the coil OFF state, the circuit between the COM and N.C. terminals
is closed and current can flow through this circuit. Once the relay coil is energized, a magnetic
field is created through the relay coil which pulls the movable contact armature down, opening
the circuit between the N.C. and COM terminals and closing the circuit between the N.O.
and COM terminals. Thus, the coil terminals can be used to activate/deactivate two separate
circuits.

Figure 4: Relay Operation

6
1.4 Ladder Logic Programming

Ladder Logic Programming is one of the most commonly used methods of programming PLCs.
It is a graphical approach based on the circuitry used to implement relay logic. A typical
ladder logic program (refer to Figure 5) consists of two vertical rails that represent two power
terminals in an electrical circuit. Sensors/inputs are represented by their default state, either as
a Normally Open (N.O.) or a Normally Closed (N.C.) switch, whose interconnections allow or
prevent current flow to activate/deactivate output coils/actuators. A N.O. sensor will be open
until it is activated and a N.C. sensor will be closed until activated. Each of the horizontal lines
in the program is referred to as a rung or step (as in a ladder). Each rung consists of an input
element, an output load, and electrical interconnections. Input elements such as pushbuttons,
switches, and sensors are located on the left side of the rung. Output loads, such as pilot lamps,
valve solenoids, motors, pumps, and relay coils are located on the right side. When each input
element on a rung is closed, it forms a continuous path or closed circuit to the output load,
allowing current to flow from the left rail towards the right rail, energizing the output load. The
input elements can be interconnected in series or parallel to form logic functions. All rungs in
a ladder logic program are read in sequential order from top to bottom and from left to right.

Figure 5: (a) Ladder Logic Program Symbols (b) Ladder Logic Program Example

Using Figure 5 as an example, the logic in a ladder logic program can be interpreted as follows.
Note that in this example the pushbutton, pressure switch, and temperature switch are consid-
ered inputs whose status determine the activation of the motor starter coil, which is considered
an output. The motor starter coil can be energized if either the N.O. pressure switch and
the N.O. temperature switch are both closed simultaneously OR if the user pushes the N.O.
pushbutton.
In general, complex logic tasks can be implemented using combinations of simpler logic gate
operations such as AND, OR, and NOT. Each of those operations is implemented as shown in
Figure 6.

7
Figure 6: Relay Logic Gate Equivalent Circuits

1.5 Ladder Logic Programming Rules

The following rules are some of the most commonly used guidelines used to write ladder logic
programs:

1. Switch/Sensor Contacts (inputs) must be placed on the left side of each rung

8
2. Coils (outputs) must be placed at the end of each rung

3. All contacts must be placed horizontally. No vertical contacts are allowed.

4. Coils (outputs) cannot be connected in series with other coils. Parallel output connections
are allowed.

9
5. Program execution flow must go from left to right at all times.

6. Each rung is sequentially numbered (top to bottom), instruction addresses and/or device
descriptions are placed above each instruction. Rung comments are placed on top of each
rung.

1.6 Input and Output Addressing

In addition to expressing logic expressions, a ladder logic program must provide the information
of the physical locations, or addresses, of each sensor (input) and each actuator (output). This
step is necessary because it lets the PLC know which sensor is connected at each terminal. The
addressing format varies depending on the PLC type, model, and manufacturer. An example
of a generic addressing scheme is presented in Figure 7.

10
Figure 7: Ladder Logic Program Example with Addressing

1.7 PLC Operating Cycle

Most PLCs have various operating modes, of which, a PROGRAM and RUN mode are the
most common. In order to input the desired program into the PLC, it must be set to run in
the PROGRAM mode. Once the program is entered and downloaded to the PLCs memory, the
PLC is switched to RUN mode. Once in RUN mode, the PLC runs the program in its memory
in an infinite cycle (or until interrupted by the user). During each operating cycle, the PLC
undergoes the following three stages (see Figure 8):

Figure 8: PLC Operating Cycle

11
1. Input Scan: The PLC checks the status of all input addresses. For each activated input,
a TRUE value is written to the PLCs data table (stored in the PLCs memory). For each
inactive input, a FALSE value is written to the PLCs data table. This data is used in the
next step.

2. Program Scan: The PLC uses the information on the data table to evaluate each rung
in the ladder program. At the end of each rung, if there is current continuity from left
to right through a given output, the PLC writes a TRUE value for that output on the
data table.

3. Output Scan: The PLC checks the status of the outputs as provided by the data table.
For each TRUE output value, the PLC activates the corresponding actuator at the given
address. If the output has a FALSE value, the PLC deactivates the corresponding actuator
at the given address.

Once step 3 is completed, the PLC goes back to the first step and repeats the cycle continuously.
The total time required to complete each cycle is referred to as the scan time.

1.8 Additional References

The following references provide a great introduction to PLCs and ladder logic programming:

1. The Learning Pit: http://www.thelearningpit.com

2. PLC dot net: http://www.plcs.net/

3. MASTER PLC Youtube Videos: https://www.youtube.com/watch?v=xtUK4WsoRDQ&


list=UUI6mxvbTaySm_jhy9ibII2A&index=39

1.9 Pre-Lab Exercises

Read all the information provided in the previous pages and answer the following questions:

1. Describe, in your own words, how relays work.

2. What are the advantages of using PLCs versus using hardwired relays?

3. Define the term Normally Open switch.

4. Describe the PLC operating cycle. How many times and how fast does a PLC run through
each cycle?

12
1.10 Lab Procedure - Introduction to Using LogixPro

Complete each of the following tasks making sure to save screen captures for each different
ladder logic program developed. The screen captures will be pasted in the Results section of
your lab report.

1. Complete the Relay Logic Introductory Lab from Student Exercises provided in the Logix-
Pro Help. Make sure you use the English version of the tutorial.

2. Complete the Door Simulation Programming Exercise 1 from Student Exercises provided
in the LogixPro Help. Make sure you use the English version of the tutorial.

3. Complete the Door Simulation Programming Exercise 2 from Student Exercises provided
in the LogixPro Help. Make sure you use the English version of the tutorial.

13

Das könnte Ihnen auch gefallen