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