is it possible to program an app using Python? If yes, what is the purpose of providing the ctrlX CORE Python Runtime App?
For sure, I'm just asking for a friend 🙂
Thanks in advance.
Solved! Go to Solution.
Maybe the following thread could be of interest to you [How to run Python scripts on ctrlX CORE]
Thanks for your answers!
You are now officially part of the developR series 9.
Thanks AndyL for the link to the Python how to! We identified the question as a possible open question to include in the series regarding our ctrlX AUTOMATION Community.
One funny aspect: As we entered the subject line, our intellisense already proposed exactly this How To 🙂
A simple Python app that accesses the data layer via the REST API is available here: https://github.com/bostroemc/webconnector-lite
The app polls a (fixed) PLC variable, then pushes the value out a WebSocket where it may be read by a web page. (A sample html page with the required WebSocket client is included.)
To build the app for the ARM-based ctrlX CORE, I used the build tool supplied by Canonical: https://snapcraft.io/
Note that the PLC variable TYPE is not fixed, and may be any simple type (DINT, REAL, etc.) or even an array of these simple types.
Until Python is fully supported by the SDK, access via the REST API might be a good option for some applications. (Note that this sample app is fully self-contained does not require that the "Python app" be installed on the CORE.)