Machine software customization is everyday business for many machine builders: a base machine is delivered with a different format, an extra station, another drive or a connection to the customer’s systems. The mechanical design is often modular, but the software is not. The program of the last similar machine is then copied and adapted for each order – until nobody knows which machine runs which version.
This guide shows how to structure control and machine software so that customer requirements are implemented through configuration rather than reprogramming: with a modular structure, parameters, options, libraries, version control and documentation that keeps up with the variants.
The problem with copied programs
Copy and adapt is the fastest route to the first special machine – and the most expensive route to the tenth. Each copy carries the errors of its template forward, and every bug fix then has to be applied to all copies, provided anyone knows where they all are. After a few years, dozens of program versions exist that differ in details that are not documented anywhere.
Service feels the consequences most. Anyone called to a fault at a customer site first has to find out which version runs on this machine and how it differs from the others. Extensions take longer because every machine is a special case. And the knowledge about the differences sits in the heads of a few employees.
- Program versions per machine instead of per function
- Bug fixes that only reach individual copies
- High effort for commissioning and service with every variant
- Dependence on a few people who know the differences
Modular structure: breaking the machine down into functions
The basis for manageable variety is software that follows the structure of the machine. Each functional unit – a station, a conveyor, a gripper, an axis – is programmed as a separate module with clear interfaces: which commands does it accept, which states does it report, which alarms does it generate? The higher-level sequence control only knows these interfaces, not the internals.
With this structure, an additional station is no longer programmed into existing code but plugged in as another module. Current programming environments support this with function blocks, libraries and, in some cases, object-oriented language features. What matters is less the technology than the discipline: a module should not need to know which machine it is part of.
A uniform module framework helps as well. When all units share the same operating modes, the same step logic and the same way of reporting faults, programmers and maintenance staff quickly find their way around every variant.
Parameters instead of programming
Many customer requests do not involve a new function but different values: a different format, a different speed, a different sensor, a different number of lanes. Such differences belong in parameters, not in program code. The software then contains the variants of a function, and the configuration decides which one is active.
A clear separation of levels pays off. Machine parameters describe design and equipment and are set during commissioning, such as axis lengths, drive types or installed options. Recipe and product parameters change with the product and are selected by the operator within their permissions. If the two are mixed, a recipe change can unintentionally alter the machine configuration.
Parameters need the same care as code: they should be backed up, versioned and given limits that prevent nonsensical entries. A parameter list with meaning, unit and permitted range is part of the documentation.
- Machine parameters: design and equipment, set during commissioning
- Option switches: which assemblies and functions are installed
- Recipe and product parameters: values that change with the product
- Limits and permissions: who may change what, and within which range
Planning options and variants
Not every option can be foreseen, but most of them recur. An options list maintained jointly by sales, mechanical design and software is therefore a good starting point. For each option, it is defined how it is represented in the software: as a parameter, as a module that can be switched on, or as genuine custom programming.
There are two common approaches for the controller. Either one shared program contains all options, which are activated by configuration – this keeps the number of program versions small but makes the program larger. Or the program for a specific machine is assembled from modules, ideally partly automated from the configuration. Which approach fits depends on the number and type of variants, the control platform and the way service works.
There will always be genuine special requests. What matters is that they remain recognizable as such: in a separate, clearly named module, documented and assigned to the order, rather than scattered through the standard code. If they prove their worth, they can later be adopted into the standard.
Libraries and version control
Modules used in many machines belong in a maintained library with version numbers. A bug fix is then made once in the library and rolled out specifically to the machines that need it. Just as important is the rule that library modules are not modified in individual projects – otherwise copies appear again.
Version control systems such as Git are increasingly common in control engineering as well. Some programming environments integrate them directly; for others, export formats or additional tools help. What matters is that for every machine delivered, it is clear which program version, which library versions and which parameters are running on it.
A change log for each machine closes the loop: what was changed during commissioning or later service visits, and has that change made it back into version control? Changes that only exist on the controller at the customer site are a frequent cause of surprises on the next visit.
- Libraries with version numbers and a change log
- No local changes to library modules
- Version control for program and parameters
- Program version, libraries and parameters assigned to every serial number
- Changes made on site fed back promptly
Documentation that keeps up with the variants
With every variant, the risk grows that documentation and actual state drift apart. It helps to generate documentation where the information originates: module descriptions directly in the code, parameter lists from the configuration, alarm texts from a shared source. That way, the documentation changes when the software changes.
Each machine should also have a short data sheet describing its configuration: options, parameter set, program version, special features. This helps service as much as the customer who asks for an extension years later. Our guide on how to extend an existing PLC program explains how to take over a program without such documents.
Step by step to variant-ready software
Hardly any machine builder can rebuild all of their software at once. A step-by-step approach that starts with the next new machine and gradually brings in the existing installed base has proven effective. If the machine also includes an operator interface, data acquisition or a connection to the customer’s ERP system, the same principles apply; our guide to software for machines and plants explains when a dedicated solution pays off.
- Review the installed base: which variants and options actually exist, and where do the programs differ?
- Define functional units and interfaces, and a uniform module framework
- Move frequent differences into parameters and option switches
- Transfer recurring modules into a versioned library
- Introduce version control and a per-machine assignment
- Implement new orders on the new structure, update existing machines when they are extended