Category Archives: Allgemein

IoT with WinCC OA and Raspberry Pi (Demo at Cern)…

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!

IoT with WinCC OA and Raspberry

Slides can be download from Cern: https://indico.cern.ch/event/524996/timetable/#20160609.detailed

SmartHome Presentation Cern

Streaming WinCC OA Events to Apache Kafka and Spark…

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.

WinCCOA-Kafka-Spark

Java is everywhere… WinCC OA Java Manager…

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();

WCCOAjava

ElasticSearch and WinCC OA …

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

Kibana-Dashboard

Screen Shot 2016-03-31 at 20.48.52Screen Shot 2016-03-31 at 20.34.52

Hadoop OpenTSDB timeseries database and Grafana with WinCC OA…

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.

Grafana

How to use “server side database access” (sdb.ctl) for WinCC OA

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