The SCADA (Supervisory Control And Data Acquisition) architecture is a set of computer systems and hardware devices that enable the control and supervision of distributed industrial processes. With the growing need for scalability, security, and performance in modern SCADA systems, languages like Go (Golang) are emerging as effective solutions thanks to their efficiency, native concurrency, and portability.
Structure of a SCADA system
A typical SCADA system is composed of several layers:
- Field layer: sensors, actuators, PLCs (Programmable Logic Controllers)
- Control layer: RTUs (Remote Terminal Units) and PLCs that collect data and command actuators
- Supervision layer: HMIs (Human Machine Interfaces) and SCADA servers
- Enterprise layer: integration with ERP, MES, and historical databases
Go fits primarily into the supervision and integration layers, with potential in the control layer as well, especially in edge environments.
Advantages of using Go in SCADA
- Native concurrency: thanks to goroutines, Go can handle thousands of I/O channels and simultaneous requests with a minimal footprint.
- Simplified deployment: statically compiled binaries can be distributed on any architecture without external dependencies.
- Security and performance: the absence of uncontrollable garbage collection and the efficiency of its built-in TCP/UDP networking favor reliable, low-latency SCADA applications.
- Support for industrial protocols: Go libraries for Modbus, OPC UA, and MQTT are increasingly mature.
Common Go use cases in SCADA systems
- Protocol gateways: converters between Modbus TCP, MQTT, OPC UA, and REST APIs written in Go.
- Edge processing: small Go agents on Raspberry Pi or embedded systems to pre-process data before sending it to the central SCADA system.
- Data collection servers: microservices that aggregate data from sensors and devices, with RESTful or WebSocket APIs.
- Integration with IT systems: ETL pipelines to send SCADA data to databases, the cloud, or analytics platforms.
Example: Modbus-to-MQTT Gateway in Go
Below is a simplified example of a gateway that reads Modbus registers and publishes 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
Many legacy SCADA systems do not provide direct Go extensions, but Go can be used to build external microservices or containers that interact with the main system via standard protocols (e.g., OPC UA, MQTT, HTTP).
Go is also ideal for building API gateways that expose SCADA data to web clients or dashboards, keeping business logic separate from the core SCADA system.
Deployment and orchestration
Being easily containerizable, Go integrates well with environments orchestrated via Docker and Kubernetes. This makes it a solid choice for IIoT (Industrial IoT) environments where scalability, remote updates, and automatic failover are required.
Limitations and considerations
- Go is not real-time (not an RTOS), so it is not suitable for direct actuator control on millisecond timescales.
- Support for industrial protocols may be more limited compared to C/C++ or Java, though it is growing.
- A well-designed architecture is necessary to ensure reliability in critical industrial environments.
Conclusions
Go stands out as a promising technology in modern SCADA systems, especially for integration, edge processing, and the development of industrial microservices. Its simplicity, efficiency, and scalability make it a valuable ally for those looking to modernize SCADA architecture without compromising performance and reliability.