Wednesday, April 3, 2019

PROGRAMMING LANGUAGES FOR PLC

There are 5 programming languages that are all a part of the IEC (International Electrotechnical Commission) Section 61131-3 Standard. This IEC Standard allows some fundamental rules that standardize PLCs and their languages.
The 5 most popular 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 LOGIC


 Ladder Diagram is the oldest PLC language. This graphical programming language was modeled from relay logic to allow engineers and electricians to transition smoothly into programming PLCs.
Within Ladder, rungs and rails represent the real world electrical connections. Specifically, the vertical “rails” represent the supply power of the device while the rungs that are connected to the rails are equal to the amount of control circuits.
Input conditions can be written in input terminals, which then impacts the output on the output terminals. The absence of instructions in ladder logic makes it difficult to model motion or batching–understandably so, because ladder logic strictly adheres to the on/off logic of hard-wired relays.

Ladder Diagram Advantages:

·   The rungs allow it to be organized and easy to follow.
·   It also lets you document comments that are readily visible.
·   It supports online editing very successfully.

Ladder Diagram Disadvantages:

The main disadvantage is that there are some instructions that are not available, which might make it more difficult for programming such as motion or batching.

SEQUENTIAL FUNCTION CHARTS


A sequential function chart is a graphical programming language that mimics a flow chart. Int this language we use steps and transitions to get output.
Steps are functions within the program and house events that are activated based on state and other specified conditions.
Transitions are instructions based on true/false values that move you from one step to another.
Branches are used to initiate multiple steps at a time. The branches act like threads where functions can run concurrently.
All of these steps, transitions, and branches are housed in a series of scripts that execute in a procedural manner. The visual nature of the language allows users to monitor processes that both heavily use conditional logic and run parallel instructions. PLCs that are prone to suffering from bottlenecks can be more intuitively maintained and troubleshoot using the chart to follow the logic of the program.

Sequential Function Charts Advantages
·   Processes can be broken into major steps that can make troubleshooting faster and easier. Having a direct access in the logic to see where a piece of equipment faulted.
·   It can be faster to design and write the logic due to the ability to use repeated executions of individual pieces of logic.
Sequential Function Charts Disadvantages:

Even when you consider the advantages of the Sequential Function Charts, this PLC programming Language does not always fit every application.

Function Block Diagram (FBD)


Block based programming languages are a type of graphical language that minimizes code into blocks, which allows for a simple way to create executable commands.
FBD in particular describes a function between inputs and outputs that are connected by connection lines. The logic of the inputs and outputs are stored in blocks. The blocks are programmed onto sheets and the PLC scans these sheets in order or by specified connections between blocks, much like procedural languages.
The I/O focus mirrors that of ladder logic. Yet, the code that the blocks contain allow engineers to develop more complex batch control tasks among other repeatable tasks.

Function Block Diagram Advantages:
·      The Function Block Diagram does work well with motion controls.
·      The visual method is easier for some users.
·      The biggest advantage of Function Block Diagram is that you can take many lines of programming and put it into one or several function blocks.

Function Block Diagram Disadvantages
The code can get disorganized using this PLC Programming Language because you can place the function blocks anywhere on the sheet. This can also make it more difficult to troubleshoot.

INSTRUCTION LIST (IL)


This is the PLC’s equivalent to assembly language. This gives you immediate access to the machine itself, which allows you to write code that is compressed and fast. The code is represented in the manner that the language’s name suggests: in a list of commands.

 

Instruction List Advantages


The Instruction List language is valuable for applications that need code that is compact and time critical.

Instruction List Disadvantages


There are few structuring possibilities with the “Goto” command being one of them.
There can also be many errors that are more difficult to deal with in comparison to many of the other languages that I have previously reviewed.

STRUCTURED TEXT (ST)


Structured Text is a high level language designed to program PLCs. This language is essentially the C++ of the PLC world. Any PLC that requires complex data handling will most likely use ST.
Advantages of Structured Text:

It is very organized and good at computing large mathematical calculations.
It will enable you to cover some instructions that are not available in some other languages like the Ladder Diagram.

Structured Text Disadvantages


·   The syntax can be difficult.
·   It is hard to debug.
·   It is difficult to edit online.


No comments:

Post a Comment

PLC Communication Protocols