All Projects → konimarti → Opc

konimarti / Opc

Licence: mit
OPC DA client in Golang for monitoring and analyzing process data based on Windows COM.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Opc

Fuxa
Web-based Process Visualization (SCADA/HMI/Dashboard) software
Stars: ✭ 262 (+131.86%)
Mutual labels:  plc, iot, scada
CyberICS.github.io
News and publication on cybersecurity in industry
Stars: ✭ 29 (-74.34%)
Mutual labels:  plc, scada
iot-master
物联大师是开源免费的物联网智能网关系统,集成了标准Modbus和主流PLC等多种协议,支持数据采集、公式计算、定时控制、自动控制、异常报警、流量监控、Web组态、远程调试等功能,适用于大部分物联网和工业互联网应用场景。
Stars: ✭ 119 (+5.31%)
Mutual labels:  plc, scada
Firewalla
http://firewalla.com
Stars: ✭ 305 (+169.91%)
Mutual labels:  iot, monitoring
Iot Dc3
IOT DC3 is an open source, distributed Internet of Things (IOT) platform based on Spring Cloud. It is used for rapid development of IOT projects and management of IOT devices. It is a set of solutions for IOT system.
Stars: ✭ 195 (+72.57%)
Mutual labels:  plc, iot
TcOpen
Application framework for industrial automation built on top of TwinCAT3 and .NET.
Stars: ✭ 187 (+65.49%)
Mutual labels:  plc, scada
Crate
CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of data in real-time.
Stars: ✭ 3,254 (+2779.65%)
Mutual labels:  iot, scada
Opcua
A client and server implementation of the OPC UA specification written in Rust
Stars: ✭ 202 (+78.76%)
Mutual labels:  iot, monitoring
Icsmaster
ICS/SCADA Security Resource(整合工控安全相关资源)
Stars: ✭ 582 (+415.04%)
Mutual labels:  plc, scada
Grassmarlin
Provides situational awareness of Industrial Control Systems (ICS) and Supervisory Control and Data Acquisition (SCADA) networks in support of network security assessments. #nsacyber
Stars: ✭ 621 (+449.56%)
Mutual labels:  monitoring, scada
Isf
ISF(Industrial Control System Exploitation Framework),a exploitation framework based on Python
Stars: ✭ 690 (+510.62%)
Mutual labels:  plc, scada
Sharpscada
C# SCADA
Stars: ✭ 2,043 (+1707.96%)
Mutual labels:  plc, scada
Netdata
Real-time performance monitoring, done right! https://www.netdata.cloud
Stars: ✭ 57,056 (+50392.04%)
Mutual labels:  iot, monitoring
Industrial-Security-Auditing-Framework
ISAF aims to be a framework that provides the necessary tools for the correct security audit of industrial environments. This repo is a mirror of https://gitlab.com/d0ubl3g/industrial-security-auditing-framework.
Stars: ✭ 43 (-61.95%)
Mutual labels:  plc, scada
Tdengine
An open-source big data platform designed and optimized for the Internet of Things (IoT).
Stars: ✭ 17,434 (+15328.32%)
Mutual labels:  iot, monitoring
Cutehmi
CuteHMI is an open-source HMI (Human Machine Interface) software written in C++ and QML, using Qt libraries as a framework. GitHub repository is a mirror!
Stars: ✭ 90 (-20.35%)
Mutual labels:  iot, scada
Angular5 Iot Dashboard
Multipurpose dashboard admin for IoT softwares, remote control, user interface. Develop your client dashboards in Angular 5 with vast variety of components available.
Stars: ✭ 148 (+30.97%)
Mutual labels:  iot, monitoring
Oshmi
SCADA HMI for substations and automation applications.
Stars: ✭ 180 (+59.29%)
Mutual labels:  iot, scada
Iotclient
这是一个物联网设备通讯协议实现客户端,将会包括主流PLC通信读取、ModBus协议、Bacnet协议等常用工业通讯协议。本组件终身开源免费,采用最宽松的MIT开源协议,您可以随意修改和商业使用(商业使用请做好评估和测试)。
Stars: ✭ 311 (+175.22%)
Mutual labels:  plc, iot
Hslcommunication
An industrial IoT underlying architecture framework, focusing on the underlying technical communications and cross-platform, cross-language communication functions, to achieve a variety of mainstream PLC data reading and writing, to achieve modbus of various protocols read and write, and so on, to support the rapid construction of industrial upper computer software, configuration software, SCADA software, factory mes system, To help enterprise Industry 4.0 take-off, to achieve intelligent manufacturing, smart factory goals. The main PLC contains Siemens, Mitsubishi, Omron, Panasonic, Modbus, AB-PLC, Redis
Stars: ✭ 816 (+622.12%)
Mutual labels:  plc, iot

OPC DA in Go

License GoDoc goreportcard

Read and write process and automation data in Go from an OPC server for monitoring and data analysis purposes (OPC DA protocol).

go get github.com/konimarti/opc

Usage

client, _ := opc.NewConnection(
	"Graybox.Simulator", 		// ProgId
	[]string{"localhost"}, 		// Nodes
	[]string{"numeric.sin.float"}, 	// Tags
)
defer client.Close()
client.ReadItem("numeric.sin.float")
browser, _ := opc.CreateBrowser(
	"Graybox.Simulator", 		// ProgId
	[]string{"localhost"}, 		// Nodes	
)
opc.PrettyPrint(browser)

Installation

  • go get github.com/konimarti/opc

