https://www.mdu.se/

mdu.sePublications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
A Verification-Aware Pipeline for Programmable Logic Controllers: From Function Block Diagrams to Verified Python Code
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0002-6992-9200
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0003-2416-4205
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0003-2870-2680
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0002-8027-0611
Show others and affiliations
2025 (English)Report (Other academic)
Abstract [en]

Translating programmable logic controller (PLC) programs into analyzable software artifacts is an important step toward enabling modern software testing and verification techniques in industrial settings. This paper presents a replication study in which we use PyLC+, a translation framework for IEC 61131-3 Function Block Diagrams (FBD), together with the Nagini verifier to perform functional correctness checks on industrial safety-critical logic. PyLC+ extracts block networks from PLCopen XML and generates executable Python models that preserve block semantics, signal flow, and scan-cycle behavior. We applied this workflow to a representative set of 13 industrial POUs from an electropneumatic brake control subsystem. All 13 POUs were verified: twelve using concrete or partially abstracted FBD models, and one using an abstract requirements-level specification whose 7-tuple specification initially exposed a bug in the Nagini verifier (a lack of support for tuples with more than six elements), which was fixed by the Nagini developers. The results show that a combination of automated extraction, manual semantic reconstruction, and contract-based specification is sufficient to verify realistic industrial logic at the POU level. We also discuss the abstraction decisions, the Nagini bug uncovered by one POU, and the remaining missing block semantics that constrain how far automation can be pushed in future versions of PyLC+.

Place, publisher, year, edition, pages
Sweden, 2025. , p. 15
Keywords [en]
PLC, Formal Verification, PyLC+, Nagini, Viper, large language models, Industrial Automation
National Category
Computer Sciences
Research subject
Computer Science
Identifiers
URN: urn:nbn:se:mdh:diva-74944OAI: oai:DiVA.org:mdh-74944DiVA, id: diva2:2019808
Available from: 2025-12-08 Created: 2025-12-08 Last updated: 2025-12-09Bibliographically approved
In thesis
1. Test Automation for Industrial Programmable Logic Controller Software: From Requirements to Executable Tests
Open this publication in new window or tab >>Test Automation for Industrial Programmable Logic Controller Software: From Requirements to Executable Tests
2026 (English)Doctoral thesis, comprehensive summary (Other academic)
Abstract [en]

Programmable Logic Controllers (PLCs), which are specialized computers used to control machines and processes in industrial settings, play a vital role in the automation industry. Testing these systems to identify faults during the development phase, especially for safety-critical applications such as crane control in ports or train control systems, is crucial to ensuring the system's safety in operation. Current PLC testing practices are mostly manual, and it has been a challenge for both practitioners and researchers to develop robust, applicable test automation techniques and tools that are relevant in practice. This thesis proposes test automation solutions for PLC programs, which can improve current testing practices by augmenting manual testing. We first propose a method for selecting an appropriate test automation framework for PLCs, derived from a grey literature review and a set of empirically validated evaluation criteria. To achieve practical integration of test automation solutions, we design a method and tool, PyLC+, for automated program-to-program translation from PLC to Python. Our tool automatically translates a PLC program into executable Python code, and then verifies the latter against given assertions, using an automated Python program verifier called Nagini. PyLC+ then uses metaheuristic algorithms for automated test generation. In addition, we introduce a domain-specific LLM, PyLC-M1, which serves as an interactive test-automation assistant within PyLC+. It assists the generation of verification harnesses for formal PLC analysis while operating entirely in secure, offline environments. Investigating the applicability of a well-known syntax notation pattern for semi-formal requirements specification, called Easy Approach to Requirements Syntax, for specification-based testing through a controlled experiment is another contribution of this thesis. The applicability and efficiency of the proposed testing and verification solutions in this thesis have been evaluated on real-world industrial use cases.

Abstract [sv]

Programmerbara logikstyrenheter (PLC), som är specialiserade datorer som används för att styra maskiner och processer i industriella miljöer, spelar en viktig roll inom automationsindustrin. Att testa dessa system för att identifiera fel under utvecklingsfasen, särskilt för säkerhetskritiska applikationer som kranstyrning i hamnar eller tågstyrningssystem, är avgörande för att säkerställa systemets säkerhet i drift. Nuvarande PLC-testmetoder är mestadels manuella, och det har varit en utmaning för både praktiker och forskare att utveckla robusta, tillämpliga testautomationstekniker och verktyg som är relevanta i praktiken. Denna avhandling föreslår testautomationslösningar för PLC-program, vilka kan förbättra nuvarande testmetoder genom att utöka manuell testning. Vi föreslår först en metod för att välja ett lämpligt testautomationsramverk för PLC, härlett från en grå litteraturgenomgång och en uppsättning empiriskt validerade utvärderingskriterier. För att uppnå praktisk integration av testautomationslösningar designar vi en metod och ett verktyg, PyLC+, för automatiserad program-till-program-översättning från PLC till Python. Vårt verktyg översätter automatiskt ett PLC-program till körbar Python-kod och verifierar sedan det senare mot givna påståenden med hjälp av en automatiserad Python-programverifierare som heter Nagini. PyLC+ använder sedan metaheuristiska algoritmer för automatiserad testgenerering. Dessutom introducerar vi en domänspecifik LLM, PyLC-M1, som fungerar som en interaktiv testautomationsassistent inom PyLC+. Den hjälper till att generera verifieringsverktyg för formell PLC-analys samtidigt som den arbetar helt i säkra offline-miljöer. Att undersöka tillämpligheten av ett välkänt syntaxnotationsmönster för semiformell kravspecifikation, kallat Easy Approach to Requirements Syntax, för specifikationsbaserad testning genom ett kontrollerat experiment är ytterligare ett bidrag från denna avhandling. Tillämpligheten och effektiviteten hos de föreslagna test- och verifieringslösningarna i denna avhandling har utvärderats på verkliga industriella användningsfall.

Place, publisher, year, edition, pages
Västerås: Mälardalen University, 2026
Series
Mälardalen University Press Dissertations, ISSN 1651-4238 ; 456
Keywords
Test Automation, PLC, Python, PyLC+, Embedded Systems
National Category
Computer Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:mdh:diva-74961 (URN)978-91-7485-744-3 (ISBN)
Public defence
2026-01-22, Case, Mälardalens universitet, Västerås, 13:15 (English)
Opponent
Supervisors
Available from: 2025-12-09 Created: 2025-12-09 Last updated: 2026-01-02Bibliographically approved

Open Access in DiVA

No full text in DiVA

Authority records

Ebrahimi Salari, MikaelEnoiu, Eduard PaulSeceleanu, CristinaBucaioni, AlessioAfzal, Wasif

Search in DiVA

By author/editor
Ebrahimi Salari, MikaelEnoiu, Eduard PaulSeceleanu, CristinaBucaioni, AlessioAfzal, WasifEilers, Marco
By organisation
Embedded Systems
Computer Sciences

Search outside of DiVA

GoogleGoogle Scholar

urn-nbn

Altmetric score

urn-nbn
Total: 178 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf