No, you didn't miss anything. Basically the easiest way to do this is to write your own function that does exactly what you want it to do. Something like this would work
def customPopup(msg, blocking = True): #Would give you the ability to use this in a non-blocking fashion and should not flash the yellow light since the thread would be killed as soon as it was started
local threadID = run flashYellowThrd()
popup(msg, title = "Our Popup", warning = False, error = False, blocking = blocking)
kill threadID
set Yellow Low
end
thread flashYellowThrd():
while (True):
set Yellow High
wait 0.5
set Yellow Low
wait 0.5
end
end
Then in your code when you want to call the custom popup just use a single script linecustomPopup("Some message that requires an operator to be notified that its on the screen so flash the yellow light")
We're integrating a UR in combination with a signal light. The signal light represents any required action:
- Green: robot running without issues
- Yellow: operator input required (e.g. blocking pop-up active)
- Red: robot stopped, or error active
Green and red don't pose any problems, after attaching a couple of relays and configuring outputs, but an easy solution to turn on the yellow light when operator input is required turns out to be harder than we thought.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.
Did we just miss an option in scripting, didn't we look in the right solution space, or is the unwieldy way the only way?