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 Top Plant program honors outstanding manufacturing facilities in North America. View the 2013 Top Plant.
The Product of the Year program recognizes products newly released in the manufacturing industries.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
The true cost of lubrication: Three keys to consider when evaluating oils; Plant Engineering Lubrication Guide; 11 ways to protect bearing assets; Is lubrication part of your KPIs?
Contract maintenance: 5 ways to keep things humming while keeping an eye on costs; Pneumatic systems; Energy monitoring; The sixth 'S' is safety
Transport your data: Supply chain information critical to operational excellence; High-voltage faults; Portable cooling; Safety automation isn't automatic
Case Study Database

Case Study Database

Get more exposure for your case study by uploading it to the Plant 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.

Maintaining low data center PUE; Using eco mode in UPS systems; Commissioning electrical and power systems; Exploring dc power distribution alternatives
Synchronizing industrial Ethernet networks; Selecting protocol conversion gateways; Integrating HMIs with PLCs and PACs
Why manufacturers need to see energy in a different light: Current approaches to energy management yield quick savings, but leave plant managers searching for ways of improving on those early gains.

Annual Salary Survey

Participate in the 2013 Salary Survey

In a year when manufacturing continued to lead the economic rebound, it makes sense that plant manager bonuses rebounded. Plant Engineering’s annual Salary Survey shows both wages and bonuses rose in 2012 after a retreat the year before.

Average salary across all job titles for plant floor management rose 3.5% to $95,446, and bonus compensation jumped to $15,162, a 4.2% increase from the 2010 level and double the 2011 total, which showed a sharp drop in bonus.

2012 Salary Survey Analysis

2012 Salary Survey Results

Maintenance and reliability tips and best practices from the maintenance and reliability coaches at Allied Reliability Group.
The One Voice for Manufacturing blog reports on federal public policy issues impacting the manufacturing sector. One Voice is a joint effort by the National Tooling and Machining...
The Society for Maintenance and Reliability Professionals an organization devoted...
Join this ongoing discussion of machine guarding topics, including solutions assessments, regulatory compliance, gap analysis...
IMS Research, recently acquired by IHS Inc., is a leading independent supplier of market research and consultancy to the global electronics industry.
Maintenance is not optional in manufacturing. It’s a profit center, driving productivity and uptime while reducing overall repair costs.
The Lachance on CMMS blog is about current maintenance topics. Blogger Paul Lachance is president and chief technology officer for Smartware Group.