Skip to Content

← All functionalities

Fuse test benchRaspberry PLC 19RGPIOHMI / Dashboard

A touchscreen HMI in plain Tkinter, beacons included

A Tkinter HMI on a Raspberry PLC needs no web stack, no SCADA license — just the Python that ships with Raspberry Pi OS. This example renders a fullscreen 850×550 interface with live current, voltage-drop and temperature displays refreshed every 500 ms, big finger-sized mode buttons, and green/amber/red stack-light beacons driven by PLC relays R0.1, R0.2 and R0.8. The layout comes from a real fuse test bench deployment.

Kiosk mode for an operator panel

The window opens with fullscreen attributes on a dedicated touchscreen: no desktop, no window chrome, nothing to fat-finger. Display labels use 42 pt bold type readable from across the bench, and the three action buttons — direct mode, automatic mode, stop — span the full width at two text lines of height.

Refresh with after(), not threads

All process values update through Tkinter's after() scheduler: the GUI thread reads the latest measurements every 500 ms and repaints. No background threads touching widgets, no race conditions — the classic Tkinter pitfall avoided by design while the acquisition modules do the slow work.

Beacons mirror machine state

The stack light is the HMI for everyone not standing at the screen: amber at startup (ready), green while a test runs, red latched on any fault. One helper switches relays exclusively, so two colours can never be lit at once and the state is unambiguous from across the workshop.

A snippet from the implementation

Straight from the example as deployed on the Raspberry PLC 19R — copy it freely:

def set_beacon(active_color):
    """Turn on a single beacon and switch off the rest (exclusive state)."""
    for color, relay in BEACONS.items():
        state = rpiplc.HIGH if color == active_color else rpiplc.LOW
        rpiplc.digital_write(relay, state)

The full example is a complete program — wiring header, setup and main loop — ready to adapt to your application.

Frequently asked questions

Why Tkinter instead of a web dashboard?

Zero dependencies and total offline reliability. The bench must work with no network and survive OS reimages; Tkinter is in the standard library, starts in under a second and runs for weeks.

Does the GUI block the test sequence?

No. The sequence logic runs from the same event loop via after() callbacks, and the heavy I/O (SCPI, I2C) completes in milliseconds. For hour-long tests the loop simply reschedules itself.

Can I drive real stack lights directly from the PLC relays?

Yes, that is the point of the Raspberry PLC. The R0.x outputs are dry-contact relays rated for 24 V signal beacons, so the lights wire straight to the terminals without external relay boards.

Related functionalities