Automatic PLC Code Generation & Design Interchange Standards

Automatic PLC Code Generation & Design Interchange Standards
Automatic PLC Code Generation & Design Interchange Standards

Now your computer can program the PLC!
Open standards, more powerful desktop computers, and lower cost software are making design, modeling, and automatic code generation for PLCs and PACs practical for improving automation.
Innovations in Product Life Cycle Management (PLM), modeling and simulation software are enabling virtual designs of machine, production lines and processes to avoid costly mistakes in actual implementation. The entire plant and controls can be commissioned virtually to find problems before committing to real machines and controls - reducing the time it takes to startup the manufacturing process and avoiding costly rework at production startup time. 
Open communications between modeling, simulation, PLC software and controllers is essential to achieve wide adoption of virtual design methods.
The following illustrates progress made in modeling and automatic PLC/PAC code generation.
PLCopen XML Standard
The PLCopen XML interchange standard version 2.01 is an open (non-proprietary) data interchange standard that has been adopted by the AutomationML group as part of an initiative to offer a common, top level XML format for all plant data including topology data, 3D geometry, kinematic data, sequence description, and logic information. There are proprietary approaches to accomplish code generation from models, but they use proprietary interchange formats unique to the modeling software and specific PLC vendor’s products, and therefore limit application possibilities.   The PLCopen standard provides a vendor neutral open standard to accomplish the objective of broad adoption. 
The PLCopen XML schemas and documentation as well as an introduction are available free to anyone.  The downloadable files include a 156 page explanation of the PLCopen XMLSchema and a 58 page document describing the standard and XML schema files.
AutomationML is gaining momentum as an overall standard for design and open plant information interchange. The goals of AutmationML are to reduce engineering costs, lower engineering time, open engineering data to protect investment, and lower entry barriers for innovative niche product & service vendors, seamless data transport, and data consistency. The AutomationML group notes that the economic driver for their efforts is that nearly 60% of the costs of automation control and robotics today are engineering and commissioning.   Automation and controls members of the organization include ABB, Kuka, Siemens, and Phoenix Contact.
In addition to the PLCopen XML standard, AuotmationML has also adopted other standards including CAEX, COLLADA, and MathML.
CAEX (Computer Aided Engineering Exchange) a neutral data format that allows storage of hierarchical object information such as the hierarchical architecture of a plant. CAEX is currently applied in the areas of process engineering, control engineering, oil & gas industry and manufacturing automation engineering.   On 12 August 2008, the final version of IEC 62424 (Ed. 1.0) was published.
COLLADA - Digital Asset and FX Exchange Schema
COLLADA defines an open standard XML schema for exchanging digital assets among various graphics software applications that might otherwise store their assets in incompatible file formats. COLLADA documents describe digital assets as XML files, usually identified with a .dae (digital asset exchange) filename extension.
MathML (Mathematical Markup Language) is a low-level specification for describing mathematics as a basis for machine to machine communication. This specification, from the W3C group, is based on XML for describing mathematical notation and capturing both its structure and content.   The goal of MathML is to enable mathematics to be served, received, and processed just as HTML has enabled this functionality for text.  More information.
More information will be available at the AutomationML User Conference which will take place on May 5-6, 2010 at ABB Forschungszentrum Ladenburg near Mannheim, Germany. At the conference, topics to be discussed include data formats, AutomationML concepts, developer workshops, tools for supporting AutomationML and future developments. AutomationML User Conference Information
The AutomationML Specification - Part I - Architecture can be downloaded in the public section of
MathWorks Simulink – PLC Code Generator
In March of 2010, MathWorks introduced the Simulink PLC Coder that automatically generates PLC code from models. The Simulink PLC Coder™ generates IEC 61131 structured text from Simulink® models, Stateflow® charts, and Embedded MATLAB® functions.  The MathWorks documentation notes that unique structured text is created for the target controller, “The exported IEC 61131 structured text file created from the models are unique for each vendor to address specific target controller software.”

The Simulink PLC Coder supports the following IDEs (Integrated Design Environment) by exporting IEC 61131 structured text in the target vendors IDE file format. The exported structured text accounts for addressing restrictions and handles non-IEC 61131-3 programming in the target controller.

  • 3S-Smart Software Solutions CoDeSys 2.3, 3.3

  • B&R Automation Studio™ 3.0

  • Beckhoff® TwinCAT® 2.11

  • Rockwell Automation® RSlogix™ 5000 17, 18

  • PLCopen XML version 2.01 Standard


Simulink PLC was developed independently by MathWorks and is very similar to PLC Link software from DEIF, which is described next. The Simulink PLC Coder is available with U.S. list prices starting at $10,000. More information
PLC Link – PLC Code Generator
The PLC Link product from DEIF was introduced in the summer of 2009 and appears to perform essentially the same function as MathWorks Simulink PLC. PLC Link capabilities include PLC-in-the-loop testing, PLC system real-time monitoring, and online parameter tuning. DEIF is a PLCopen member company and supports the PLC XML standard.

DEIF Test & Simulation

PLC Link, MathLab Model and CoDeSys Structured Text Screens
DEIF Supported target controllers include:

  • 3S - CoDeSys

  • Bachmann - M-PLC

  • Beckhoff - TwinCAT

  • KW-Software - MULTIPROG


  • Siemens - SIMATIC STEP7

  • IecEdit

  • Rockwell - RSLogix5000

  • PLCopen XML version 2.01 Standard

Thoughts and Observations
The standards and technologies are starting to emerge that will enable virtual design of machines, production lines and processes to avoid costly mistakes in actual implementation. New, open solutions significantly lower the cost for users and therefore increase the return on investment.
This is similar to the trend in 3D CAD using digital prototyping, modeling, 3D CAD, finite analysis, stress analysis, and other new tools as a transformational business strategy. I recently wrote an article about this trend as it applies to a company called A.T. Ferrell, Digital Prototyping Comes Naturally to 140 Year Old Company.
Using these tools at the beginning of a project helps optimize designs and will allow identification of problems early before they become expensive.
The new open standards, modeling software, and code generating software are exciting developments.
Adopting these technologies has the potential to give companies an edge over their competition by lowering costs and risk.
I have seen demonstrations of these products but have not field tested them so you might want to get a free trial to test them.


Did you enjoy this great article?

Check out our free e-newsletters to read more great articles..