PLC PROGRAMMING LANGUAGES

PLC PROGRAMMING LANGUAGES

Programmable Logic Controllers (PLCs) are the major components in industrial automation and control systems. A PLC program consists of a set of instructions either in textual or graphical form, which represents the logic to be implemented for specific industrial Realtime applications.A dedicated PLC programming software comes from a PLC hardware of specific manufacturer that allows entry and development of user application code, which can be finally download to the PLC hardware. 

Before going to the program of the PLC, let us know the basics of the PLC programming tutorial and its basic concepts. The controlling nature of PLC is ranging from simple- push button switching to a single motor to several complex control structures. Once this program gets downloaded to the PLC and if the PLC is placed in Run mode, then the PLC continuously works according to the program. This software also ensures Human Machine Interface (HMI) as a graphical representation of variables. The PLC programming is an important task of designing and implementing control application depending on customers need.


The 5 most popular types of PLC Programming Languages are:
1. Ladder Diagram (LD)
2. Sequential Function Charts (SFC)
3. Function Block Diagram (FBD)
4. Structured Text (ST)
5. Instruction List (IL)

Ladder Diagram (LD)

Ladder logic is a programming language that represents a program by a graphical diagram based on the circuit diagrams of relay logic hardware. It is primarily used to develop software for PLCs used in industrial control applications. Programs in this language resemble ladders, with two vertical rails and a series of horizontal rungs between them, and hence the name ladder.

Ladder logic is widely used to program PLCs, which require sequential control of a process or manufacturing operation. Ladder logic is useful for simple but critical control systems or for reworking old hardwired relay circuits. As PLCs became more sophisticated, it has also been used in very complex automation systems. Often the ladder logic program is used along with a human machine interface (HMI) program operating on a computer workstation.


Sequential Function Charts (SFC)

Sequential Function Chart (SFC) can be used to structure the internal organization of a program consisting of sub-programs and are also written in other languages of the standard. It can also be used in its pure form of specifying the logical control algorithms.

The SFC programming structure consists of three main elements that organize the control program.

A program in SFC consists of

  • Steps (Stages)
  • Transitions
  • Actions.

Function Block Diagram (FBD)

In FBD all functions are put into function blocks. They all have one or more inputs and outputs. The function of the block is the relation between the state of its inputs and outputs. 
The function block is illustrated with a box. In the middle of the box is often a symbol or a text. This symbol represents the actual functionality of the function block.

Depending on the function there can be any number of inputs and outputs on the function block. You can connect the output of one function block to the input of another. Thereby creating a Function Block. There are many standard function blocks provided in FBD.But you can also make your own function blocks. Often, you will have to use the same piece of code in your PLC program multiple times. It could be a function for controlling a valve, a motor etc. With function blocks, you can make a function block specific for a motor and use it several times.



Structured Text (ST)

Like all programming languages, Structured Text has advantages and disadvantages, and there are also reasons you as a programmer might choose to use Structured Text in your next PLC programming project, so let’s get right into it. Since Structured Text is similar to traditional High-Level programming languages, it can be fairly easy for many people who may not have a background in PLC programming but have experience in traditional coding to learn and develop PLC projects. In most cases, you can also develop your Structured Text PLC programming project without using the PLC programming software. Since it is text-based, you can write your project in a simple text file and copy and paste it into your PLC project when you are ready.

If you know how to program in any high level language, such as Basic or C, you will be comfortable with Structured Text (ST) programming. ST programming is part of the IEC 61131 standard. An example program is shown in Figure 261. The program is called main and is defined between the statements PROGRAM and END_PROGRAM. Every program begins with statements the define the variables. In this case the variable i is defined to be an integer. The program follows the variable declarations. This program counts from 0 to 10 with a loop. When the example program starts the value of integer memory i will be set to zero. The REPEAT and END_REPEAT statements define the loop. The UNTIL statement defines when the loop must end. A line is present to increment the value of i for each loop.




Instruction List (IL)

Instruction lists (or ILs) are one of the five PLC programming languages defined by the IEC 61131-3 standard. (The others being ladder logic diagrams, function block diagrams, sequential function charts, and structured text.)

ILs are not a graphical programming language. Instead, they most resemble assembly language programming. As the name implies, a program is a series of instructions, listed in much the same way as an assembly program.

So for instance, some common operations are mathematical like adding, subtracting, multiplying and dividing values. Other operations can include jumping to a program label as well as calling or returning from separate functions.

Like any PLC programming language, ILs have benefits and drawbacks. One of the clearest benefits is program execution speed. As with assembly language in general, instruction lists are a low overhead language and execute faster than graphical languages. Another plus is that ILs also tend to take up less memory. This is a clear benefit especially in a PLC that is tight on memory space.

On the downside, it is not that common of a language mainly because so many people tend to prefer visual programming languages and environments.











Comments

Popular posts from this blog

MACH3 USB CONTROLLER

PLC FULL FORM (Programmable logic controller)