Search

Premium Membership ♕

Limited Time Offer: Save 15% on PRO Plan with discount code: LRN15 and study specialized LV/MV/HV technical articles and studies.

Home / Technical Articles / Basic steps in PLC programming for beginners

Development of an algorithm

The first step in developing a control program is the definition of the control task. The control task specifies what needs to be done and is defined by those who are involved in the operation of the machine or process.

Basic steps in PLC programming for beginners
Basic steps in PLC programming for beginners (photo credit: cyberspaceandtime.com)

The second step in control program development is to determine a control strategy, the sequence of processing steps that must occur within a program to produce the desired output control. This is also known as the development of an algorithm.

A set of guidelines should be followed during program organization and implementation in order to develop an organized system. Approach guidelines apply to two major types of projects: new applications and modernizations of existing equipment.

Flow charting can be used to plan a program after a written description has been developed. A flowchart is a pictorial representation of the process that records, analyzes, and communicates information, as well as defines the sequence of the process.

Logic gates or contact symbology are used to implement the logic sequences in a control program. Inputs and outputs marked with an “X” on a logic gate diagram represent real I/O.

Three important documents that provide information about the arrangement of the PLC system are the I/O assignment table, the internal address assignment table, and the register address assignment table.

  1. The I/O assignment table documents the names, locations, and descriptions of the real inputs and outputs.
  2. The internal address assignment table records the locations and descriptions of internal outputs, registers, timers, counters, and MCRs.
  3. The register address assignment tablelists all of the available PLC registers.

Certain parts of the system should be left hardwired for safety reasons. Elements such as emergency stops and master start push buttons should be left hardwired so that the system can be disabled without PLC intervention.

Special cases of input device programming include the program translation of normally closed input devices, fenced MCR circuits, circuits that allow bidirectional power flow, instantaneous timer contacts, and complicated logic rungs.

  • The programming of contacts as normally open or normally closed depends on how they are required to operate in the logic program. In most cases, if a normally closed input device is required to act as a normally closed input, its reference address is programmed as normally open.
  • Master control relays turn ON and OFF power to certain logic rungs. In a PLC program, an END MCR instruction must be placed after the last rung an MCR will control.
  • PLCs do not allow bidirectional power flow, so all PLC rungs must be programmed to operate only in a forward path.
  • PLCs do not provide instantaneous contacts; therefore, an internal output must be used to trap a timer that requires these contacts.
  • Complicated logic rungs should be isolated from the other rungs during programming.
Program coding is the process of translating a logic or relay diagram into PLC ladder program form.

The benefits of modernizing a relay control system include greater reliability, less energy consumption, less space utilization, and greater flexibility.


Example Of Simple Start/Stop Motor Circuit

Figure 1 shows the wiring diagram for a three-phase motor and its corresponding three-wire control circuit, where the auxiliary contacts of the starter seal the start push button. To convert this circuit into a PLC program, first determine which control devices will be part of the PLC I/O system; these are the circled items in Figure 2. In this circuit, the start and stop push buttons (inputs) and the starter coil (output) will be part of the PLC system.

The starter coil’s auxiliary contacts will not be part of the system because an internal will be used to seal the coil, resulting in less wiring and fewer connections.

Wiring diagram of three phase motor
Figure 1a – Wiring diagram of three phase motor

Relay control circuit for a three-phase motor
Figure 1b – Relay control circuit for a three-phase motor

Real inputs and outputs to the PLC
Figure 2 – Real inputs and outputs to the PLC

Table 1 shows the I/O address assignment, which uses the same addressing scheme as the circuit diagram (i.e., inputs: addresses 000 and 001, output: address 030).

I/O Address
Module TypeRackGroupTerminalDescription
Input000Stop PB (NC)
001Start PB
002
003
Output030Motor M1
031
032
033

To program the PLC, the devices must be programmed in the same logic sequence as they are in the hardwired circuit (see Figure 3). Therefore, the stop push button will be programmed as an examine-ON instruction (a normally open PLC contact) in series with the start push button, which is also programmed as an examine-ON instruction.

This circuit will drive output 030, which controls the starter.

PLC implementation of the circuit in Figure 1
Figure 3 – PLC implementation of the circuit in Figure 1

If the start push button is pressed, output 030 will turn ON, sealing the start push button and turning the motor ON through the starter. If the stop push button is pressed, the motor will turn OFF.

Note that the stop push button is wired as normally closed to the input module. Also, the starter coil’s overloads are wired in series with the coil.

Resource // Introduction to PLC Programming and Implementation—from relay logic to PLC logic

Premium Membership

Get access to premium HV/MV/LV technical articles, electrical engineering guides, research studies and much more! It helps you to shape up your technical skills in your everyday life as an electrical engineer.
More Information
author-pic

Edvard Csanyi

Electrical engineer, programmer and founder of EEP. Highly specialized for design of LV/MV switchgears and LV high power busbar trunking (<6300A) in power substations, commercial buildings and industry facilities. Professional in AutoCAD programming.

