URCap / Toolbar runtime communication

My End Goal is to have a URCaps that allows me to select an image from a folder and have it display at run time on the full teach pendant with different instances of the URCaps changing the image.

I have so far created the URCap that reads all the images, displays them to the user, and allows one to be selected:

I am also able to create a JFrame using a toolbar that covers the entire screen which I like because it allows me to easily open and close it :

My Problem now is that I would like to update the image at runtime according to the selection in the URCaps instance. I have tried doing this by having a global variable in a singleton class and updating it from generate script. Sadly I had to learn that this is executed only at the beginning and not at runtime which means I can change the image at the start but not in sync with the robot program.

I am currently stuck trying to find a good way to allow for this kind of synchronization. Some ideas I have had are using RTDE although that seems rather complicated, using IOs, and setting the IO using script. I also thought about using some of the IO ports to create a binary representation of the image index.

I would be extremely thankful for any suggestions to the project as a whole and if there are completely different / better ways to solve this or ways to create runtime communication between the program nodes and the toolbar.

Thank you very much,

Well, I got it to work by converting the selected image index to binary and using 5 digital_outputs to display the binary which is then read by the toolbar.

But this seems … bad

Hi Fred…

from the info you have given im not completly sure what it is you actually want, maybe if you providede some code it might be easier to help you.

but from what i can sense it seems some what familier to this

which is basically a custom popup called from URScript using a couple of hacks.

1 Like

We want to use the teach pendant as a sort of instruction monitor while to robot program is running. So we would have a bunch of PowerPoint slides converted to images in a folder and a URCap that can be inserted in the robot program where you can select the slide that you want to change to.
We are accomplishing showing a fullscreen image on the teach pendant through a toolbar that opens a JFrame which is given an image.

The problem we are having is that from my understanding the only thing that gets executed by a URCap at the time it is used by the robot program is script code. So ideally I would just change a variable with script code that can be read by my toolbar.
The toolbar uses a timer in openview that checks every second if the variable has been changed and changes to the corresponding image.

But there seems to be no way to read anything from script code so the idea i came up with is using script code to change digital outputs to on and off to represent the integer i want to send to my toolbar in binary.

But this does indeed look helpful! I will see if i can get it to work
Thank you very much :slight_smile:

Hi Fred.

That Claifies it quite a bit.
then I think the link i sent you sound be quite helpful.

the general step is to have a toolbar like you already have but it should be placesd in an installation node.
a thread in the installation node should then communicate with a daemon.

the deamon will then work as a communication bridge between the installation java code and the Urscript.

the program nodes should then send and image id or name to the daemon through script using the generateScript call.
the daemon then stores this value
the thread in the installation monitors this value ses that it has been changed and create the correct popup…

Hope this is helpfull

1 Like

This is extremely helpful!!
Thank you very very much,
I will get back to you when I have tried implementing it

Best regards,