FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
04-08-2023 06:08 AM
Some background:
From what I have reviewed, there are following options to run the python scripts in ctrlX CORE device.
Moreover, if we take option 1, then it also has two options, 1) run the program for temporary time via green button, & 2) write the code in "script engine" in case we want to run the program continuously.
What I am trying to do?
In my case, I am using the Textual IDE to write and python runtime to run scripts. I am currently trying to create a test program in "script engine" that can run continuously, in case of failure, and at the power ON of ctrlX CORE device. Following is the screenshot of test program I am trying to run.
When I run the test code by selecting the "script engine" option, it's giving some errors as shown in the Logbook screenshot below.
Questions:
Versions:
IDE = 1.12.7
Python Runtime = 1.12.4
Automation Core = 1.12.8
Any help will be appreciated, thanks.
Solved! Go to Solution.
04-13-2023 09:41 AM
Hello,
i'm a developer from the IDE App. We tried to reproduce your issue with the latest version of IDE App. There the issue is not reproducible. So we suggest you to update to IDE version 1.18.7.
You need access to the collaboration to get this version.
04-13-2023 01:30 PM
Hi,
Thanks for the information.
In the collaboration room, it's showing the same version 1.12.7.
I have used this "link" to access the collaboration room. Please let me know if there is another access link.
Regards
Akseer Ali Mirani
04-14-2023 10:27 PM
Hello Akseer
I assume you have "only" access to the official release - version 1.12.
The version 1.18 is a pre-release version. To download this version you need a special permission. To get access please read following how-to and follow the descriptin.
https://developer.community.boschrexroth.com/t5/Store-and-How-to/FAQ-for-ctrlX-Store/ba-p/23749
Regards
Jochen
04-17-2023 06:10 PM
Hi,
This is an update that I have tested version 1.18.7 and it's working as shown in the figure below. However, the logs are still showing same errors after launching Python in Script Engine.
04-20-2023 11:54 AM - edited 04-20-2023 11:55 AM
Exiting a running script without return a "0" will always be interpreted as an error by the script engine. See this topic for further information.
05-10-2023 09:03 PM
Hi,
Sorry but no matter what code I use in Textual IDE, the script engine throws an error at the start of script. The python script is working fine, but the PLC led is turning to red once there is an error. I have tried to execute the scripts using Node-RED as well; however, no luck so far.
Is there any way to avoid this error?
Is there any method to clear this error from the logs using the same python script? This way the error can be removed.
Thanks
05-11-2023 04:11 PM
Now I found the root cause. The script interpreter is checking for sources he needs to use while running even those not actually used in the customer code. As there is no ctrlX CORE - MOTION app installed it will show the error you are seeing. I will take this and discuss with our R&D.
Your possible workarounds are to get rid of the error message:
datalayer.write_json("diagnosis/confirm/error", "{'mainDiagnosisNumber': '081F2001', 'detailedDiagnosisNumber': '0C270307', 'entity': 'script/instances/test'}")
But the error needs to be present to be confirmable, otherwise the diagnosis system will tell you that it could not be.
05-24-2023 05:18 PM
Thanks for the information.
The installation of Motion app is not clearing the logs in my case. Can we first read the errors by using either Node-RED or IDE before confirming them? Thanks
05-25-2023 08:03 AM
Did you try to reboot your ctrlX CORE after installation of the motion? What errors exactly are now shown, as I could fix mine?
You can read out a list of all pending errors via the data layer on path "diagnosis/get/actual/list".
05-26-2023 02:13 PM
Hi,
Thanks for the hint on how to read the pending error messages.
The installation of Motion app and then restarting of ctrlX CORE indeed fixed the issue. I am no longer getting the error having 'detailedDiagnosisNumber': '0C270307'.
However, i don't know why but the detailed error code is slightly changed and all other details are same.
I have fixed the non-required pending errors issue by creating a Node-RED flow. Please find attached the Node-RED flow file. This can be used for the time being to resolve the non-required pending errors issue in ctrlX CORE. Thanks