Visual Programming for Automation

Graphical programming methods have been around the manufacturing, automation, and instrumentation space for a long time. Software tools—ranging from National Instruments’ LabView to The MathWorks Simulink and including many proprietary PLC and DCS programming tools—are nothing like textual languages such as Cobol or C.


National Instruments Labview is a data flow based graphical programming tool, which can be easier to use than text-based programming methods.

National Instruments LabVIEW is a data flow based graphical programming tool, which can be easier to use than text-based programming methods.


Search for articles related to manufacturing IT topics by Dennis Brandl and others.

Visual programming: an HMI programmer’s perspectiv

Graphical programming methods have been around the manufacturing, automation, and instrumentation space for a long time. Software tools—ranging from National Instruments’ LabView to The MathWorks Simulink and including many proprietary PLC and DCS programming tools—are nothing like textual languages such as Cobol or C. But graphical programming (also called “visual programming”) has significant benefits, and is quite common for creating automation and manufacturing IT systems.


Visual programming involves a graphical palette upon which a programmer creates, arranges, and connects images that represent various programming concepts. Once the visual representation is complete, the diagram can be translated or compiled into a standard executable program, or it can be executed directly.


Christian Fritz, National Instruments product manager for motion control and mechatronics, says “Graphical tools are ideal for describing and programming complex automation systems. From the machine level up to the production line or manufacturing execution system (MES) layer, modern systems combine parallel, sequential, iterational, and diactric tasks that make it hard to use text-based sequential programming for application development.”


Dennis Brandl, president of BR&L Consulting, says visual programming is “a formalization of things we do in workflows and process flows. We’ve been doing it for a long time [in manufacturing IT environments] and other industries are just catching up.”


In a paper on visual programming in Labautopedia, an online information resource, Mark F. Russo says, “Many a non-programmer can attest to the surprising level of frustration associated with an attempt to “get right” the arcane syntactical detail often demanded by a text-based programming language. The problem of exposing the functionality of a complex system so that it is usable by a non-programmer is the subject of much ongoing research.”


Three 'flows’ represented

Visual programming tools vary and Russo says the concepts underlying them can vary too. He puts the potential “flows“ expressed by a visual programming language or toolkit into three categories: flow of data, flow of material, and flow of control.


Textual languages focus on the manipulation of program data, thereby keeping the flow of data itself hidden from view. “In contrast, a data flow programming model makes data the primary focal point upon which its programs are assembled. Operations that occur become side effects of the flow of data through the program,” Russo explains.


NI’s Fritz says NI LabView is “a data-flow based graphical system design tool that offers a high-level of abstraction and an extensive library of functions for I/O, analysis, data-logging and control for machine control and monitoring applications.”


Flow of material focuses on raw materials and newly produced materials in a process. Material flow is not important to general purpose visual programming tools, but it can be very important to tools geared for the laboratory or process industries.


Russo says flow-of-control style visual tools are “much more comparable to standard imperative programming than data or material flow tools.” The most common tool in this group is the flowchart. Other ways to visually represent the control of flow are statecharts and activity diagrams, both part of the larger set of diagrams that make up the Unified Modeling Language (UML) standard, he says.


Brandl says another visual programming option is the Petri net, a visual modeling method which is both a graphical and mathematical formalism of workflows and processes. Petri nets have been used for years to model and simulate the behavior of diverse complex systems, especially those that display concurrent behavior, as they form the basis of certain tools. Petri nets have been used extensively in automated manufacturing and to develop manufacturing execution systems. He says Simatic IT, Siemens’ software for manufacturing operations management, is based on the Petri net concept.




Screen capture shows a Simulink model (top) of a power window, with control logic modeled in Stateflow (bottom). Source: The MathWorks

Screen capture shows a Simulink model (top) of a power window, with control logic modeled in Stateflow (bottom). Source: The MathWorks


Higher level modeling and simulation tools are another class of visual software. Tony Lennon, industrial automation and machinery industry manager at The MathWorks, says that although Simulink can concisely represent both your plant model and the controller logic in a single graphical canvas, as well as perform other tasks, it does so without the use of Petri nets.


“Simulink provides not only for simulation and early verification and validation, but also automatic code-generation targeting C, HDL, and IEC-61131 structured text,” says Lennon. “Petri nets give you a very abstract and generalized way of representing concurrency and process flow. However, they are far too abstract to represent dynamical systems and supervisory logic.”


