FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
11-18-2020 04:13 PM
Dear Community,
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.
Regards, Pedro
Solved! Go to Solution.
11-18-2020 04:18 PM
Hi Pedro,
the support of Python in the SDK is still in preparation, target date is about March 2021.
Regards, Johannes
11-18-2020 04:19 PM
Hi,
11-19-2020 08:12 AM
Hi,
Maybe the following thread could be of interest to you [How to run Python scripts on ctrlX CORE]
11-19-2020 09:11 AM
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 🙂
Regards,
Pedro
12-02-2020 09:07 PM - edited 12-02-2020 09:11 PM
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.)