Troubleshooting

  • OPC DA Automation Wrapper 2.02 should be installed on your system (OPCDAAuto.dll or gbda_aut.dll); the automation wrapper is usually shipped as part of the OPC Core Components of your OPC Server.
  • You can get the Graybox DA Automation Wrapper here. Follow the installation instruction for this wrapper.
  • Depending on whether your OPC server and automation wrapper are 32-bit or 64-bit, set the Go architecture correspondingly:
    • For 64-bit OPC servers and wrappers: DLL should be in C:\Windows\System32, use $ENV:GOARCH="amd64"
    • For 32-bit OPC servers and wrappers: DLL should be in C:\Windows\SysWOW64, use $ENV:GOARCH="386"
  • Make sure to have correct DCOM settings on your local and remote computers: Dcomcnfg.exe

Reporting Issues

  • If you find a bug in the code, please create an issue and suggest a solution how to fix it.
  • Issues that are related to connection problems are mostly because of a faulty installation of your OPC automation wrapper or some peculiarties of your specific setup and OPC installation. Since we cannot debug your specific situation, these issues will be directly closed.

Debugging

  • Add opc.Debug() before the opc.NewConnection call to print more debug-related information.

Testing

  • Start Graybox Simulator v1.8. This is a free OPC simulation server and require for testing this package. It can be downloaded here.
  • If you use the Graybox Simulator, set $GOARCH environment variable to "386", i.e. enter $ENV:GOARCH=386 in Powershell.
  • Test code with go test -v

Example

package main

import (
	"fmt"
	"github.com/konimarti/opc"
)

func main() {
	client, _ := opc.NewConnection(
		"Graybox.Simulator", // ProgId
		[]string{"localhost"}, //  OPC servers nodes
		[]string{"numeric.sin.int64", "numeric.saw.float"}, // slice of OPC tags
	)
	defer client.Close()

	// read single tag: value, quality, timestamp
	fmt.Println(client.ReadItem("numeric.sin.int64"))

	// read all added tags
	fmt.Println(client.Read())
}

with the following output:

{91 192 2019-06-21 15:23:08 +0000 UTC}
map[numeric.sin.int64:{91 192 2019-06-21 15:23:08 +0000 UTC} numeric.saw.float:{-36.42 192 2019-06-21 15:23:08 +0000 UTC
}]

Applications

opc-cli

  • opc-cli is a command-line interface to work with OPC servers: list available OPC servers, browse OPC tags on server, and read/write OPC tags.

  • Install it with go install github.com/konimarti/opc/cmds/opc-cli

    • List OPC servers on a specific node:

      $ opc-cli.exe list localhost
      Found 3 server(s) on 'localhost':
      Graybox.Simulator.1
      INAT TcpIpH1 OPC Server
      Prosys.OPC.Simulation
      
    • Browse OPC tags (in sub-branch):

      $ opc-cli.exe browse localhost Graybox.Simulator.1 textual
      textual
         - textual.color
         - textual.number
         - textual.random
         - textual.weekday
      
    • Write to OPC tag:

      $ opc-cli.exe write localhost Graybox.Simulator.1 options.sinfreq 0.01
      
    • Read OPC tags:

      $ opc-cli.exe read localhost Graybox.Simulator.1 options.sinfreq numeric.sin.float
      map[options.sinfreq:{0.05 192 2019-06-21 15:26:02 +0000 UTC} numeric.sin.float:{22.916641 192 2019-06-21 15:26:02 +0000 UTC}]
      

OPCAPI

  • Application to expose OPC tags with a JSON REST API.

    • Install the app: go install github.com/konimarti/opc/cmds/opcapi

    • Create config file:

      [config]
      allow_write = false
      allow_add = true
      allow_remove = true
      
      [opc]
      server = "Graybox.Simulator"
      nodes = [ "localhost" ]
      tags = [ "numeric.sin.float", "numeric.saw.float" ]
      
      
    • Run app:

      $ opcapi.exe -conf api.conf -addr ":4444"
      
    • Access API:

      • Get tags:
        $ curl.exe -X GET localhost:4444/tags
        {"numeric.saw.float":-21.41,"numeric.sin.float":62.303356}
        
      • Add tag:
        $ curl.exe -X POST -d '["numeric.triangle.float"]' localhost:4444/tag
        {"result": "created"}
        
      • Remove tag:
        $ curl.exe -X DELETE localhost:4444/tag/numeric.triangle.float
        {"result": "removed"}
        

OPCFLUX

  • Application to write OPC data directly to InfluxDB.

    • Install the app: go install github.com/konimarti/opc/cmds/opcflux

    • Create InfluxDB database "test"

    • Create config file: Put OPC tags in []. This is required for the expression evaluation. Any calculation can be performed that can evaluated.

      ---
      server: "Graybox.Simulator"
      nodes: ["localhost", "127.0.0.1"]
      monitoring: ""
      influx:
       addr: "http://localhost:8086"
       database: test
       precision: s
      measurements: 
       numeric:
         - tags: {type: sin}
           fields: {float: "[numeric.sin.float]", int: "[numeric.sin.int32]"}
         - tags: {type: saw}
           fields: {float: "[numeric.saw.float]", int: "[numeric.saw.int32]"}
         - tags: {type: calculation}
           fields: {float: "[numeric.triangle.float] / [numeric.triangle.int32]"}
       textual:
         - tags: {type: color}
           fields: {text: "[textual.color]", brown: "[textual.color] == 'Brown'"}        
         - tags: {type: weekday}
           fields: {text: "[textual.weekday]"}        
      
    • Run app: opcflux.exe -conf influx.yml -rate 1s

Credits

This software package has been developed for and is in production at Kalkfabrik Netstal.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].