“Clean code” and architecture for Industry 4.0


About Leuze

Leuze electronic is one of the world’s leading innovators in optoelectronic sensor technology and is internationally renowned as a leading manufacturer and system provider in the field of electrical automation. Its core focuses are on intralogistics and the packaging industry, machine tool construction, the automotive industry and medical technology. The portfolio includes switching and measuring sensors, identification systems, image processing and data transmission systems and also safety at work components and systems. Founded in 1963, the company, which has its headquarters in Owen/Teck, Germany, possesses both specific application knowhow and wide-ranging knowledge of the sector.
Over 1,000 employees at 22 locations are active in the fields of development, production, sales and service, supported by more than 40 worldwide sales partners. Innovative product development, custom-built global solutions and a comprehensive range of services all spell Smart Sensor Business 4.0 at Leuze electronic.

Intelligent camera systems play a key role in the digitalisation of industry. Specially designed optics and lighting together with cutting-edge sensor technology give the systems their power. However, the special ‘intelligence’ for Industry 4.0 of these modular camera systems is down to their software, which is continuously refined for different variants and enhanced with new features. To ensure a clean architecture and code basis for the software platform of their new camera-based code reader DCR 200i, Leuze electronic has opted for the Axivion Suite.
The DCR 200i by Leuze is a reader for identifying bar, stacked and 2D codes. It provides excellent reading results even at conveyor belt speeds of up to six metres per second. Thanks to its modular design the DCR 200i adapts flexibly to a wide variety of different demands. With the aid of the configuration wizard in integrated webConfig tools it can easily be set up, operated and maintained. The camera can even be configured using a smart phone app.

Why Axivion?

Axivion ensures a clean architecture and code basis for the software

Thanks to the improved maintainability of the software, product lifetimes are prolonged

The already impressive feature set of Axivion is fully customizable to meet the customers' individual needs

The fast results in the daily build made the use of Axivion a success right from the start

Axivion identifies potential errors at the early development stage and saves great deal of work, time and money

Axivion and the automated regular reports integrate seamlessly into exsisting development processes

The key factor for us is that the Axivion Suite has a high level of adaptability unsurpassed by any other tool suite. That is the only way we can continue meeting our own high quality standards for our intelligent sensors in an increasingly digitalised industrial environment.

Kai Siegwart, Competence Center Software, Software Quality Assurance at Leuze electronic GmbH & Co. KG

The Challenge

The outstanding performance of the DCR 200i is down to its powerful hardware coupled with state-of-the-art software. The DCR 200i is based on a software platform developed in-house which also forms the foundation for other Leuze product ranges. This framework comprises a complex components system with numerous variants. For the developers at Leuze the challenge now is to check and maintain the software platform codebase, which is being continuously extended during ongoing operational use. The aim is to guarantee the maintainability of the software over long product lifetimes which often exceed ten years.

Because the framework forms the basis for several product lines with varying functional scopes, the code checking process focuses particularly on locating and evaluating dead, unused and duplicate code. In addition to this it was required to check the code for compliance with both generally accepted programming guidelines such as MISRA and also self-defined specifications. Software metrics, for instance regarding complexity and nesting depth, have to be checked for compliance with thresholds. Both new developments and the extensive codebase at Leuze in C and C++ have to be analysed.

The Solution

After in-depth evaluation of various tools, Leuze Competence Center Software chose the Axivion Suite. Alongside the tool suite’s impressive analysis functionality, the decisive factor was its adaptability: The out-of-the-box version of Axivion Suite was heavily customised for Leuze. In doing so the Axivion professional services team enhanced the standard code and architecture verification tools provided with the tool suite by adding company-specific style checks and integrating them into the automated analysis process.

Particularly in critical end application areas, such as data exchange between the framework’s components, the architecture verification plays a key role. To ensure the proven backing up of this data it is vital for the communication to fully meet the architecture’s specifications and it is here that, in addition to the custom rules, the Axivion Suite’s architecture analysis comes into play. This detects possible deviations from the pre-defined model and supports software developers and architects in the quality assurance of the codebase for the multi-product software platform.

The Success

The fast results in the daily build made the use of the Axivion Suite a success for the development team right from the start. The warnings of potential errors at the early development stage saved the team a great deal of work. If these potential trouble spots in the source code had not been detected until the system test, this could have resulted in a major additional workload, which can now be avoided from the outset. A further factor facilitating the daily development process is the automated checking of company-specific metrics and programming guidelines. This enables Leuze to check not only the fulfilment of normal industry expectations regarding high software quality but also its own even more stringent standards.

Despite these highly individual adaptations, the tool suite and its automated regular reports were integrated seamlessly and rapidly into the development process. In its analyses the Axivion Suite includes not only newly-written code lines but also the software’s codebase via targeted delta analysis. The tool suite reliably detects duplicates using its clone recognition algorithms, it locates potentially problematic code areas, identifies style violations and tracks down cyclical dependencies. Thanks to this continuous checking of the source code during the daily build Leuze is able to actively counteract creeping software erosion, i.e. the steady loss of software quality. 

As part of the Leuze “Clean Code” initiative developers attend to the software platform’s codebase during in-house “Axivion days”. The aim of these sessions is to improve not only newly developed code but also the old codebase step by step with the aid of Axivion Suite. This enables Leuze to maintain the high quality of the software used in both its tried-and-tested and newly developed intelligent cameras and sensors for use in Industry 4.0.

Need more information?


Request a meeting with one of our experts to find out how Axivion can help you ensure the high quality of your software code.


Contact us