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
Consulting-Specifying Engineer's Product of the Year (POY) contest is the premier award for new products in the HVAC, fire, electrical, and...
Consulting-Specifying Engineer magazine is dedicated to encouraging and recognizing the most talented young individuals...
The MEP Giants program lists the top mechanical, electrical, plumbing, and fire protection engineering firms in the United States.
Water use efficiency: Diminishing water quality, escalating costs; Lowering building energy use; Power for fire pumps
Building envelope and integration; Manufacturing industrial Q&A; NFPA 99; Testing fire systems
Labs and research facilities: Q&A with the experts; Water heating systems; Smart building integration; 40 Under 40 winners
Maintaining low data center PUE; Using eco mode in UPS systems; Commissioning electrical and power systems; Exploring dc power distribution alternatives
Protecting standby generators for mission critical facilities; Selecting energy-efficient transformers; Integrating power monitoring systems; Mitigating harmonics in electrical systems
Commissioning electrical systems in mission critical facilities; Anticipating the Smart Grid; Mitigating arc flash hazards in medium-voltage switchgear; Comparing generator sizing software
As brand protection manager for Eaton’s Electrical Sector, Tom Grace oversees counterfeit awareness...
Amara Rozgus is chief editor and content manager of Consulting-Specifier Engineer magazine.
IEEE power industry experts bring their combined experience in the electrical power industry...
Michael Heinsdorf, P.E., LEED AP, CDT is an Engineering Specification Writer at ARCOM MasterSpec.