Lennon’s analogy: “Imagine building the whole world using one atom at a time, no molecules and nothing bigger to work with. In contrast, Simulink provides a graphical platform for dynamic system simulation and various high level blocks, subsystems and even domains such as Stateflow. Stateflow supports the use of hierarchical finite state machines, truth tables, and flow graphs. The semantics of Stateflow are deterministic in nature, enabling the modeler to define logical algorithms in a clear and consistent way.”


Simulink and Stateflow are control flow (or signal flow) based software, says Lennon. Stateflow offers state machine capability like UML, but also integrates truth tables, flow graphs, and continuous systems through Simulink. Stateflow semantics are deterministic because the user defines the order of processing the system states, he says.


Bridget Fitzpatrick, the practice lead for HMI at Mustang Engineering, says interfaces similar to the Petri net symbology are increasingly common. “Done well, they can make the current condition of the process work flow quite clear. Done cryptically, they can be a hurdle to acceptance,” she says. “Some purely sequential flows have been done in a GANTT chart format, similar to Microsoft Project or calendars in Microsoft Outlook. These can be useful and intuitive if done well, and overwhelmingly complex if done poorly.”


William “Bill” Gilbert, industry business development manager for Siemens Industry, is the prime contact for converting industry application engineering at Siemens. He says that when programming and monitoring an application that is a process, he prefers graphical languages. “The main benefits are the unique ability to graphically communicate process flow, and [the ability to] provide documentation of the program from the engineering effort,” he says.


All languages have their place, says Gilbert, and the use of a specific language must fit the application: “Regarding ladder logic, no language can better take discrete logic in the form of inputs and set output bits. Sequential function charts suit programming for a machine that follows or runs a sequence. Graphical programming languages are best suited to programming a process-oriented application. Controllers that cover a wide range of applications will offer multiple languages.”




Author Information

Renee Robbins is senior editor for Control Engineering. Reach her at .





Visual programming: an HMI programmer’s perspective



Bridget Fitzpatrick is the practice lead for HMI and abnormal condition management at Mustang Engineering. Mustang has a very broad base of experience with sophisticated HMI tools, in recent years routinely generating 5,000-10,000 operating displays annually. “We tend to use the native platform tools where possible, rather than starting with a custom application that only interfaces independently to the control layer,” she says.




Mustang uses dedicated software to draw in Microsoft Visio and convert its drawings to control interfaces, although that is not the most common process. “Basically, the new open system HMIs create a new generation of interfaces and possibilities,” she says. “Moving data around the system is much simpler in many cases.”




Regarding the graphical drag-and-drop and connection methods of modern open systems control languages, “the main benefits are the apparent ease of use and the relative ease of troubleshooting. Copying and cloning for a new similar application tends to be much easier as well,” she says. “On larger scale projects, we tend to make one template for each major type of control and then sort out a method for bulk importing or bulk building.”




As for drawbacks, “in reality, the purely graphical methods tend to look easy, but there can be pitfalls hidden from clear view, layered in dialog boxes that may not be entirely intuitive. At times, there can also be issues where data can be read in and out in only limited formats, which may not be intuitive to less technical users. Error messaging can also be a bit cryptic and less precise than formally coded applications.”




Fitzpatrick says, “At times, graphical programming is clearly the best way; at other times, it’s a bit too simplistic to manage effectively. If too complicated, alternate means of troubleshooting and operator presentation are required.”



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.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Learn how to create value with re-use; gain productivity with lean automation and connectivity, and optimize panel design and construction.
Go deep: Automation tackles offshore oil challenges; Ethernet advice; Wireless robotics; Product exclusives; Digital edition exclusives
Lost in the gray scale? How to get effective HMIs; Best practices: Integrate old and new wireless systems; Smart software, networks; Service provider certifications
Fixing PID: Part 2: Tweaking controller strategy; Machine safety networks; Salary survey and career advice; Smart I/O architecture; Product exclusives
The Ask Control Engineering blog covers all aspects of automation, including motors, drives, sensors, motion control, machine control, and embedded systems.
Look at the basics of industrial wireless technologies, wireless concepts, wireless standards, and wireless best practices with Daniel E. Capano of Diversified Technical Services Inc.
Join this ongoing discussion of machine guarding topics, including solutions assessments, regulatory compliance, gap analysis...
This is a blog from the trenches – written by engineers who are implementing and upgrading control systems every day across every industry.
IMS Research, recently acquired by IHS Inc., is a leading independent supplier of market research and consultancy to the global electronics industry.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

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.