Implemented a Manager and a Driver for Epics (in Java).
Implemented a Manager and a Driver for Epics (in Java).
I had the opportunity to demonstrate an IoT prototype based on WinCC OA on a Raspberry Pi at Cern.
WinCC OA is running on the Raspberry Pi and it is sending values of a temperature sensor to my WinCC OA server at home over MQTT (Thanks to HiveMQ).
In that case just a simple average calculation is done with WinCC OA on the Raspberry, but many other things can be done with WinCC OA on the Raspberry – Edge Computing.
Additionally the server can send an action to the Raspberry to turn on/off a simple LED on the Raspberry. The Raspberry with WinCC OA is a tiny Cyber Physical System (CPS)…
Cern is using WinCC OA since 2000!
Slides can be download from Cern: https://indico.cern.ch/event/524996/timetable/#20160609.detailed
We connected a Event Data Logger, written in Java and connected to WinCC OA by JNI, to Apache Kafka, a A high-throughput distributed messaging system.
Apache Spark can read data from Apache Kafka streams. Apache Spark is a fast and general engine for large-scale data processing. Combine SQL, streaming, and complex analytics. Spark powers a stack of libraries including SQL and DataFrames, MLlib for machine learning, GraphX, and Spark Streaming. You can combine these libraries seamlessly in the same application.
From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere! Now connected to WinCC OA.
Here you will find an implementation of an API to connect WinCC OA to Java. It is based on the WinCC OA native API and JNI. This version is for WinCC OA 3.14 on Windows. Same works on Linux, but is not in the Zip, if you want it for Linux, just send me an email.
An example for a dpSet in Java see blow, more examples are in the zip/source directory. The JClient class is an easy to use static class. It should be thread safe and callback functions are processed in a separate thread, so that the main WinCC OA thread/loop will not be blocked by callback functions.
Based on that a NoSQL database logger was created, it is able to handle up to 40000-50000 value changes by dpQueryConnect. MQTT was connected to WinCC OA with a few lines of code (see WinCC OA and MQTT).
Download from GitHub: https://github.com/vogler75/oa4j.git
How to use/install? In the zip is a ReadMe.txt with a step by step instruction.
JManager m = new JManager(); m.init(args).start(); ret = JClient.dpSet() .add("System1:ExampleDP_Trend1.:_original.._value", new FloatVar(Math.random())) .add("System1:ExampleDP_SumAlert.:_original.._value", new TextVar("hello world")) .await() .getRetCode(); Debug.out.log(Level.INFO, "retCode={0}", ret); m.stop();
With a Java-Datalogger we can write events and alerts to different data sinks. For example we can use ElasticSearch and Kibana to discover alerts collected by WinCC OA. Elasticsearch provides full text search, analytics, dashboards. And now it also supports graphs!
“Graph introduces a new way to discover, and explore, the relationships that live in your data. Adding relevance to the process of exploration, a unique combination of graph and search means you can do things like detect fraud, recommend content, and more.” https://www.elastic.co/de/products/graph
Forwarding events from WinCC OA to OpenTSDB, which is based on HBase. Based on OpenTSDB Grafan can be used to build cool dashboards in a very fast way.
Live Example (my photovoltaic data) : http://82.149.127.81/grafana
On my test environment (i7 with 32gb RAM and 8 threads) i was able to push about 20000(!) values per second from my WinCC OA system to my Hadoop/HBase cluster. WinCC OA and the Hadoop Cluster are running on Hyper-V.
C# prototype library for WinCC OA communication. For testing i created C# clients with gauges and a chart. Those clients are connected to WinCC OA datapoints (dpConnect, dpQueryConnect, dpGet, dpSet, …) For testing purposes i started some clients to see how it works with many clients and change rates of about 100 values/second…
An example how seamless WinCC OA is able to communicate with the Browser-Widget and JavaScript.
The sdb.ctl is a client library which can be used to access relational databases from the WinCC OA client without the need to install any database client software at the client. The connection to the relational database is handled by the WinCC OA server. The client communicates with the WinCC OA server only by data points. The SQL-Statements are transferred by data points to a WinCC OA control, this control executes the SQL-Statements and sends back the result to the client by data points.
Howto: sdb
A new HowTo and FAQ Portal for WinCC OA, Oracle and more is now online: http://www.winccoa.net/