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 Leaders Under 40 program features outstanding young people who are making a difference in manufacturing. View the 2013 Leaders here.
The new control room: It's got all the bells and whistles - and alarms, too; Remote maintenance; Specifying VFDs
2014 forecast issue: To serve and to manufacture - Veterans will bring skill and discipline to the plant floor if we can find a way to get them there.
2013 Top Plant: Lincoln Electric Company, Cleveland, Ohio
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.

Bring focus to PLC programming: 5 things to avoid in putting your system together; Managing the DCS upgrade; PLM upgrade: a step-by-step approach
Balancing the bagging triangle; PID tuning improves process efficiency; Standardizing control room HMIs
Commissioning electrical systems in mission critical facilities; Anticipating the Smart Grid; Mitigating arc flash hazards in medium-voltage switchgear; Comparing generator sizing software

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.