Programmable
Logic Controller
  Introduction
1.1 Controllers                                                                             2
 What type of task might a control system handle?
 It might be required to control a sequence of events, maintain some variable constant,
 or follow some prescribed change.
 The controller might be required to run a motor to move an object to some position or to
 turn a valve, or perhaps a heater, on or off.
1.1.1 Microprocessor-Controlled Systems                                      3
    Instead of hardwiring each control circuit for each control situation,
 we can use the same basic system for all situations if we use a
 microprocessor-based system and write a program to instruct the
 microprocessor how to react to each input signal from, say, switches
 and give the required outputs to, say, motors and valves. Thus we might
 have a program of the form:
    If switch A closes
    Output to motor circuit
    If switch B closes
    Output to valve circuit
1.1.2 The Programmable Logic Controller                             4
       A programmable logic controller (PLC) is a special form of
  microprocessor-based controller that uses programmable
  memory to store instructions and to implement functions such
  as logic, sequencing, timing, counting, and arithmetic in order
  to control machines and processes.
      They are not designed so that only computer
  programmers can set up or change the programs. Thus, the
  designers of the PLC have preprogrammed it so that the
  control program can be entered using a simple, rather intuitive
  form of language.
                                                                                            5
     PLCs have the great advantage that the same basic controller can be used with a
wide range of control systems. To modify a control system and the rules that are to
be used, all that is necessary is for an operator to key in a different set of
instructions. There is no need to rewire. The result is a flexible, cost-effective system
that can be used with control systems, which vary quite widely in their nature and
complexity.
PLCs are optimized for control tasks and the industrial environment. Thus PLCs:
   Are rugged and designed to withstand vibrations, temperature, humidity, and
    noise
   Have interfacing for inputs and outputs already inside the controller
   Are easily programmed and have an easily understood programming language
    that is primarily concerned with logic and switching operations
1.2 Hardware   6
    The processor unit or central processing unit (CPU) is the unit            7
containing the microprocessor. This unit interprets the input signals and
carries out the control actions according to the program stored in its
memory, communicating the decisions as action signals to the outputs.
    The power supply unit is needed to convert the mains AC voltage to
the low DC voltage (5 V) necessary for the processor and the circuits in the
input and output interface modules.
    The programming device is used to enter the required
program into the memory of the processor. The program is
developed in the device and then transferred to the memory
unit of the PLC.
   The memory unit is where the program containing the control
actions to be exercised by the microprocessor is stored and       8
where the data is stored from the input for processing and for
the output.
    The input and output sections are where the processor
receives information from external devices and communicates
information to external devices. The inputs might thus be from
switches, The outputs might be to motor starter coils, solenoid
valves, or similar things.
    The communications interface is used to receive and
transmit data on communication networks from or to other
remote PLCs. It is concerned with such actions as device
verification, data acquisition, synchronization between user
applications, and connection management.
1.3 Internal Architecture   9
The CPU                                                                      10
The internal structure of the CPU depends on the microprocessor concerned.
       An arithmetic and logic unit (ALU) that is responsible for data
    manipulation and carrying out arithmetic operations of addition and
    subtraction and logic operations
       Memory, termed registers, located within the microprocessor and
    used to store information involved in program execution.
         A control unit that is used to control the timing of operations.
The Buses                                                                                     11
The buses are the paths used for communication within the PLC.
         The data bus carries the data used in the processing done by the CPU.
        The address bus is used to carry the addresses of memory locations. So that
    each word can be located in memory, every memory location is given a unique
    address.
         The control bus carries the signals used by the CPU for control, such as to inform
    memory devices whether they are to receive data from an input or output data and
    to carry timing signals used to synchronize actions.
    The system bus is used for communications between the input/output ports and the
    input/ output unit.
Memory                                                                                    12
    System read-only-memory (ROM) gives permanent storage for the operating system and
    fixed data used by the CPU.
 Random-access memory (RAM) is used for the user’s program.
Input/Output Unit                                                                       13
The input/output unit provides the interface between the system and the outside world
Sourcing and Sinking                                                         14
    The terms sourcing and sinking are used to describe the way in
 which DC devices are connected to a PLC.
    With sourcing, using the conventional current flow direction as from
 positive to negative, an input device receives current from the input
 module, that is, the input module is the source of the current.
     With sinking, using the conventional current flow direction, an input
 device supplies current to the input module, that is, the input module is
 the sink for the current
15
16