opc-client
package main
import (
"fmt"
"github.com/konimarti/opc"
)
func main() {
client, _ := opc.NewConnection(
"Matrikon.OPC.Simulation.1", // ProgId
[]string{"localhost"}, // OPC servers nodes
[]string{"Random.Real8", "Random.String"}, // slice of OPC tags
)
defer client.Close()
// read single tag: value, quality, timestamp
fmt.Println(client.ReadItem("Random.Real8"))
// read all added tags
fmt.Println(client.Read())
}