cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Python "script engine" program error

Python "script engine" program error

Akseer
Established Member

Some background:

From what I have reviewed, there are following options to run the python scripts in ctrlX CORE device.

  1. First write the python script by using the IDE app and then execute the program by using python runtime app.
  2. Write the code on any host computer and then upload it via "Manage app data" option.
  3. Create custom app and install it in ctrlX CORE.

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.

Akseer_0-1680925549115.png

 

When I run the test code by selecting the "script engine" option, it's giving some errors as shown in the Logbook screenshot below. 

Akseer_1-1680925628253.png

 

Questions:

  • Is there something I am missing?
  • Configuring the python script to run at the power ON of ctrlX is confusing. Can someone please mention some steps?

 

Versions:
IDE = 1.12.7

Python Runtime = 1.12.4

Automation Core = 1.12.8

 

Any help will be appreciated, thanks.

10 REPLIES 10

BrightKnight
Member

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.

Akseer
Established Member

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

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

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.

Akseer_0-1681747499980.png

Akseer_1-1681747816282.png

 

CodeShepherd
Community Moderator
Community Moderator

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.

Akseer
Established Member

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

CodeShepherd
Community Moderator
Community Moderator

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:

  • Installing the ctrlX CORE - MOTION app
  • You can confirm specific errors out of your script:
    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.

Akseer
Established Member

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

CodeShepherd
Community Moderator
Community Moderator

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".

Akseer
Established Member

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.

Akseer_0-1685102799973.png

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

Akseer_1-1685103182264.png

 

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist