FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We are updating our platform to a new
system.
Read more: Important
information on the platform change.
10-04-2023 05:11 PM
Hi everybody,
I am recently experimenting with Python scripting in PLC Engineering, and wondering if there is any python library to navigate through Objects(System, projects, etc.) more easily?
For example instead of studying the object "path" e.g. system.ui.choose() step by step from CODESYS Scripting Engine online help, just to type . and have access to some suggestions as usual. I think it would make programming much faster.
Kind regards
Solved! Go to Solution.
10-04-2023 07:04 PM
Hello,
It looks like CODESYS has a Python Editor add-on with intellisense. I haven't used this, so no comment on its utility.
Alternatively, you could develop Python scripts in the environment of your choice (VS Code has tons of Python extensions) and execute them using the Python Runtime application on the ctrlX CORE via the PLC.
See CODESYS library documentation here: CXA_Python
10-05-2023 09:07 AM - edited 01-23-2024 05:53 PM
There are 2 python programming environments in the ctrlX environment that have nothing to do with each other. Two different things, just use the same programming language.
1. python app of the ctrlX
Runs on the ctrlX and can execute e.g. motion commands. The python app is used by the IDE app.
2. plc engineering python script
Runs on the engineering PC. With this you can e.g. read and change PLC program code. There is a licenses for a python editor which makes it easier to create programs, by code completion and other help. But you do not need it. I don't have any experiance with this editor, but my experiance with the CoDeSys Python docu is: Could be much better, is is hard to understand. I got most information from examples, but even there could me more examples.
10-05-2023 02:39 PM
Ahh, I see now I misunderstood the initial question.
If you are using the ctrlX PLC Engineering REST API, I don't think intellisense will be possible on the PLC project data since the interaction is stateless.
From a brief review of the CODESYS Python script engine it doesn't look like there is native intellisense functionality. I found a forum discussion around this topic and it looks like there may be a workaround, but I have not tried this myself.
11-15-2023 08:42 AM
Are there any news? is this still an issue? Or can this topic be closed?