40 Comments


  1. sundaresha ps
    Aug 24, 2020

    Mr Advard tq u for your kind information…


  2. Mehmet COK
    May 26, 2020

    Thank you Edvard


  3. microdigisoft.com
    Apr 29, 2020

    Good Article for beginners !

    Keep it up!


  4. Clint Moupi
    Aug 19, 2019

    Am interested in learning plc programming,I have a vast exposure with the outside world of different plc only.thank.you


  5. SHUBHAM KHACHANE
    Sep 18, 2018

    GOOD JOB SIR
    THIS PORTAL IS VERY BEST. AND EASY TO UNDERSTAND .
    THANK YOU SIR


  6. Amandeep Singh
    Nov 09, 2017

    this is very easy way to learn basic steps…good job sir.


  7. priti jadhav
    Aug 21, 2017

    Nice Blog..!! Thank you for sharing PLC SCADA Programming. At Sage Automation Also Provide the PLC SCADA and Automation Training and Placement in Thane.


  8. Nimesh Sharma
    Aug 16, 2017

    sir you have fantastic work on this site. great job sir. i didn’t saw this type of site in my life. so thank you for your effort and sharing knowledge with us.


    • Edvard
      Aug 16, 2017

      Thank you Nimesh, that’s very kind of you :)


  9. Mitul
    Jan 03, 2017

    sir,can you explain all process as a physically ?
    i don’t understand that how it is work


  10. chandan dubey
    Sep 19, 2016

    Sir m mechanical engineer working in heat treatment where PLC is setup …I just want to know is this hv better scope in future….


  11. subbiah
    Mar 17, 2016

    Hello, can I connect a Siemens plc with a yaskawa cacr-sr30bf1amb servopack. if I can how to change the drive parameters


  12. dharmesh parmar
    Jan 12, 2016

    good morning sir, my name is dharmesh i am a electrical engineer i want learn about more plc programing so i need a suggestion from you.i hope so i get a good reply… thanking you sir


  13. noorloai
    Nov 12, 2015

    Hi Edvard,

    Thanks for this articles.


  14. Godwin
    Nov 11, 2015

    Sir Edward , I’m grateful for the educative information.this is one field I want to spacialis in fact I’ve been looking for this for so so long. can you please help me get plc software and a simulator,


  15. Osbourne Ginis
    Sep 28, 2015

    Sir I need to know more about PLC,please help me with some of the skills and ideas on how to go about writing PLC Programmes.

    thanks


  16. Abi M.K
    Sep 08, 2015

    Great sir,its quite interesting.
    I am looking for a job in plc programming can you support me.pls do mail me in following mail id
    [email protected]

    thank you..


  17. Mohsina
    Aug 06, 2015

    Edvard sir you are the best. Thanks for information about PLC.


  18. Dejan
    Jun 06, 2015

    Great portal, simple and understandable posts.


  19. Just Engg Pvt Ltd
    Apr 17, 2015

    Hi.. Nice Blog..
    Just Engg Pvt. Ltd. offer Exclusive Programs with
    International Certificates in Industrial Automation, PLC and SCADA
    technology.
    For Details visit: http://www.justengg.com/


  20. Edysam
    Mar 25, 2015

    Nice


  21. Edysam
    Mar 25, 2015

    simple and clear to beginners. cheers!


  22. Jaime Carbone
    Dec 31, 2014

    Thanks Mr Edwards great and simple article,


  23. afsar
    Dec 14, 2014

    Thanks you Mr.Edward is very good simply understand a beginner also i am a beginner.


  24. PLCBeginner
    Jul 26, 2014

    Good info Edvard, many thanks. Portal is great.


  25. Floyd
    Jul 19, 2014

    Thanks you Mr Edward sir, this portal is very useful especially for us young engineer.


  26. malu
    Jul 04, 2014

    Mr. Edvard sir
    please tell to how to learn easily plc programing and suggest me standard book………


  27. Natarajan Viswanathan
    May 06, 2014

    good


  28. Vlada Markovic
    May 06, 2014

    Very nice article Edvard.


  29. L Sudheer
    May 06, 2013

    The Best portal


  30. jonoviz
    Jan 24, 2013

    You know what, i am so bless to found this website. Thank you for sharing your expertise.

    Regards

    Jonryl Novicio
    Cebu, Philippines


  31. senthil kumar perumal
    Jan 01, 2013

    Mr Edvard this portal really an valuable asset for electrical engineers


    • Edvard
      May 06, 2014

      Thank you Senthil, glad you find EEP usefull!


      • Shreeshail
        Feb 23, 2017

        I am looking for a job in PLC and SCADA programming can you support me. pls do mail me in following mail id
        [email protected]

        thank you sir…


  32. hemant singh rajput
    Oct 30, 2012

    this site is awesome……. Mr. Edvard u r doing a great job. Thanx


    • Natarajan Viswanathan
      May 06, 2014

      Dear Edward.
      I am a 67 year old retired engineer(electrical).I ,recently,by chance saw this portal and read several articles.The first thought came in my my mind was how lucky the young just out of college electrical engineers to have such an wondeful portal with an excellent source of information related to selection,installation,testing,operating and different type of electrical equipments.Now a days to all the young engineers who approach me for guidance and advice,i recommend your portal to be a successful professionalEngineer.Please keep on continuing this for the beneit of the young engineers..Your effortd are highly commendable.May god Bless You Always.
      V.Natarajan


      • Edvard
        May 06, 2014

        Thank you both of you Natarajan and Hemant! That’s very kind of you!

        To be honest I put a lot of efforts and years to make EEP usable and recognized place for electrical engineers worldwide. Your compliments confirm this definitely!

        Thank you again!


    • Edvard
      May 06, 2014

      Thank you for the kind words!


  33. kolalexnic
    Oct 05, 2012

    This portal is the best which I saw…

Leave a Reply to Vlada Markovic

Tell us what you're thinking. We care about your opinion! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a professional and meaningful conversation instead. Thanks for dropping by!

6  +  one  =  

Learn How to Design Power Systems

Learn to design LV/MV/HV power systems through professional video courses. Lifetime access. Enjoy learning!

Subscribe to Weekly Newsletter

Subscribe to our Weekly Digest newsletter and receive free updates on new technical articles, video courses and guides (PDF).
EEP Academy Courses - A hand crafted cutting-edge electrical engineering knowledge