Hi there,
Is there any plans to have compatibility between Ignition (latest version) and Python 3.x?
Thanks
Erik
No, not soon.
If a stable Jython 3 release ever happens we’ll evaluate whether or not we can even upgrade while preserving backwards compatibility, but it’s not something we’re prioritizing or has a timeline.
Thanks @Kevin.Herron
What’s the best way to interface our Ignition project with an external script running Python 3.7 for example?
depends upon what you want to achieve? How tightly is the external script coupled with Ignition tag database or sql database.
Similar request here:
Keep in mind that Jython3.x still won't support any dependencies that use C DLL interfaces, so you could find yourself disappointed anyways.
Thanks @PRAMANJ, I would like to run 2 applications independently (1 is Ignition, and the other is a Python Script), both could access the same DB.
How would you hand-shake data/signals between these 2 apps (e.g a calculation from the Python script to use in the Ignition project and vice versa)?
Is you’re python 3 stuff just running scripts on a database, that’s all?
Personally I’d probably make a flask server to host your python 3 stuff on, and then you can use the system.net.HTTPVerb functions https://docs.inductiveautomation.com/display/DOC80/system.net to talk to your flask server to tell it to do something, or to get data from it.
To go the opposite way, to have your flask server tell Ignition to do stuff, I believe you would need the Web Module to create an API on Ignition for flask to send get/post requests to, but I don’t have too much experience with that.
You could set up an inter process communication like a socket connection between your external python 3+ application and the existing jython 2+ scripts in Ignition and communicate between the two thru a handshake. It may also be possible for your external application to access the same SQL data base for historical data as Ignition.
However , beware the socket on Ignition should be a java socket rather than a jython socket as java sockets are more efficient and reliable than jython sockets. (We have a module for the Java scoket using jython in Ignition!).
That’s also a possible approach if the external python 3 application is a web application. If its just a standalone application, then I think a simple socket approach is good enough in my opinion.
Makes sense. I used to be a web developer so my my go to is API, and setting one up wtih flask is quick and easy so that was my first thought. I’m sure there’s many ways to tackle this situation.
Its been three years since this post creation, so was wondering if anything planned ?
Is there any plans to have compatibility between Ignition (latest version) and Python 3.x?
Jython will need to support Python 3 first since that's what Ignition uses.
Nothing planned right now.
Honestly, this doesn't seem likely in the next couple years, if ever. The backwards incompatibility issues are insurmountable imo. The way I see it, the best case is that we introduce new/parallel scripting engines, with Jython3/Python3 being one possibility. But this idea comes with its own bag of compatibility issues.
See also my comment above about Jython 3.x, if it ever arrives, not supporting CPython 3.x DLLs.
So if your inquiry relates to some machine learning or number crunching application that runs in Python3, you will be disappointed, as it will run as well in Jython3 as it does in Jython2. (Not at all.)
Is there any discussion of an alternative to Jython, like GraalPy (GraalVM) for Python 3?
I'm not super familiar with the Java ecosystem and how everything interacts, but if it runs on a different VM than Ignition does, I doubt the switch can be made. The whole point of running jython, I believe, is that it runs on the JVM, just like Ignition does. Unless they make it run on GraalVM, I don't see GraalPy being an option.