Detect program running in URCaps

Hi,
Yes! I ended up having my URCap read the secondary socket at port 30002 and decoding all the Robot Mode Data. As my original need was only to detect if the robot was running or not this seemed overkill.

However, I have now have learned quite a lot and created a nice interface for reading/writing robot data and commands in a URCap. Can read or control just about anything on the robot at this point. I may make this available at a later time as a developer tool. It was definitely a PITA to figure this out from scratch.

Decoding the data in this spreadsheet was a challenge. NOTE: Keep reading data from the secondary until you get the RobotModeData! There is a lot more undocumented stuff read on this port you have to skip past.
https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/remote-control-via-tcpip-16496/

This example helped a lot for senidng data to the secondary port: Can urcap send and execute ur script within the program node? - #12 by jbm

In hindsight…Skip all that and just use the dashboard server! Not sure how I missed that in the beginning. :frowning:

Dashboard Server, port 29999 - 15690

Send “running” and you should receive a single line response back “Program running: True” OR “Program running: False”

Simple!

Thanks for letting me vent.

2 Likes