Universal Robots Forum

URCap Sample: Dialog Script URCap for opening dialog in robot program

Dialog Script URCap

Description of functionality:

  1. In robot program, the input dialog is opened by “showDialog()” on script.
  2. The value of textbox is returned to variable when “OK” is clicked.


URCaps SDK v.1.9.0



That’s pretty cool. Is there a reason thought that you did not use the built-in functionality for that?

Hi @mbush

This form is sample.
Actually my operating form is the below.

That is pretty cool. So do you have to define what you want the questions to be and what variables they are assigned to in the URCAp code?

Yes, I do.
But the variable to which each question is assgined can be defined in robot program.

This is useful. I needed this exact thing and I had also noticed that the built-in dialogues wouldn’t quite do that. Thanks for this!

Hi @anna
Thank you for your comment.
Would you tell me for my information what purpose you want to use this?

Sure. We are an injection molding company. We have a UR5 integrated with a vision system to do inspection. Each run of parts has a unique job number, and for the purpose of tracking and logging inspection results, I have a window prompt the operator to enter that job number at the beginning of a run.

Because there are often reasons to stop and restart during the job, it is cumbersome to enter the number every time the program starts. What I wanted to do is have a popup at program start that displays the current job number and asks if it’s correct. If not, a new window comes up where the correct number can be entered.

I found that I couldn’t get a window to display a variable AND a question at the same time. I had to make 3 separate windows to ask the question: 1st one prompts the operator to check the number, they hit OK and the 2nd window shows the number, they hit OK and the 3rd window asks if it was the right number. This approach is cumbersome, so I’m glad you’ve made a popup that will let me reduce it to a single window.

I am so glad to serve you.
When I started using UR, I used multiple pop-up windows on my company production line as well. It was cumbersome for us too, I studied the development of URCaps and developed the function for opening such as custom dialog.

1 Like

If you are going to certify a UR+ product with this, be careful to check that this conforms to the UR+ guidelines.

We cannot have any popups that block safety notifications!

Hi @Savoia

Thank you for your advice.
Is it mean the custom dialog may hide the safety popup?

That is certainly something we would test for prior to certification, yes.

I see.
I use this feature only in the factory of my company.
And I uploaded as sample so I have no plan to ask to certify upcap with this now.

But is there anyone who would like to apply this for certified urcaps?

This is exactly what I am looking for.
Are you able to release the code to get the dropdown selection?
I am only just starting to learn Java and cant seem to get a dropdown list to work.