Universal Robots Forum

Reset and hardcoding Drop down

Hello

I am creating a rather simple URCap based on the Whip sample. My only goal with the URCap is to transform textinput into variables. I have based it on the Whip sample as it has textinput.

And it works brilliantly, but with some minor issues.

  • I use “value=”"" in my programnode.html to preset values. The URCap doesnt recognize these preset values, even though the values are within the limits of “isDefined()”. The “isDefined()” isn’t returned true until I manually input the same values.

  • When I have used the URCap once in my programtree, and want to use it again, the same sort of problem arises. It then selects the values set in the previous URCap, and “isDefined()” is false, even though they are within limits. Again I can set them manually with the same number, and it is returned true.
    The Whip sample does the same thing, in its standard form. So what is missing? =)

I want to implement a drop-down menu, and I have looked at the samples. The samples only include drop down coding where the content of the drop down is imported. I need the content of my drop down to be hardcoded. I was hoping that I could code it in HTML using , but that doesn’t seem to work. I need the content of the drop down to show text, that represents a number, from which I can write to a variable.
I have found the following topic on the forum, but I could get it to work.

How do I implement such a drop down? Does anyone have a sample or the needed coding for it?

Best regards Jes Peter

You must create the dropdown list using the SelectDropDownList object in Java.
The HTML parser cannot populate the dropdown, and any “option” elements in HTML are discarded.

So use the code referenced here;

And use selObject.addItem("MyItem") to add your items.
You could populate this in the Constuctor or openView.

Hello Jacob

Thanks for your quick reply. I am still struggling. I cant get any items in my drop down. Can you give a more specific example with a few options?

btw. solve my first problem with som coding from the UR3 Screw cap =)

I found my issue. Thanks again Jacob!

It would be great, if you wrote what your problem was. You know, for others and for yourself six months from now. Otherwise this forum will be full of topics ending with “nevermind, I figured it out”.

4 Likes

Oh yes, where is my forum manners =)

Actually my problem was in my version of the SDK. Was using an older version due to WMWare crashed whenever i was in the “Graphics” tap. An WMWare reinstall and being able to run the newest SDK version solved it =)

2 Likes