Home› Programming
Discussion
Back to discussions page
TVRU
Posts: 7 Apprentice
Signal light and blocking popups |
52 views
|
Answered | |
/ Most recent by TVRU
in Programming
|
6 comments |

in Programming
We're integrating a UR in combination with a signal light. The signal light represents any required action:
Now (as a short-term solution) we're manually building code around every pop-up, or scripting it, so the yellow signal light is on as long as the pop-up is active. This however seems a bit unwieldy, since:
- Green: robot running without issues
- Yellow: operator input required (e.g. blocking pop-up active)
- Red: robot stopped, or error active
Now (as a short-term solution) we're manually building code around every pop-up, or scripting it, so the yellow signal light is on as long as the pop-up is active. This however seems a bit unwieldy, since:
- .. there is an option in scripting to set 'blocking' to true or false, which suggests it's a variable that can also be requested if necessary. We didn't find a way however to read this variable in a separate thread.
- .. the run-mode of a thread is changed from running to paused. We didn't find a solution to check the run-mode in a separate thread, to set the signal lights accordingly.
Then in your code when you want to call the custom popup just use a single script line
Thanks a bunch!
In order I did:
- Create two separate script files: CustomPopup.script and ThreadBlinkYellow.script
- Import them in BeforeStart - this resulted in a syntax error, so I deleted it again.
- Created a separate thread in which the ThreadBlinkYellow.script is ran - this also resulted in a syntax error, so I deleted it again
- Cut the thread call and kill from the CustomPopup.script and ran it in BeforeStart - this also resulted in a syntax error, so I deleted it again. It seems it doesn't like to be initiated without having a value for 'msg'
- Not literally import the scripts in the program, just try to run the single-line command 'customPopup("test") - this resulted in an error, as I expected, but it was worth trying.
When I search the forum I come over this page: https://www.zacobria.com/universal-robots-zacobria-forum-hints-tips-how-to/thread-in-script-file-example/. This didn't help me any further either.So, as a follow up question: where should I import the scripts, to be able to run it later-on?
Thanks beforehand!
In order I did:
- Create two separate script files: CustomPopup.script and ThreadBlinkYellow.script
- Import them in BeforeStart - this resulted in a syntax error, so I deleted it again.
- Created a separate thread in which the ThreadBlinkYellow.script is ran - this also resulted in a syntax error, so I deleted it again
- Cut the thread call and kill from the CustomPopup.script and ran it in BeforeStart - this also resulted in a syntax error, so I deleted it again. It seems it doesn't like to be initiated without having a value for 'msg'
- Not literally import the scripts in the program, just try to run the single-line command 'customPopup("test") - this resulted in an error, as I expected, but it was worth trying.
When I search the forum I come over this page: https://www.zacobria.com/universal-robots-zacobria-forum-hints-tips-how-to/thread-in-script-file-example/. This didn't help me any further either.So, as a follow up question: where should I import the scripts, to be able to run it later-on?
Thanks beforehand!