Building an Industrial HMI and Edge Controller on STM32 with FreeRTOS and Modbus TCP
DEV Community

Building an Industrial HMI and Edge Controller on STM32 with FreeRTOS and Modbus TCP

Building an Industrial HMI and Edge Controller on STM32 with FreeRTOS and Modbus TCP Industrial control demos are often judged by the screen. The more useful question is whether the firmware, HMI and simulated process all explain the same state transition. SLX FlowControl is a demonstrator built on an STM32H750B-DK. It combines a FreeRTOS control task, an LVGL touch HMI, a Modbus TCP/IP server and a Factory I/O Fill Tank digital twin. The goal is to make behaviour testable before a physical machine is connected. The problem behind the demo A buffer tank must accept incoming fluid, supply downstream demand and retain an operating reserve around a target level. That sounds simple until commands overlap, sensors are missing at startup, data stops arriving or an operator needs to understand why the process will not restart. The design therefore treats field demand, automatic control, conflicts, alarms and recovery as explicit machine states. It does not leave them as special cases hidden inside a main loop. Architecture at a glance - A periodic FreeRTOS control task runs every 100 ms. - Factory I/O acts as a Modbus TCP client; the STM32 acts as the server. - The Modbus map separates measurements, field commands, valve outputs and diagnostics. - LVGL exposes the same state through dashboard, process view, controls, session recipes, alarms, setup and diagnostics. - Fill and discharge are mutually exclusive. A simultaneous request becomes an explicit conflict, not an ambiguous valve command. A sequence worth validating early The most useful part of the digital twin is not the animation. It is the ability to test a complete operational sequence: - The controller starts in STOPPED . Before the first Modbus exchange, the HMI reports sensors as pending rather than raising a misleading blocking alarm. - A field request for fill or discharge is reflected by the virtual valve, signal tower, firmware state and HMI. - Two seconds after both commands are released, AUTO moves the level back toward the target with a ยฑ1% deadband. - After another two seconds with both valves closed, field commands are accepted again. - When control is requested, communication loss or stale sensor data drives outputs to a safe state within 1.5 seconds. That sequence gives firmware, commissioning and product teams a common object to review before final I/O hardware and plant testing exist. Watch the short demonstration Watch the SLX FlowControl short demo on YouTube: Factory I/O digital twin, touch HMI and STM32 edge-control logic shown together. HMI is part of the control design The HMI is designed to explain what the controller is doing, not only to display a red alarm. Alarm pages carry severity, first-out context, cause, required action and a guided reset path. Acknowledge cannot force a restart while the underlying cause is still present. The same principle applies to diagnostics: network state, sensor freshness and configuration validity need to be visible so an operator can distinguish waiting, inhibited and faulted behaviour. What the demonstrator does not claim SLX FlowControl is validated in simulation and on target firmware. It is not a substitute for risk analysis, hardwired safety functions, physical-process validation, authenticated access, OT firewalls or persistent production logging. Modbus TCP in this build does not add authentication or encryption. A production machine needs network segmentation and security controls appropriate to its operational context. Takeaway A digital twin can be a practical engineering tool when it lets a team validate real firmware behaviour, operator feedback and failure paths before field integration. The value is not a prettier demo. It is a clearer contract between process, controller and operator. Read the complete case study, including visuals and technical context: SLX FlowControl: Industrial HMI and Edge Control on STM32. Top comments (0)

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.