PLC Programming Languages

Although we suspect that Ladder Diagram is still the most commonly used language in Australia, it was recently very interesting to see the CODESYS survey done on all the industrial programming options.

Ladder Diagram is an ideal programming language for Boolean combinatorial logic equations, simple or more complex. It is also easy to integrate Function Blocks into the equation, for example: Timers and Counters. With Ladder, a simple representation of logical relationships between the Inputs, Outputs, and internal variables (in the form of circuits and contacts) is enough to start programming the application. Its basic concept and its programming style allows for almost all programmers, working in any country or industry, to read, understand and write the program using this language. Thus, Ladder Diagram is probably the most widely used programming language for logic control systems (PLCs).

However, similar to other PLC programming languages, LD programming requires a good preparation; this includes data organization, development of diagrams, and analyse of logical equations and if the complexity of the application increases, then it is often the challenge to keep the benefits and advantages of the Ladder programming: easy edition and coding,
understanding and visualization. Functions such as PID, data treatment, communication functions or even simple calculations, complicate programming in Ladder and are often difficult to implement.

Developing sequential programs in Ladder becomes another challenge. It is not a simple task to develop, review and diagnose a program in the form of a network of contacts. And analyse of the different stages of the process (states, steps) using input conditions and output activation. The program written in Ladder may become very difficult to read and interpret if it
grows too large; even if the program is well written.

Structured Text is the IEC 61131-3 standard language which is better adapted for developing applications that require complex calculations, processing and analysis of mass quantities of data, communication functions and data exchanges.

Using iteration loops, conditions (decisions) and pointers (variables used for an indirect addressing) enables the development and implementation of really compacted programs. It is easier in ST to insert comments throughout the program and to use line withdraws or spacing when marking specific sections of code. As such, it is easier to create a complex, well-structured program in ST than in other languages defined by the standard (Ladder, FBD or Instruction List) especially since young engineers have more experience with computer languages than with hard-wired logic basics. Moreover, the native machine code is denser in ST language, thanks to its nongraphic characteristics (like Instruction List). Finally, programs written in Structured Text are easily transferred to other hardware platforms. Especially since “copying and pasting” text is really easy, and could be used to modify and/or adapt to a new platform.

CoDeSys Integrated Development Environment

However, do not forget that Structured Text language does not support jump instructions!! Another disadvantage of ST is the ease with which the user can develop complex programs. For a large number of programmers (even experienced) and for maintenance and service personnel, the Structured Text environment is not well-adapted for diagnosis or repair. For example, it is difficult to follow how sequential programs are executed: evolution of the steps, associated actions, transitions, input/output conditions, etc. The same applies to complex logic equations (brackets). Thus, a good idea could be to develop applications that benefit from structure and code density of ST program, and the ease of interpretation provided by graphic languages (LD, FBD, SFC and implement POU.s within the program written in a graphic language.

Other languages listed and compared in the IEC 61131-3 standard

Screenshot 2021 02 10 125815

wordpress blog stats