This is the final part of our three-part discussion about what users and developers call higher-level languages and how they vary in performance and suitability. You can find all three parts at www.ControlDesign.com/highground.
The first two parts of this article showed us that using higher-level languages in machine control applications has clear benefits. Some of them have to do with familiarity, some with simplifying the coding process itself.
Higher-level languages also have a big impact on code integration, particularly when third-party software is involved.
Develop, Maintain, Expand
A higher-level language is a means for programming a computer that provides a level of abstraction over the assembly language level or the machine language level of programming, explains Dr. Paul James, director, software, at Adept Technology, Livermore Calif. For us, even C is considered a high-level language. We prefer C, C++ and C# because they give us the power to develop, maintain and expand our software products efficiently. One must leverage third-party software, particularly user interfaces, device drivers and installers, to name a few, and ease of code integration is greatly enhanced with higher-level languages.
Higher-level languages simplify the coding process for the programmer, explains Keith DeMonia, general manager/chief engineer at Advanced Machine Automation in Birmingham, Ala. Even simple procedures such as multiplication or testing for equality would take multiple instructions in a low-level language, he says. By drastically reducing the code required for common instructions, higher-level languages simplify program development. The biggest drawback to using a high-level language is the inherent inefficiencies associated with simplifying commands. The finished program will typically occupy much more memory and will execute much more slowly. However, technology has all but eliminated this problem in most instances because of the size of memory and speed of todays CPUs.
Counterbalancing the potential for execution delays are the efficiencies of interfacing C programming with an operating system on an industrial computer, emphasizes Mike Nikrant, R&D engineer, engineered machines and custom systems group, at Sunnen Products in St. Louis. The development time to interface to it would be drastically reduced when using a high-level language, he says. This is because the operating system is written in C. The majority of the libraries that are available for use are written in a high-level language. Also, some of the real-time operating systems/extensions require the use of a high-level language. They are not available to be written in, for example, assembly language or 61131. One other thing with high-level languages is that they are generally a standard. When you get into the 61131 languages, they are similar from vendor to vendor, but the memory organization is different. With high-level languages, there are ways to reuse code, as well as use the libraries that other people have written.
As High as High Can Swing to
So, just how high can a language level go, in terms of its abstraction, ease of use and degrees of portability and reusability? As always, it depends on what you want it to do.
It is important in many automation applications that the programs be maintainable by various people over a long period of time, explains Steve Nylund, CEO of Delta Computer Systems. This is why it is so important to choose the correct language for the job. There are many engineers who can program well in a popular lower-level language like C. But when one is asked to work on a C language program originally developed by someone else, it always seems to be difficult. The very flexibility and power of lower-level programs also mean that these programs can be very difficult to maintain, especially if there are not some rules or provisions made for taking care of that.
Almost on cue, Ben Orchard, application engineer at Opto 22, explains that one of the benefits of flowchart-based programmings simplicity is the ease with which changes or adjustments can be made to the control strategies. The more straightforward nature of flowchart-based programming, compared with lower-level and 61131 languages, enables almost anyone to upload the control program, make any desired changes and then download the program back to the controller, he says. Not only is this method a time saver, its also very empowering for users to be able to make changes on the fly themselves and not have to depend on those who created or are familiar with the program, like the machine builder, to accomplish these tasks.
But in the U.S. most programming is done in ladder logic, warns Matthew Thornton, product marketing manager, Simatic Engineering Software, at Siemens Energy & Automation. Although this is considered a higher-level language than instruction list, it is still a low-level language, he explains. The reason why ladder logic is most used is because it is what is taught in school and it is what the engineers, maintenance staff and electricians understand in the plant.
But, once again, is it the language or its function that makes it higher-level? If a programmer builds an excellent piece of code in ladder logic to program a standard valve, instead of having to reprogram this for each place this valve is used on a machine, it is far more efficient to program it once, save it as a subroutine and then call the subroutine multiple times with different I/O parameters, explains Thornton. This reusability can be at the code level, the device level, the station level or the entire machine level. This concept is in itself a higher level of programming.