Clarifying and Extending IEC 60848 for Unambiguous GRAFCET Implementation in Embedded Systems
This work proposes guidelines for coding a grafcet on a microcontroller, following the specifications described in standard IEC 60848:2013. While previous works exist for coding a simple grafcet on platforms like Arduino or STM32, they overlook implementing timers, hierarchical structure, and other advanced resources included in the IEC 60848:2013. Throughout this study, procedures for implementing the majority of the resources described in the standard using pseudocode and C++ are presented. These resources include timers, stored actions, macrosteps, enclosures, and forcing orders, among others. Previously, it has been necessary to identify ambiguities, vagueness, inaccuracies, and the non-modular approach of the IEC 60848:2013 standard that impeded a proper and unequivocal implementation, proposing improvements and interpretations to make it more unequivocal and exportable. Examples are included to illustrate how to apply the proposed guidelines, and a template to assist in coding any grafcet is made available in a repository. As a result, this article provides designers with a complete set of tools and resources to unequivocally implement concurrent discrete-event processes. The implementation on several microcontrollers exhibits exceptional memory efficiency under scaled stress-testing conditions (100 steps and 25 timers): less than 2% of the RAM for STM32F411RE and ESP32, and less than a 1.5% increase in ROM when implementing the analysis of 100 transitions and the definition of 25 timers. This proves its scalability for complex discrete-event applications. Cycle times depend on whether there is access to macrostep expansions and enclosures but are around 80 microseconds for the STM32F411 and 20 microseconds for the ESP32.
Authors
- J.V. Muñoz (ORCID: https://orcid.org/0000-0001-6190-7077)
- J. Canada-Bago (ORCID: https://orcid.org/0000-0003-1626-8274)
- Elísabet Estévez (ORCID: https://orcid.org/0000-0002-1721-3059)
- Pedro J. Casanova-Peláez (ORCID: https://orcid.org/0000-0002-7299-0790)
- Ángel Gaspar González Rodríguez (ORCID: https://orcid.org/0000-0002-7461-9135)
Institutions
- Universidad de Jaén (ES)
Publication Details
- Journal
- Electronics
- Published
- 2026-06-30
- DOI
- https://doi.org/10.3390/electronics15132854
- Primary Topic
- Real-Time Systems Scheduling
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Universidad de Jaén