MQTT Server Interface for WinCC OA? Made with Kotlin 😲


Starting with WinCC OA Version 3.20, you can write your business logic in JavaScript and run them using Node.js, providing direct access to the WinCC OA Runtime.

🙈 With that, I have developed a Kotlin program that acts as an MQTT Broker. When you subscribe to a topic (where the topic name matches a datapoint name), the program will send value changes from the corresponding WinCC OA datapoint to your MQTT client.

❓ But wait, Kotlin is like Java, it runs on the JVM, it is not JavaScript!

💡 Did you know that a Node.js Runtime built with GraalVM exists? It allows you to mix Java and JavaScript. And it also works with WinCC OA.

🤩 You can use JVM based languages and its huge ecosystem to develop business logic with WinCC OA. I have developed a Java library which makes it easier to use the WinCC OA JavaScript functions in Java.

👉 Here it is: https://github.com/vogler75/winccoa-graalvm please note that the example program is provided as an example; it lacks security features and has not been tested for production use. However, it can be extended and customized to meet specific requirements.

⚡ Please be aware that the GraalVM Node.js Runtime is not officially supported by WinCC Open Architecture.