{"id":1435,"date":"2024-09-03T10:01:15","date_gmt":"2024-09-03T08:01:15","guid":{"rendered":"https:\/\/www.rocworks.at\/wordpress\/?p=1435"},"modified":"2024-09-03T10:01:33","modified_gmt":"2024-09-03T08:01:33","slug":"mqtt-server-interface-for-wincc-oa-made-with-kotlin-%f0%9f%98%b2","status":"publish","type":"post","link":"https:\/\/www.rocworks.at\/wordpress\/?p=1435","title":{"rendered":"MQTT Server Interface for WinCC OA? Made with Kotlin \ud83d\ude32"},"content":{"rendered":"\n<p><br>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.<br><br>\ud83d\ude48 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.<br><br>\u2753 But wait, Kotlin is like Java, it runs on the JVM, it is not JavaScript!<br><br>\ud83d\udca1 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.<br><br>\ud83e\udd29 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.<br><br>\ud83d\udc49 Here it is: <a href=\"https:\/\/github.com\/vogler75\/winccoa-graalvm\">https:\/\/github.com\/vogler75\/winccoa-graalvm<\/a> 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.<br><br>\u26a1 Please be aware that the GraalVM Node.js Runtime is not officially supported by WinCC Open Architecture.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"549\" src=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM-1024x549.png\" alt=\"\" class=\"wp-image-1436\" srcset=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM-1024x549.png 1024w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM-300x161.png 300w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM-768x412.png 768w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM-1536x824.png 1536w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/09\/WinCC-OA-GraalVM-2048x1099.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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. \ud83d\ude48 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 &hellip; <a href=\"https:\/\/www.rocworks.at\/wordpress\/?p=1435\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">MQTT Server Interface for WinCC OA? Made with Kotlin \ud83d\ude32<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,3],"tags":[54,59,75],"class_list":["post-1435","post","type-post","status-publish","format-standard","hentry","category-mqtt","category-wincc-oa","tag-mqtt","tag-scada","tag-winccoa"],"_links":{"self":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1435"}],"version-history":[{"count":3,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions"}],"predecessor-version":[{"id":1439,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions\/1439"}],"wp:attachment":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}