Operator web apps instead of HMI licences

How a web app on a tablet handles setup, configuration and commissioning, what it has to do without a network, and what stays in the controller.

  1. TabletPWA, service worker
  2. Plant Wi-Fimay drop out
  3. Edge deviceWebSocket service
  4. Controllerchecks and decides
The app requests, the controller decides. Emergency stop and safety functions never run through the tablet.

An operator app built as a progressive web app runs in the browser of any tablet, is updated centrally and keeps working without internet thanks to its service worker. In BLUECTRL, the platform of BLUELINE / Linetechnology GmbH for modular recycling plants, an offline-capable Angular PWA on a tablet is used for setup, configuration and commissioning and talks to the services on the edge device in real time over WebSockets. The app requests, the controller decides: emergency stop and other safety functions stay in the controller and never run through the tablet.

Every plant needs an interface for setup, configuration and commissioning. Often that is an operator panel with a runtime licence, or a laptop with special software that only a technician can use. This article describes the alternative: a web app on a tablet that keeps working without internet. In BLUECTRL, such an app runs as an offline-capable Angular PWA and talks to the edge device over WebSockets.

HMI or web app: where each fits

A classic HMI is mounted on the machine, configured in the controller vendor’s tool and licensed per device. For day-to-day operation in production, it is a proven choice. The web app has the advantage in other situations:

  • One device for many plants: the commissioning engineer carries the same tablet from module to module.
  • Central updates: a new version reaches every tablet through the browser, with no per-machine configuration work.
  • Shared code: operator app, service interface and customer portal share components and a data model.

In return it needs more architecture: network, certificates, login and versions of the edge services. The two can coexist. The panel stays for production, the web app takes over setup, commissioning and service.

What stays in the controller

The web app is not safety equipment. The emergency stop is a dedicated control device on the machine, and safety functions run in the safety-rated controller. A browser on a tablet over Wi-Fi is not designed for that.

That leads to a clear division of roles. The app sends requests, such as setting a parameter or jogging a drive in setup mode. The controller checks operating mode, interlocks and permissions, then executes or rejects. The app shows the result, not its own intent. A faulty interface can therefore only trigger what the controller allows anyway.

Angular PWA offline: the service worker at the plant

At a plant, “offline” usually means no internet while the edge device is still reachable on the local network. The Angular service worker keeps the app itself in its cache, so it starts even when the server it came from is unreachable.

Whether this works in the field comes down to these points:

  • HTTPS: service workers only run in a secure context. If the tablet loads the app over plain HTTP from the edge device’s IP address, there is no service worker and no offline operation. The edge devices therefore need certificates the tablet accepts, for example from your own CA distributed through device management.
  • What gets cached: in ngsw-config.json, the app shell and assets belong in an assetGroup with installMode: prefetch, so everything is there after the first load. Live data doesn’t belong in the cache. For master data, a dataGroup with the freshness strategy fits: network first, cache after a timeout.
  • Updates on tablets in the field: the service worker serves the installed version and downloads a new one in the background. It only takes effect on the next load, so a tablet that stays open for days keeps running the old version. SwUpdate reports VERSION_READY once a new version is available. The app then shows a notice and reloads only after confirmation, so nobody loses input in the middle of commissioning.

One last trap: if the server answers ngsw.json with a 404, the service worker deletes its caches and unregisters. A wrong path in a deployment takes offline capability away from every tablet that happens to be online.

Real time over WebSockets

For states, readings and alarms, the app keeps a WebSocket connection to the edge device. The service worker does not intercept it. As a result, an app served from the cache talks directly to the current edge services. The message format therefore needs a version identifier, and the edge services have to understand the previous app version for a transition period.

A simple pattern helps. After every connect, the edge device first sends the complete state, then only changes with a sequence number. If a number is missing, the app requests the full state again. That way a dropped connection leaves no gaps and no messages processed twice.

Lost connections: what the app does

Wi-Fi at plants drops out, for example behind steel structures or when moving between modules. The app has to notice immediately. An application-level heartbeat also reveals connections that look open but no longer deliver anything. Reconnects use a growing delay with some randomness, so not every tablet knocks at the same time.

Three rules apply to the display:

  • Mark stale values: after a drop, the app shows the last known state with its timestamp, clearly recognisable as out of date.
  • Never queue commands: a command issued without a connection must not run later on its own. The situation at the machine may have changed. The app disables controls while there is no connection.
  • Keep input: a half-finished configuration is kept locally. After reconnecting, it is only sent once the user explicitly confirms.

Interfaces for service and end customers with tenant isolation

Your own service team and your end customers care about the same data: plant status, faults, history. A web interface at the central site covers this and shares components with the operator app. With several customers on one platform, tenant isolation is the most important property.

It belongs in the backend, not in the interface. The tenant comes from the login, never from a URL parameter. In PostgreSQL, row-level security can enforce the separation in the database as well. Where Grafana is enough for dashboards, separate organisations per customer keep data and access apart. Where customers may trigger functions, the same rules apply as at the plant: the controller decides.

Summary for management

An operator web app replaces special software for setup, configuration and commissioning with a tablet that works at every module and is updated centrally. The classic operator panel can stay for production. The effort lies in certificates, in behaviour when connections drop, and in tenant isolation once customers have access too. Safety functions stay in the controller unchanged, and the app can only make requests.

Sources

Let’s talk about your devices

Which devices, how many, what is missing today: a short paragraph is enough for a first assessment.