Tag Archives: Five Steps to PLC Program Development

What are the Different PLC Programming Languages

PLC programs are normally written in a special application on a personal computer, then downloaded to the PLC. This downloaded program is similar to compiled code to keep the program efficient. The program is stored in the PLC either in battery-backed-up RAM or some other non-volatile flash memory.


Five Different PLC Programming Languages

Albert Einstein said “The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking” PLC programming languages have evolved to both adapt and change the way we program these units. We will look at all five programming languages as defined by the IEC 61131-3 Standard.

  • Structured Text (ST)
  • Function Block Diagram (FBD)
  • Sequential Function Chart (SFC)
  • Instruction List (IL)
  • Ladder Diagram (LD)

Not all of these programmable controller languages are available in every PLC. Ladder logic programming is by far the largest percentage of use in PLCs today. Fundamental concepts of PLC programming are common to all manufacturers. Differences in I/O addressing, memory organization and instruction sets mean that PLC programs are never interchangeable between different makers. Even within the same product line of a single manufacturer, different models may not be directly compatible. This is true when looking at manufactures that private label other controllers.

Estimates are as high as 95% of installations use ladder logic programming in the programmable logic controller.

The PLC programming language that is used can be decided when you look at the following:

  • Maintenance and troubleshooting
  • Knowledge of language
  • Acceptance of the country, location, or individual plant
  • Application of the PLC
  • Ease of changing the PLC program

The actual programming of the PLC is the second last step in the development of programs. The five steps to PLC program development is a good method to follow before picking what programming language to use. As mentioned before the languages supported by each PLC may differ. Please refer to the types of programming that are available for your model and version of PLC.

Let’s quickly review some of the different programming languages for the PLC.

Structured Text (ST)

Structured Text (ST) is a high-level programming language that closely resembles Pascale programming. Statements are used to define what to execute.
What are the Different PLC Programming Languages

Function Block Diagram (FBD)

Function Block Diagram (FBD) is a graphical representation of AND, NAND, OR, NOR gates, etc. that are drawn. It will describe the function between input and output variables.
What are the Different PLC Programming Languages

Sequential Function Chart (SFC)

Sequential Function Chart (SFC) is like a flowchart of your program. It defines the steps through which your program moves.
What are the Different PLC Programming Languages

Instruction List (IL)

Instruction List (IL) can also be referred to as the mnemonic code and statement list. It contains simple instructions for looking at your variables.
What are the Different PLC Programming Languages

Ladder Diagram (LD) – Widely Used

Ladder Diagram (LD) is the most popular programming language for the PLC. It was written to mimic the mechanical relays in the panel that the programmable logic controller replaced. It has two vertical rails and a series of horizontal rungs between them. Controllers will usually scan from left to right top to bottom. The output of one rung is available for the next rung.
What are the Different PLC Programming Languages

Note: All pictures from PLCopen IEC 61131 Basics

PLC programming methods are evolving. PLC Open is an organization that is defining new methods to take advantage of the latest computer innovations. They have defined the IL method of programming to XML (Extended Markup Language) which is used for web development. This, in my opinion, keeps moving the ideal method, to a standard way to program PLCs.

If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII, and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

What are the Different PLC Programming Languages

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.


Five Steps to PLC Program Development

Programming a PLC can sometimes be a daunting task. The best method is to break the task into some smaller steps. These are the steps that I have used for years to develop PLC programs. We will apply them to a die stamping application.


Step 1 – Define the task:

What has to happen? This is written down and summarized. You may have to ask several different people how the machine operates—going back to individuals when there is a conflict on specific aspects of the operation. This step is number one for a reason with PLC program development.
steps plc program development

Two sensors: an upper limit switch that indicates when the piston is fully retracted and a lower limit switch that indicates when the piston is fully extended. A master switch is used to start the process and shut it down. When the master switch is turned on, the piston reciprocates between the extended and retracted positions. This is achieved with an up and down solenoid. When the master switch is turned off, the piston returns to the retracted position, and all solenoids are off.

Step 2 – Define the Inputs and Outputs:

Based on the information in step 1, you determine the inputs and outputs to the PLC required to develop what has to happen.

Inputs:
Master Switch – On/Off
Upper Limit Switch – On/Off
Lower Limit Switch – On/Off

Outputs:
Down Solenoid – On/Off
Up Solenoid – On/Off

Step 3 – Develop a logical sequence of operation:

This is where the majority of time is spent in PLC program development. Steps 1 and 2 allow you to express what has to happen in the PLC program systematically. Based on the logic, you may have to modify the program’s inputs/outputs or sequence. This is the most accessible place to make changes.

You can use anything to fully understand the logic of the operation before programming. This can be done using a flow chart or sequence table. Many people do not use this step and jump straight to programming.

Fully understanding the logic before starting to program can save you time and frustration.

Sequence Table: The following is a sequence table for our die stamping application. I usually review this sequence with the person with the most knowledge of the machine. This can be the designer or the machine operator.
steps plc program development

Read the Sequence Table: Follow the steps from left to right, top to bottom. Inputs and outputs are labeled as 1 (ON), 0 (OFF) or X (Does not Matter). Step 1 indicates that it does not matter the upper and lower limit switch positions. The master switch is off, so the up and down solenoids are off. Steps 3 and 4 repeat themselves as long as the master switch is on.

Note: You will notice that at step 2 after the master switch turns on the up solenoid will be activated. So the piston always retracts when the master switch is first turned on.  This operation was picked up in the development of our logical sequence.

Step 4 – Develop the PLC program:

Utilizing the above steps, we will now actually write the plc program. This can be in several different languages. In our case, ladder logic will be used.

Look at the sequence table for the following logic. I have used Set and Reset conditions, so the sequence table quickly follows it. When the master switch turns on the up solenoid is activated. Notice the first rung is a direct correlation. Follow the rest of the sequence table with this ladder logic.

steps plc program development
Document, Document, Document This is a vital part of every program, saving you time and money when you have to return to the program years later.

Step 5 – Test the program:

Test the logic that you have developed. Once again, the previous steps are helpful in this process. PLC program development testing is an important step to test for all logic conditions. (Power Cycle, Sensors Fail, Safety, etc.)

steps plc program development
Test the program with a simulator or actual machine. Make modifications as necessary. Check with the people most knowledgeable on the device to see if it is doing what they expect. Do they need anything else? Follow up after a time frame to see if any problems arise that need to be addressed.

These five steps will help you in your PLC program development.

  1. Define the task
  2. Define the inputs and outputs
  3. Develop a logical sequence of operation
  4. Develop the PLC program
  5. Test the program

The five steps form the basis of all PLC development. You will notice that the actual programming does not occur until the second last step. Usually, more time is spent understanding the task and sequence of operation.

Watch on YouTube: Five Steps to PLC Program Development
If you have any questions or need further information, don’t hesitate to contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII, and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available for free download. The link is included when you subscribe to ACC Automation.