Introduction To PLC: Experiment No
Introduction To PLC: Experiment No
Experiment No (1)
Introduction to PLC
Objective:
To become familiar with the PLC, its components, programming language and how to
addresses the digital input output port.
Theory:
A programmable logic controller, also called a PLC or programmable controller, is a
computer-type device used to control equipment in an industrial facility (industrial plants,
milking machines, elevators, household applications, traffic control systems, chemical plants
and others). A programmable logic controller (PLC) is a special form of microprocessor-based
controller that uses a programmable memory to store instructions and data in order to control
machines and processes as shown in Figure (1).
1
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
The CPU is used to code, decode, and compute data. The memory system can store both the
control program and data from the equipment connected to the PLC. The power supply is the
section of the CPU that provides the PLC with the voltage and current it needs to operate. The
input and output area are where the processor receives information from external devices and
communicates information to external devices. The inputs might be from switches or other
sensors. The outputs might be to motor or valves, etc. As shown in Figure (2).
Example:
Usually, a PLC is equipped with an operating system that allows to load and run programs and
perform self-checks. Programs for PLC are developed and compiled on external devices. PLC
programs are executed in a permanent loop. In each iteration of the loop (scan cycle) the input
is read, then the program computes a new internal state and finally the output is updated. Figure
(3) describes the scan cycle operations.
2
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
3
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
4- Each rung must start with an input or inputs and must end with at least one output. The term
input is used for a control action, such as closing the contacts of a switch, used as an input
to the PLC. The term output is used for a device connected to the output of a PLC, e.g. a
motor.
5- The inputs and outputs are all identified by their addresses. This is the address of the input
or output in the memory of the PLC. All PLCs use two basic types of instructions:
• Contacts
• Coils
Contacts: are instructions that refer to the input conditions of a certain field device
Coils: are instructions that refer to the outputs of the control program—that is, to what each
particular output device is supposed to do in the system.
I/O addresses
Bit data displays On/Off with 1 bit like contact or coil. The PLC has to be able to identify
each particular input and output. For digital I/O ports we used P addresses.
4
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
Examples
% p00000 the 1st bit of the port p0000
% p00113 the 3rd bit of the port p0011
How to make project
1- The software programming of the PLC type XGT is XG5000. The first step is open the
program.
2- To make new project, select [new project] to start wizard, and enter the program filename.
5
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
6
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
Contact:
'Contact' transmits a value to the right horizontal connection line, Standard contact
symbols are as follows:
7
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
Coil:
Coil stores the state of the left connection line or the processing result of state transition
in the associated BOOL variable. Coils are placed in the rightmost side of LD. The standard
coil symbols are as follows:
8
University of Technology – Computer Engineering Department
PLC Laboratory – 4th Year
Procedure:
1- Open a new program that include only contact and coil and connect between them.
2- Make the address of the input instruction p0000 and the output address p0001.
3- Identify the contact in the 1st bit, coil at the 2nd bit of their ports then simulate the program.
4- Change the addresses of input and output instructions to be at the 5th bit in their ports then
simulate the program.
5- Implement your program by PLC kit, let the input to PLC is a switch and the output from
PLC to led.
6- Write the program to PLC and run the program; record the state of the LED if the switch is
ON and OFF.
9