Tag Archives: WinCC OA

WinCC OA & Node-Red Integration

It is very easy to get data from WinCC Open Architecture to NodeRed.

Add a new user to WinCC OA – System Management / Permission / User Administation.

We will use “node” as username.

Add Config Entry

[wssServer]
httpsPort = 8449
resourceName = "/websocket"

Start Control Manager “wss.ctl -user <username>:” Note the trailing “:” !!

wss.ctl -user node:

Node-Red: Install Palette “node-red-contrib-winccoa”

You can now add a Node. In that example we will use the dpQuery node and use “SELECT ‘_online.._value’ FROM ‘Meter_Input_WattAct.'” as query. So we just query the online value of one tag.

You have to configure the Server by clicking on the pencil button. This points to the before started Websocket Control Manager and you have to set the username and password we have added in one of the previous steps.

UNS with WinCC Open Architecture?

Did you know that WinCC Open Architecture is “UNS READY”? 👍

And it even does not matter how your underlying tags are structured 😼

👉 You can create your own hierarchical view on tags which you want to publish to MQTT in a Unified Namespace!

👉 You can define a fully ISA 95 compliant view on top of your machine data!

Happy UNS Publishing with WinCC Open Architecture!

See the MQTT publisher at the WinCC Open Architecture Documentation

Generate QR Code Image in WinCC OA …

Add a label object into your screen and add some lines of code to get a QR image. In this example a mobile phone app will scan the QR code and send username and password via a GraphQL server to WinCC OA and set it on datapoints (username and password should additionally be encrypted).

#uses "CtrlQRCode"

string g_code;

main()
{
  g_code = createUuid();
  strreplace(g_code,"{", "");
  strreplace(g_code,"}", "");
  DebugTN(g_code);

  string fpath = PROJ_PATH+"/pictures/";
  string fname = "login_qr_code_"+myUiNumber();
  int ret = createQRCodeFile(g_code, fpath+fname);
  this.image=fname+".png";

  dpConnect("work", false, "QRLogin.code", "QRLogin.usr", "QRLogin.pwd");
}

void work(string dp, string code, string dp1, string usr, string dp2, string pwd)
{
  if (code == g_code)
  {
    setInputFocus(myModuleName(), myPanelName(), txt_username.name());
    txt_username.text = usr;
    setInputFocus(myModuleName(), myPanelName(), txt_password.name());
    txt_password.text = pwd;
    m_loginFrameworkController.doContinue();
  }
}

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

Cassandra for WinCC OA & Performance…

Did a first test with Cassandra as NoSQL database store for WinCC OA event logging.

Cassandra was easy to install, pretty good write performance and very good read performance. Compared to e.g. OpenTSDB the CPU load on client and server are higher.

Test-Setup: 5000 values/second, 24h, 392 Mil.Records, One Hyper-V server on an i7 3.1Ghz with 4 Cassandra nodes, each node with two cores, disks on a shared storage space device with 4 disks and raid 0 (i know that’s not a real life scenario for a NoSQL cluster). WinCC OA and the Java-Historian-DB-Logger running on another Hyper-V server on an old i5 CPU 750 @ 2.67 Ghz.

Cassandra Performance Stats

Cassandra Workload