Socket Connection Question

I wanted to ceate a socket connection with my UR3e using python and secondary client interface. But I wanted to do a condition where the connection can only be done if the robot is turned on. I wanted to ask if theres a UR Script command that returns if the robot is turned on or off.
Thank you!

So I believe you connect to either port 30002 or 30012 for secondary client. The later is read only which would probably work, but I believe UR says primary and secondary interfaces are mainly used for runtime of Polyscope (main use is for Threads, Events, and other subprograms). If you are constantly querying this interface you ‘may’ have conflicts with URcaps or other programs running in the background.

Just a caution, but the command on this interface is:

isRobotPowerOn #returns true if on, returns false if off
1 Like

Thank you for your response! Would using RTDE not have probelms with programs that are running in the background? If so, is there a way to use RTDE with UR Script?

I also wanted to ask about how it is that I can retrieve the value for isRobotPowerOn in my code. For example when I say print(isRobotPowerOn) in python it shows me that it has not yet been defined.

Sorry my first post was a bad description/take of the UR client interfaces. Each have their unique features and limitations (read/write, command nomenclature, packed data/recipes, and robot mode requirements), you can check out more here at this link

https://www.universal-robots.com/articles/ur/interface-communication/overview-of-client-interfaces/

Communication protocol will change depending on which interface you are using. Depending on your plan to read/write to robot or just query the power state there are multiple ways to do this.

Some of these interfaces require a good understanding of sending/receiving packets of data and decoding to find the useful information you are looking for.

Hello,
Try Dashboard server, you can start, pause or stop the robot from there.
Check the article here:
Dashboard Server e-Series, port 29999 - 42728 (universal-robots.com)