SCADA architecture and Go: a modern approach

SCADA (Supervisory Control And Data Acquisition) systems combine IT and hardware components to monitor and control distributed industrial processes. With growing demands for scalability, security, and performance, modern SCADA solutions are adopting languages like Go (Golang) for their efficiency, native concurrency, and portability.

SCADA System Structure

A typical SCADA architecture includes several layers:

  • Field level: sensors, actuators, and PLCs (Programmable Logic Controllers)
  • Control level: RTUs (Remote Terminal Units) and PLCs collecting data and controlling actuators
  • Supervisory level: HMIs (Human Machine Interfaces) and SCADA servers
  • Enterprise level: integration with ERP, MES, and historical databases

Go primarily fits in the supervisory and integration layers, with potential at the control level, especially in edge computing contexts.

Advantages of Using Go in SCADA

  • Native concurrency: Goroutines make it possible to handle thousands of I/O channels and simultaneous requests with minimal footprint.
  • Simplified deployment: Compiled static binaries run on any architecture without external dependencies.
  • Security and performance: Predictable memory management and efficient built-in TCP/UDP networking enable reliable, low-latency SCADA applications.
  • Protocol support: Go libraries for Modbus, OPC UA, and MQTT are increasingly mature.

Common Use Cases for Go in SCADA

  • Protocol gateways: Converters between Modbus TCP, MQTT, OPC UA, and REST APIs.
  • Edge processing: Lightweight Go agents on Raspberry Pi or embedded systems for data preprocessing before sending it to central SCADA.
  • Data collection servers: Microservices aggregating sensor/device data with RESTful or WebSocket APIs.
  • IT integration: ETL pipelines sending SCADA data to databases, cloud platforms, or analytics systems.

Example: Modbus-to-MQTT Gateway in Go

A simplified example of a gateway reading Modbus registers and publishing them to an MQTT topic:


package main

import (
    "fmt"
    "time"

    "github.com/goburrow/modbus"
    mqtt "github.com/eclipse/paho.mqtt.golang"
)

func main() {
    handler := modbus.NewTCPClientHandler("192.168.1.100:502")
    handler.Timeout = 5 * time.Second
    handler.SlaveId = 1
    handler.Connect()
    defer handler.Close()

    client := modbus.NewClient(handler)

    opts := mqtt.NewClientOptions().AddBroker("tcp://localhost:1883").SetClientID("modbus-gateway")
    mqttClient := mqtt.NewClient(opts)
    if token := mqttClient.Connect(); token.Wait() && token.Error() != nil {
        panic(token.Error())
    }

    for {
        results, err := client.ReadHoldingRegisters(0, 4)
        if err != nil {
            fmt.Println("Modbus read error:", err)
            continue
        }
        payload := fmt.Sprintf("{\"reg0\": %d, \"reg1\": %d}", results[0], results[1])
        mqttClient.Publish("factory/metrics", 0, false, payload)
        time.Sleep(1 * time.Second)
    }
}

Integration with Existing SCADA

Legacy SCADA systems may not allow direct Go extensions, but Go can build external microservices or containers interacting via standard protocols like OPC UA, MQTT, or HTTP. It is also ideal for building API gateways exposing SCADA data to web clients or dashboards, separating business logic from the SCADA core.

Deployment and Orchestration

Go binaries are easily containerized, making them a good fit for orchestrated environments like Docker and Kubernetes. This is particularly useful in Industrial IoT (IIoT) setups requiring scalability, remote updates, and automatic failover.

Limitations and Considerations

  • Go is not a real-time OS and is unsuitable for direct millisecond-level actuator control.
  • Industrial protocol support, while improving, may still lag behind C/C++ or Java ecosystems.
  • Robust architecture design is necessary to ensure reliability in critical industrial environments.

Conclusion

Go is a promising technology for modern SCADA systems, especially for integration, edge processing, and industrial microservices. Its simplicity, efficiency, and scalability make it an excellent choice for modernizing SCADA architectures without sacrificing performance or reliability.

Back to top