PLC

PLC learning series 2: PLC programming languages

A PLC programming language offers guidelines for combining directions to create the required actions. The IEC 61131-3 standard have attempted to merge plc programming languages under one international standard.

A PLC programming language allows the user to enter, edit and monitor the program by connecting to the processor unit and allowing access to the user’s memory.

Various PLC Programming Languages are:

Ladder Logic program:

Most commonly used ladder logic program, simple, easy to understand even for a person who is not expert in computer knowledge.

Ladder logic program example:

Ladder languages are programming languages that write control instructions graphically. To describe the ladder language / diagram there are several provisions that need to be considered, namely:

  • Power flows from left to right.
  • Output is written in the rightmost part.
  • No contacts are placed to the right of the output.
  • Each output is inserted once in each program

Instruction List (IL):

Instruction List (IL) is a low level textual language which has a structure similar to a simple machine assembler.

Instruction list is suitable for those who likes coding and C languages. IL offers a broad variety of operators representing those most frequently discovered in present PLC proprietary instruction lists. Example of programming.

LD INPUT_A

AND INPUT_B

ST OUTPUT

With IL the following operations can be executed:

  • Logical (AND…), arithmetic (ADD…), compare (GT…) operations and assignments (ST, S, R).
  • Jumps within a section unconditioned / conditioned (JMP / JMP C, JMP CN)
  • Functions and function blocks unconditioned / conditioned (CAL / CAL C, CAL CN)

Function Block Programming:

Function Block Programming is based on data flow. The values flow from the inputs to the outputs in these kinds of programs through function blocks.

A FBD program is constructed using function blocks that are connected together to define the data exchange. The linking lines will have a data type that on both ends must be consistent.

The function block diagram:

  • FBDs use data flow from left to right through function blocks
  • Inputs and outputs can be inverted
  • Function blocks can have variable argument list sizes
  • When arguments are left off default values are used

Structured Text Programming

ST is a high level language, similar to PASCAL or BASIC. Structured text is special designed for industrial purposes.

ST follows a straight forward and easy to use format. which gives simple solutions for difficult problems in FBD, LD or IL.

A structured text program contains:
-statements.

A statement contains:
* Expressions
* Keywords
* An expression contains one or more:
* Operators with Operands

Sequential Function Chart (SFC):

A Sequential Function Chart is a graphical method by using a series of steps and transitions to represent a sequential control system. Each stage is an active or inactive command or intervention

Basic structure of Sequential Function Chart :

  • A Sequential Flow Chart section must have an Initial Step and only one Initial Step.
  • A Transition must follow a Step.
  • A Step must follow a Transition

Related contents:

PLC learning Series I: What is PLC? Functions of PLC
PLC learning series 2: PLC programming languages
PLC learning series 3: PLC Architecture and wiring of PLC
PLC learning series 5: 8 Rules for ladder diagram programming
PLC learning series 6: PLC process Scan basics
PLC learning series 8: Instruction List programming
PLC learning series 9: PLC selection criteria.
PLC learning Series 10: PLC timers
PLC learning series 11 : How to interface PLC with SCADA?
PLC learning series 12: Troubleshooting PLC
PLC learning Series 13: Counters in PLC

Sivaranjith

Instrumentation Engineer

Related Articles

Back to top button