How to choose the correct programming language

What kind of applications and operations best fit which of five IEC 61131-3 programming languages? Depending on what you’re doing, relay ladder logic could be wasting significant time and effort.

12/29/2011


Choosing a control programming language most suitable for the task at hand reduces program complexity and troubleshooting/maintenance costs. It will also make the code more readable, improve the development process, and enhance controller performance.

Rockwell Automation RSLogix 5000 v20 programming software, in combination with scalable, right-sized control system components, allows users to scale from 200 to 10,000 I/O points in one control platform and common user experience. Courtesy: Rockwell Automation

The first step in solving discrete, process, batch, drive, safety, and motion control challenges is to ensure the language editors for relay ladder logic (RLL), function block diagram (FBD), sequential function chart (SFC), and structured text (ST) programming are native to your programming software and controller. Then, use the chart below to best match the task to the appropriate language.

When a section of your code represents the following, select:

Relay Ladder Logic (RLL) for:

  • Continuous or parallel execution of multiple operations (not sequenced)
  • Boolean or bit-based operations
  • Complex logical operations
  • Message and communication processing
  • Machine interlocking
  • Operations that service or maintenance personnel may have to interpret to troubleshoot the machine or process
  • Servo motion control

Function Block Diagram (FBD) for:

  • Continuous process and drive control
  • Loop control
  • Calculations in circuit flow

Sequential Function Chart (SFC) for:

  • High-level management of multiple operations
  • Repetitive sequences of operations
  • Batch process
  • Motion control sequencing (via sequential function chart with embedded structure text)
  • State machine operations

Structured Text (ST) for:

  • Complex mathematical operations structured text
  • Specialized array or table loop processing
  • ASCII string handling or protocol processing

For example, it’s possible to use relay ladder logic for complex data handling, such as sorting algorithms. This process would work but take weeks (and potentially hundreds of rungs of code) to program. This would be time-consuming to write and maintain, less readable, and require extra time in the controller to scan and execute. Using structured text for this task is more suitable, making programming a complex, bubble-sorting algorithm simple, straightforward, and more efficient, approximately 10 lines of code with less impact on controller performance.

This is just one example of choosing the right programming language for the right task. Mixing and matching programming languages in a project to meet an application need is an essential competency of your programming software. Some programming software will allow, within the same project, programming for a batch operation in SFC, pump station in FBD, conveyor system in RLL, and a complex mathematical algorithm in ST.

- Fred Habenschuss is commercial engineering manager, Rockwell Automation.

www.rockwellautomation.com 

See other articles related to the January 2012 cover story on automation programming. Edited by Mark T. Hoske, CFE Media, Control Engineering, www.controleng.com.

Also see the PAC and PLC Channel at http://controleng.com/PLCs 



No comments
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
Each year, a panel of Control Engineering editors and industry expert judges select the System Integrator of the Year Award winners.
Control Engineering Leaders Under 40 identifies and gives recognition to young engineers who...
Learn more about methods used to ensure that the integration between the safety system and the process control...
Adding industrial toughness and reliability to Ethernet eGuide
Technological advances like multiple-in-multiple-out (MIMO) transmitting and receiving
Virtualization advice: 4 ways splitting servers can help manufacturing; Efficient motion controls; Fill the brain drain; Learn from the HART Plant of the Year
Two sides to process safety: Combining human and technical factors in your program; Preparing HMI graphics for migrations; Mechatronics and safety; Engineers' Choice Awards
Detecting security breaches: Forensic invenstigations depend on knowing your networks inside and out; Wireless workers; Opening robotic control; Product exclusive: Robust encoders
The Ask Control Engineering blog covers all aspects of automation, including motors, drives, sensors, motion control, machine control, and embedded systems.
Join this ongoing discussion of machine guarding topics, including solutions assessments, regulatory compliance, gap analysis...
News and comments from Control Engineering process industries editor, Peter Welander.
IMS Research, recently acquired by IHS Inc., is a leading independent supplier of market research and consultancy to the global electronics industry.
This is a blog from the trenches – written by engineers who are implementing and upgrading control systems every day across every industry.
Anthony Baker is a fictitious aggregation of experts from Callisto Integration, providing manufacturing consulting and systems integration.
Integrator Guide

Integrator Guide

Search the online Automation Integrator Guide
 

Create New Listing

Visit the System Integrators page to view past winners of Control Engineering's System Integrator of the Year Award and learn how to enter the competition. You will also find more information on system integrators and Control System Integrators Association.

Case Study Database

Case Study Database

Get more exposure for your case study by uploading it to the Control Engineering case study database, where end-users can identify relevant solutions and explore what the experts are doing to effectively implement a variety of technology and productivity related projects.

These case studies provide examples of how knowledgeable solution providers have used technology, processes and people to create effective and successful implementations in real-world situations. Case studies can be completed by filling out a simple online form where you can outline the project title, abstract, and full story in 1500 words or less; upload photos, videos and a logo.

Click here to visit the Case Study Database and upload your case study.