Enable WebSocket in OPC DA/AE Server with JSON return, first time ever

Overview

WebSocket4OPC

Enable WebSocket in OPC DA/AE Server with JSON return, first time ever

DCOM was developed more than 2 decades ago, wich was the pillar of classic OPC. Young kids out of school love dynamical languages (JavaScript/Python etc) since they are simple and straightforward. They are reluctunt to get their feet wet on this legacy technology. Luckily with the wide adoption of WebSocket in most popular languages, WebSocket makes it possible to glue dynamical languages and legacy DCOM together.

This revolutionary solution, WebSocket4OPC, brings unparalleled experience to your desktop or mobile device. It utilizes WebSocket as network transportation between quite a few different clients and classic OPC server. Meanwhile it has equipped all required features to make sure OPC data can be accessed through Internet safely and securely. Remember - all these are achieved without using DCOM, period!

Benefits

.No DCOM when connecting to a classic OPC server
.Support dynamical languages (JavaScript/Python etc)
.Return in standard JSON format
.Intuitive and easy-to-remember commands instead of long REST API
.No future DCOM vulnerability to worry
.Account authentication available
.Secure connection available
.Native mobile APP made feasible
.No tedious thousand-page OPC UA documents to read
.No OPC UA certificate configuration handle
.No OPC UA firewall configuration
.Edge or Gateway deployment ready

Pre-requiste

1. Installation need be done in the same box of classic OPC DA/AE Server
2. WebSocket feature for IIS need be enabled in server box
3. Microsoft VC++ Runtim for X64 required (download here and install)

Installation

Download all files from server folder to a desired one. Launch a command line with administrator privilege and enter to downloaded folder. Run command "install.bat userAccount userPassword" to complete installation. userAccount need have administrator privilege.

To verify, launch browser (Chrome/Safari/Edge) and enter URL "http://localhost/OPC/websocket.html"

Uninstallation

Run command "uninstall.bat" in command line with administrator privilege from the downloaded folder to uninstall.

Usage

  1. Browse

    "browse" - Show all children tags under top level

    "browse:tagID" - Show all children tags for a specific tag

    "browse:tagID -countsInPagenation -pageNumber" - Show counted children tags in a pagenation for a specific tag. For example there are 10,000 children tags available under a specific tag and command "browse: tagID -2000 -3" will display 2000 children tags from 4000th to 5999th to correspond to page 3

    JSON return [{"n": "tagName1", "i": "tagID1", "b": 1}, {"n": "tagName2", "i": "tagID2", "b": 0}, ...]
    (n - name, i - ID, b - branch)

    When a "browse: Random" command is sent response will be like,

  2. Subscribe DA

    "subscribe: tagID1, tagID2, ..." - Add monitored tags to DA server and receive notification when values change

    JOSN return {"DA":[{"i": "tagID1", "v": "20.308", "t": 1643759756000, "q": 192}, {"i": "tagID2", "v": "4", "t": 1643759756230, "q": 192}, ...]}
    (i - ID, v - value, t - time stamp, q - quality)

    When a "subscribe: Random.Int1" command is sent response will be like,

  3. Unsubscribe DA

    "unsubscribe" - Remove all monitored tags from DA server

    "unsubscribe: tagID1, tagID2, ..." - Remove specific monitored tags from DA server

  4. Subscribe AE

    "subscribeAE" - Receive notification on alarms and events

    JOSN return {"AE":[{"s":"tagName1","m":"tagName1 Deviation is Low","c":"DEVIATION","sc":"LO","t":1643760803000,"q":192,"tp":4,"ec":2,"st":200,"a":1,"at":""}, {"s":"tagName2","m":"tagName2 Limit is Normal","c":"PVLEVEL","sc":"HIHI","t":1643760808000,"q":192,"tp":4,"ec":1,"st":500,"a":1,"at":""}]}
    (s - source, m - message, c - condition, sc - sub condition, t - time stamp, q - quality, tp - type, ec - category, st - severity, a - acknowledgement, at - actor)

    When a "subscribeAE" command is sent response will be like,

  5. Unsubscribe AE

    "unsubscribeAE" - Remove notification on alarms and events

  6. Disconnect

    "disconnect" - Close connection with server

  7. Help

    "help" or "?" - Display all supported commands and usages

Sample code output

