How do I implement a non-blocking popup

You cannot directly generate a non-blocking popup in polyscope using the ‘popup’ command. To do this you need to send a command to the dashboard server. This example does this via a urscript function and sending the appropriate command to the robot itself (e.g. using loopback address of 127.0.0.1) and using port 29999 which is where the dashboard server is listening. Here is what that code looks like and an example is attached (built for CB3 polyscope but compatible with e-series too).

callpopup.urp (1.4 KB) nbpopup.script (664 Bytes)

2 Likes

You can also issue a script command with blocking= false

Example:

popup(“here I am”, title=“Popup #1”,blocking=False)

3 Likes

Another possibility is using a thread to prevent the blocking and using a WaitUntil variable to trigger execute the thread–or use an EventThread. A relatively simple method is to use the message variable to trigger the popup whenever a new message is written. (newMessage<>oldMessage) The plain thread won’t display the same message twice in a row, though.

The EventThread could be triggered by setting the message text variable and then setting a boolean event trigger variable to TRUE, though. If the Event Thread reset the trigger, it could be tripped over and over without having to change the message.

This has a lot more overhead than Pho’s solution and I have to disclose that I haven’t tried any of these solutions. Am just brainstorming on this while I was in the forum neighborhood.

Thanks for the ‘blocking=FALSE’ tip, Pho. I didn’t know this was possible.

1 Like

The other difference between the first method (using dashboard server) and the 2nd method (straight popup script) is that the popup() script still presents the user with the STOP PROGRAM button on the dialog.

1 Like