Sample codes for different languages (Python/Swift/C#/C++/Java) are available in client folder

Python

Swift

C#

C++

Java

Roadmap

- Read/write feature in DA upon request
- HDA feature upon request
- Full-fledged open source native client for iOS
You might also like...
A barebones Swift HTTP client with automatic JSON response parsing.

HTTP Client A barebones Swift HTTP client with automatic JSON response parsing. Installation Add HTTP Client as a dependency through Xcode or directly

Lightweight REST and JSON library for Swift.

RestEssentials is an extremely lightweight REST and JSON library for Swift and can be used on iOS, iPadOS, macOS, tvOS, and watchOS. Features Easily p

Swish is a networking library that is particularly meant for requesting and decoding JSON via Decodable
Swish is a networking library that is particularly meant for requesting and decoding JSON via Decodable

Swish Nothing but net(working). Swish is a networking library that is particularly meant for requesting and decoding JSON via Decodable. It is protoco

To practice URLSession to fetch json data from open weather API
To practice URLSession to fetch json data from open weather API

โ›…๏ธ weatherApp-iOS-practice ๐Ÿ“Œ ๊ธฐ๋Šฅ ์ƒ์„ธ ๋„์‹œ ์ด๋ฆ„์„ ์ž…๋ ฅํ•˜๋ฉด ํ˜„์žฌ ๋‚ ์”จ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์™€ ํ™”๋ฉด์— ํ‘œ์‹œ๋˜๊ฒŒ ๋งŒ๋“ค์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค

An Alamofire extension which converts JSON response data into swift objects using EVReflection

AlamofireJsonToObjects ๐Ÿšจ This is now a subspec of EVReflection and the code is maintained there. ๐Ÿšจ You can install it as a subspec like this: use_fr

Lazily deserialize JSON into strongly typed Swift objects

LazyObject Lazily deserialize JSON into strongly typed Swift objects, with a few getter style options. Is your app using it? Let me know! Installation

Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and moreโ€ฆ)
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and moreโ€ฆ)

Perfect: Server-Side Swift ็ฎ€ไฝ“ไธญๆ–‡ Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

๐Ÿ’ง A server-side Swift web framework.
๐Ÿ’ง A server-side Swift web framework.

Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project. Take

A Swift web framework and HTTP server.
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

Comments
  • How do I setup another OPC DA Server?

    How do I setup another OPC DA Server?

    Hey There,

    The Websocket works with the Softing OPC Demo Server, I can read all of his Tag's. But the Idea of this Webserver I guess is to read/write Data from multiple OPC DA Servers, right? so how can i change the origin OPC DA Server?

    Thank you for help!

    opened by Domenik001 4
Owner
null
A slim implementation of a websocket server using Swift and Vapor 4.0.

Swift Websocket Server Example using Vapor 4.0 This project includes a minimum working example for a websocket server written in Swift. To interact wi

Adrian Hupka 5 Sep 22, 2022
Meet Corvus, the first strongly declarative server-side framework.

Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get

null 42 Jun 29, 2022
Elegantly connect to a JSON api. (Alamofire + Promises + JSON Parsing)

โš  Important Notice: Farewell ws... hello Networking ! Networking is the next generation of the ws project. Think of it as ws 2.0 built for iOS13. It u

Fresh 351 Oct 2, 2022
WebSocket(RFC-6455) library written using Swift

DNWebSocket Object-Oriented, Swift-style WebSocket Library (RFC 6455) for Swift-compatible Platforms. Tests Installation Requirements Usage Tests Conf

Gleb Radchenko 36 Jan 29, 2022
A conforming Objective-C WebSocket client library.

SocketRocket A conforming WebSocket (RFC 6455) client library for iOS, macOS and tvOS. Test results for SocketRocket here. You can compare to what mod

Facebook Incubator 9.4k Dec 27, 2022
Simple iOS app in Swift to show AQI for some cities using websocket using Combine + MVVM

AQI Simple iOS app in Swift to show AQI for some cities using websocket using Combine + MVVM This app follows MVVM This app uses combine framework The

Amey Vikkram Tiwari 2 Nov 6, 2022
Conforming WebSocket (RFC 6455) client library for iOS and Mac OSX

SwiftWebSocket Conforming WebSocket (RFC 6455) client library for iOS and Mac OS

null 0 Dec 24, 2021
Cross-platform JsonRPC client implementation with HTTP and WebSocket support

JsonRPC.swift Cross-platform JsonRPC client implementation with HTTP and WebSocket support Getting started Installation Package Manager Add the follow

Tesseract 5 Oct 19, 2022
OBSwiftSocket is a Swift library to be used for communication with OBS Studio via obs-websocket (v5).

OBSwiftSocket OBSwiftSocket is a Swift library to be used for communication with OBS Studio via obs-websocket (v5). obs-websocket v5 specification: ht

Edon 3 Sep 28, 2022
Swift/Obj-C HTTP framework with a focus on REST and JSON

Now Archived and Forked PMHTTP will not be maintained in this repository going forward. Please use, create issues on, and make PRs to the fork of PHMT

Postmates Inc. 509 Sep 4, 2022